|
-
Jul 24th, 2006, 04:26 PM
#1
Thread Starter
Fanatic Member
Resultset from Oracle
Hi
Somebody have a examples How can I to return Resultset from Oracle to Visual Basic.
I trying with Ref Cursor, but I need to do others call to others Tables and Return data to a Recordset of the VB
-
Jul 24th, 2006, 04:50 PM
#2
Re: Recordset from Oracle - Examples
Do you need to return records from stored procedure or simply by sending sql statement?
-
Jul 24th, 2006, 05:22 PM
#3
Re: Resultset from Oracle
Please do not dbl post. Thank you.
-
Jul 25th, 2006, 01:56 AM
#4
Re: Recordset from Oracle - Examples
Well if you rprocedure returns record then just execute it from VB and set the return value to a recordset.
Have I misunderstood what You are trying to say?
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 26th, 2006, 06:40 AM
#5
Thread Starter
Fanatic Member
Re: Recordset from Oracle - Examples
thanks
RhinoBull
I neeed return a Resultset for VB, for to open with recordset
Shuja Ali
Do You have a example ?
-
Jul 26th, 2006, 06:42 AM
#6
Thread Starter
Fanatic Member
Re: Resultset from Oracle
Sorry
I do not to knew where I to post
Sorry again
-
Jul 26th, 2006, 06:47 AM
#7
Re: Recordset from Oracle - Examples
A simple example would be using a Command Object of the ADO library and execute the procedure using that.
I guess a simple search on this forum will give you lot of examples.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 26th, 2006, 07:26 AM
#8
Re: Recordset from Oracle - Examples
Look in the Database section FAQ (this is the thread: http://www.vbforums.com/showthread.php?t=393457)). I have posed examples using VB6 and VB.Net for this.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jul 26th, 2006, 08:21 PM
#9
Thread Starter
Fanatic Member
Re: Recordset from Oracle - Examples
Thanks
But I need Passing Data from 2 or 3 Cursors, as below
cursor c1 (v1 in integer....) is
select a, b, c
from Table A, TAble B
WHERE ANYthing
cursor c2 (v2 in integer...etc) is
select x1,x2 , x3
from tableX, TableY
where ANYTHING
FOR R_C1 IN C1 (V1.....Vn) loop
FOR R_C2 IN C1 (V1.....Vn) loop
I NEED TO MOUNT A RESULT SET WITH some data from c1 cursor
and other data from c2 cursor
end loop
end loop
How can to build a Resultset like above ?
-
Jul 27th, 2006, 10:24 AM
#10
Re: Recordset from Oracle - Examples
Record sets can contain more the on result right. So create another input/output parameter for the SP and Return the results from the other cursors to the parameters,
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jul 27th, 2006, 11:33 AM
#11
Thread Starter
Fanatic Member
Re: Recordset from Oracle - Examples
Hi
I do not understand , because I have 2 Cursors nested, where the second use data from first, but I need return some data from 2 Cursors
Example
LOop cursor c1
loop cursor c2 with data from c1
end loop c2
end loop cursor c1
I want return a cursor C to VB with some data from c1 and some data from cursor c2
-
Jul 27th, 2006, 12:19 PM
#12
Re: Recordset from Oracle - Examples
As I said create two reference cursors. set the results of the SP cursors to the two refecursors and return the two ref cursors to the application in on record set. You can then use the record set to break up the results.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jul 28th, 2006, 03:08 AM
#13
Thread Starter
Fanatic Member
Re: Recordset from Oracle - Examples
I do not to do
-
Jul 28th, 2006, 05:25 AM
#14
Frenzied Member
Re: Resultset from Oracle
If u r referring to vb.net it is easy.
Just declare a procedure like this:
craete or replace procedure P_TEST(param1 in varchar2, recordset out cursor)
open recordset for
select * from whatever
end procedure P_TEST;
I wrote this by heart... but I hope you get a general idea.
What I did to make things easier was to encapsulate the cursor into a TYPE. I can show u the code when I get back to office...
/Henrik
-
Jul 28th, 2006, 07:50 AM
#15
Re: Recordset from Oracle - Examples
When you have the results back in VB then use the rs.nextresult command.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jul 28th, 2006, 09:53 AM
#16
Thread Starter
Fanatic Member
Re: Resultset from Oracle
tks
for a simple SELECT this work fine, but I have 2 or 3 Cursors for return in only recordset
-
Jul 28th, 2006, 09:57 AM
#17
Thread Starter
Fanatic Member
Re: Recordset from Oracle - Examples
tks
How can I read The first row from first recordset and first row from Second recordset
After
read The Second Row from first recordset and Second row from Second Recordset ?
-
Jul 28th, 2006, 10:08 AM
#18
Re: Resultset from Oracle
 Originally Posted by RhinoBull
Duplicate Threads merged.
-
Jul 28th, 2006, 11:00 AM
#19
Re: Resultset from Oracle
You must process each record set to completion then move to the next.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jul 29th, 2006, 06:31 AM
#20
Thread Starter
Fanatic Member
-
Jul 29th, 2006, 12:26 PM
#21
Re: Resultset from Oracle
Then I think we need to look at chaning the way data is gathered. Why draw the data you need from 2 cursors in Oracle and not just one? Or return the return the results from the first cursor and then call a second SP with data in the result set from the first SP (in a resultset).
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jul 30th, 2006, 07:15 AM
#22
Thread Starter
Fanatic Member
Re: Resultset from Oracle
-
Jul 30th, 2006, 10:16 AM
#23
Re: Resultset from Oracle
Since I don't know what you're tying to accomplish no. Why not write two SPs. The first one returns the result set bound in our first cursor of the original SP. Now once back into the app call a second SP that has the reults based on the results of the first, and return that set.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Jul 30th, 2006, 10:56 AM
#24
Thread Starter
Fanatic Member
Re: Resultset from Oracle
-
Aug 1st, 2006, 12:16 PM
#25
Thread Starter
Fanatic Member
Re: Resultset from Oracle
-
Aug 1st, 2006, 01:04 PM
#26
Re: Resultset from Oracle
What did you not have success at?
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Aug 2nd, 2006, 05:31 AM
#27
Thread Starter
Fanatic Member
Re: Resultset from Oracle
to do a procedure that return in only cursor, with call for other procedure with other 2 cursors
I need to build a procedure with only cursor, because I to return to VB or Crystal reports
-
May 9th, 2008, 11:54 AM
#28
New Member
Re: Resultset from Oracle
Hello,
I'm not sure I've understood exactly what mutley was trying to do, but I'm also trying to get, in my VB project, 2 or more REF CURSORS from a packaged procedure in Oracle, and it gives me the following error:
Error Type:
ADODB.Recordset (0x800A0CB3)
Current provider does not support returning multiple recordsets from a single execution.
Here's a bit of the code:
----------------
SQL = "{? = call PK.procXPTO({resultset 0, refCursor1},{resultset 0, refCursor2},?)}
(...)
.CommandType = adCmdText
.NamedParameters = True
Set objParam = .CreateParameter("result", 131, 2)
.Parameters.Append objParam
Set objParam = .CreateParameter("paramIN", 131, 1, 255, paramIn)
.Parameters.Append objParam
(...)
---------------
I'm using MSDAORA as Provider, Oracle 9.2 and VB6.
Any help is utterly appreciated.
Many thanks,
E. V.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|