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;
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;