Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

how to call oracle procedure??

posted by johnstontrav 9 years ago

Hi,

How do you call an oracle procedure?

http://www.orafaq.com/wiki/PHP_FAQ#How_does_one_call_stored_procedures_from_PHP.3F

I have tried the link suggestions but it did not work. My procedure works fine when called from cmd line like this:

exec load_file('aa','bb','test.pdf');

I have tried this in flourish:

$db->execute("begin load_file(%s,%s,%s); end;",array('aa','bb','test.pdf'));

Here is the error im getting:

#!text/html
Oracle error (ORA-06550: line 1, column 37:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

   := . ( % ;) in begin load_file('aa','bb','test.pdf')

It appears Oracle is acting particular about the usage of ;. fDatabase uses the semicolon as an indicator of the end of a query since most databases treat it as such. Thus, it is splitting your query into begin load_file('aa', 'bb', 'test.pdf') and end. You should be able to get your desired result by escaping the semicolon:

$db->execute("begin load_file(%s,%s,%s)\\\\; end", 'aa', 'bb', 'test.pdf');
posted by wbond 9 years ago

perfect thanks w.

posted by johnstontrav 9 years ago