Page 1 of 1

procedure param to var

Posted: Mon 28 Mar 2005 11:17
by maksi_m
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..

Posted: Mon 28 Mar 2005 12:47
by Alex
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.