PHP is passed to the Oracle stored procedure, how to handle

Source: Internet
Author: User
PHP passes value to Oracle stored procedure
My client wrote a stored procedure on the Oracle server and he told me the stored procedure name (PRO), database name, tnsname, access password, data table name, and 5 field names.

Now I'm going to call this Oracle stored procedure remotely on my PHP program, which is simple enough to pass 5 PHP variable values to 5 fields in the stored procedure (PRO), namely S_a, S_b, S_c, S_d, S_e

In addition, the stored procedure (PRO) Returns a result value after receiving the above 5 values, the field name is S_f

How to write the specific code?

I pay all my points to the master who can solve my problem!!

------Solution--------------------
PHP code
 $user = "Scott";            Database user name $password = "Tiger";          Password $conn_str = "Tnsname"; Connection string (cstr:connection_string) $remote = TRUE//Whether remote connect if ($remote) {$conn = Ocilogon ($user, $password, $conn _str);} else {$conn = Ocilogon ($user, $password);} $a = ' s_a '; $b = ' s_b '; $c = ' S_c '; $d = ' s_d '; $e = ' s_e '; $sql _sp = "BEGIN proc_test (: A,: B,:c,:d,: E); END; ";          /parse$stmt = Ociparse ($conn, $sql _sp);//Execute Binding ocibindbyname ($stmt, ": A", $a, 30); Ocibindbyname ($stmt, ": B", $b, +), Ocibindbyname ($stmt, ": C", $c, +) Ocibindbyname ($stmt, ":d", $d, +); Ocibindbyname ( $STMT, ": E", $e, +); Ociexecute ($stmt); 
Code Geek recommended Solution: Oracle stored procedure, http://www.daimami.com/oracle-develop/177537.html
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.