mallikarjun
mallikarjun

Reputation: 1862

Execution of oracle procedure multiple times in powerbuilder 12.0

I wrote a stored procedure in oracle to check weather given input file name exists in defined path. It is working fine. When i call this procedure in power-builder 12.0 i tested like this. First time i entered wrong file name it is works fine. Then i entered correct file name it is saying that Procedure has already been executed. How can i re-execute this procedure again. MY code to declare the procedure in package is

 DECLARE PROC_FILE_EXISTS PROCEDURE FOR 

HICSWIN_ORACLE.PACK_UPDATE_TSHML_HICSWIN20.PROC_CHECK_FILES_RELEVANCE  
(  
         FILE_NAME => :as_file_name  
)  ;


EXECUTE PROC_FILE_EXISTS;

IF SQLCA.SqlCode < 0 THEN
    MessageBox('eroor',SQLCA.SQLErrText)
    MessageBox('Connection failed','An error occured while connecting to database, please contact your administrartor')
    RETURN 0
end if

FYI i am using windows 7 with oracle 11g

Upvotes: 1

Views: 1734

Answers (2)

NoazDad
NoazDad

Reputation: 620

Call it from a datastore. Create a new dw with a stored procedure source, and the string retrieval argument. PB includes all the appropriate cursor syntax automatically. Calling Oracle SPs may be more complex - I believe you have to return a ref cursor to call one from a dw...

Upvotes: 1

Seki
Seki

Reputation: 11465

You need to close the procedure call (in a way similar to a cursor use : Declare / Open / Fetch / Close):

close PROC_FILE_EXISTS;

Upvotes: 4

Related Questions