Packages returning ResultSet..NOT WORKING

babu

Member
Hi,

I am using Oracle 9i with Delphi 6.0

here is the package code
------------------------
Create or replace package Contact_Actions AS
Type t_ContactCursor is ref cursor return contact%rowtype;
Procedure GetAllContacts ( p_ContactCursor in out t_Contactcursor );
End Contact_Actions;

Create or replace package body Contact_Actions AS
Procedure Getallcontacts ( p_ContactCursor in out t_Contactcursor ) is
begin
open p_ContactCursor for Select * from Contact;
end GetallContacts;
End Contact_Actions;

here is my delphi code
----------------------
with OracleQuery1 do
begin
clear;
sql.add ('begin' );
sql.Add (' contact_actions.Getallcontacts (
tongue.gif
_ContactCursor )');
sql.Add ('end;');

DeclareVariable ( 'p_ContactCursor', otCursor);
SetcomplexVariable ('p_ContactCursor', CursorQuery );
Execute;
end;

With CursorQuery do
begin
Execute;
While not Eof do
begin
memo1.Lines.Add( Field('lastname') );
Next;
end;
end;
end;

it is not passing the first execute statement..i am just following the example from the direct oracle access 3.4 could you please help me to find what is the error i am doing here

thanks - BM
 
There seems to be missing a semi-colon after the call (before the "end;"):

sql.add ('begin' );
sql.Add (' contact_actions.Getallcontacts ( :p_ContactCursor );');
sql.Add ('end;');

------------------
Marco Kalter
Allround Automations
 
Back
Top