Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle stored procedure

Status
Not open for further replies.

rjoshi2

Programmer
Sep 10, 2002
110
US
My question is how could I execute an oracle stored procedure in powerbuilder? My stored procedure requires two input variable. I am using oracle 8i and powerbuilder 6.5. Any help would be appreciated.

Thank You,
rjohsi2

My oracle procedure:

CREATE OR REPLACE PROCEDURE insert_photo
(p_rnumber NUMBER, p_rpicture VARCHAR2)
AS
f_photo BFILE;
b_photo BLOB;
Begin
-- Update the employee photo
UPDATE report_picture
SET rpicture = empty_blob()
WHERE rnumber = p_rnumber
RETURN rpicture into b_photo;
-- find where the photo's pointer is located.
f_photo := bfilename('PHOTO_FOLDER', p_rpicture);
-- open the photo as read-only option.
dbms_lob.fileopen(f_photo, dbms_lob.file_readonly);
-- load the photo into column photo.
dbms_lob.loadfromfile(b_photo,f_photo, dbms_lob.getlength(f_photo));
-- close the photo's pointer.
dbms_lob.fileclose(f_photo);
-- Save the loaded photo record.
COMMIT;
EXCEPTION
-- Check for your error messages
WHEN others THEN
dbms_output.put_line('*** ERROR *** Check you procedure.');
END;
 
This should do the trick :

Declare insert_photo Procedure For insert_photo ( :p_rnumber , :p_rpicture ) Using itr_transaction ;

Execute insert_photo ;


Hope this helps

Rincevent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top