Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / August 2003



Tip: Looking for answers? Try searching our database.

how to get recordset from oracle procedure by ADO but not use createparameter?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
progame - 30 Aug 2003 04:50 GMT
because i don't know type or size of parameter
so i can't use createpameter method of ado.command.

i must use paramterter.refresh to get these information.

problem:
if i want to return recordset from procedure of oracle,i must define a ref
cursor in package.

create or replace package pkg_Test is

TYPE curReturn IS REF
   CURSOR RETURN TEST%ROWTYPE;
    PROCEDURE pc_GetRecordset(v_Recordset OUT curReturn);
end pkg_Test;

when i write a procedure in package:

create or replace package body pkg_Test is
PROCEDURE pc_GetRecordset(v_Recordset OUT curReturn)
IS
BEGIN
 OPEN v_Recordset FOR
   SELECT * FROM test;

END;
end pkg_Test;

i call it in vb like this:
   cmd.commantext = "pkg_test.pc_getrecordset'

but this call can't use paramterter.refresh

i find this from microsoft:
When you use ADO with Oracle stored procedures that are contained within
Oracle packages, you must explicitly create parameters that the stored
procedure requires and append these parameters to the Parameters collection
of the ADO Command object. You cannot use the Refresh method to retrieve the
list of expected parameters.

so i hope to return recordset from procedure not in package:
create or replace procedure pc_GetRecordset(v_Out out pkg_Test.curReturn )
is
begin
 open v_Out for
      select * from test;
end pc_GetRecordset;

but when i call it in vb,i get error:
   error: 3708 You have improperly defined a Parameter object.

how can i do????

i hope to find a solution to get recordset from procedure but not use
createparameter!

hope to your answer. thx a lot.
Albert Reid - 30 Aug 2003 16:50 GMT
I use Oracle Packages in many of my projects.  Many of them return
recordsets.  My question to you is what sort of a SP are you trying to use
where you don't know the data type or size of the IN or OUT parameter?

> because i don't know type or size of parameter
> so i can't use createpameter method of ado.command.
[quoted text clipped - 53 lines]
>
> hope to your answer. thx a lot.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.