Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 9th, 2005, 11:31 PM
Registered User
 
Join Date: Jul 2003
Location: , , Bangladesh.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Oracle global temporary table and VB

I have create a global temporary table in oracle database as follows

Create global temporary table tmpDataGroup
(
DATAGROUPID number(15),
DESCRIPTION VARCHAR2(50)
) ON COMMIT Delete ROWS ;

Then I create following package and stored procedure.

CREATE OR REPLACE PACKAGE sp_getData AS
    TYPE cursor_Data IS REF CURSOR;
END sp_getData;


CREATE OR REPLACE PROCEDURE sp_GetTestData1(
    io_cursor IN OUT sp_getData.cursor_Data
)
AS
BEGIN
    INSERT INTO tmpDataGroup SELECT * FROM DATAGROUP;
              OPEN io_cursor FOR
    SELECT * FROM tmpDataGroup;
END sp_GetTestData1;

When I call sp_GetTestData1 from following strored procedure, it works fine. Records returns ( DataGroup table contains 12 rercords).

But when I call sp_GetTestData1 from visual basic 6, no records returns. I use follow Vb code.

Dim cmd As ADODB.Command
Dim conn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim SpName As String, CONNECTION_STRING As String
    Set cmd = New ADODB.Command
    SpName = "sp_getTestData1"
    CONNECTION_STRING = "File Name=" & App.Path & "\MyDataLink.UDL"
    Set rst = New ADODB.Recordset
    With cmd
        Set rst = New ADODB.Recordset
        .ActiveConnection = CONNECTION_STRING
        .CommandType = adCmdStoredProc
        .CommandText = SpName
        .Properties("PLSQLRSet") = True
       'rst.Open cmd, , adOpenForwardOnly, adLockReadOnly
       Set rst = .Execute()
    End With
    If Not rst.EOF Then
        recArray = rst.GetRows()
        reccount = UBound(recArray, 2) - LBound(recArray, 2) + 1
    End If
    MsgBox (reccount)
    Set rst = Nothing
    Set cmd = Nothing

I will be very pleased if any one can tell me what is the problem.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Temporary table in a shopping cart project ann03 ASP.NET 2.0 Professional 1 October 5th, 2007 07:50 PM
Return TYPE TABLE to VB from Oracle muttleychess Pro VB Databases 3 August 2nd, 2006 03:28 PM
How to create a Temporary Table fdtoo SQL Server 2000 0 April 11th, 2006 08:38 PM
Create Temporary Table jmss66 Classic ASP Databases 5 March 11th, 2004 01:00 PM



All times are GMT -4. The time now is 11:49 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.