procedure param to var

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
maksi_m

procedure param to var

Post by maksi_m » Mon 28 Mar 2005 11:17

hello from Russian!
I'm using ODAC for delphi6 component.
I have stored procedure as:

Code: Select all

create or replace procedure PR_NEW_KONTRAGENT(NEW_INN IN varchar2, 
RESULTAT_ OUT number ) is
       CURSOR CONTROL_KONTRAGENT IS
       SELECT * FROM KONTRAGENT WHERE K_INN = NEW_INN; 
begin
       OPEN CONTROL_KONTRAGENT; 
       IF CONTROL_KONTRAGENT%NOTFOUND THEN
          RESULTAT_ := 0;
       ELSE
          RESULTAT_ := 1;
       END IF;
       CLOSE CONTROL_KONTRAGENT;
  
end PR_NEW_KONTRAGENT;
and have to get out parameter (RESULTAT_) in simple integer variable.. but. When I try to set option Active=True in OraStoredProc i have an error message ("Ora statement does not returns rows") !
I don't understanding what wrong - when procedure returns CURSOR - all works fine !
Can you give an example code for my problem ?!
I'm out of my head whith it !
ps: sorry for not good english..

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Mon 28 Mar 2005 12:47

You should call TOraStoredProc.ExecProc method in your case.
Call TOraStoredProc.Open or set TOraStoredProc.Active to True only if the result of TOraStoredProc has the type of cursor in that case this stored procedure represents DataSet object.

Post Reply