How to use PHP to call the Oracle stored procedure _ PHP Tutorial

Source: Internet
Author: User
Use PHP to call the Oracle stored procedure. However, using stored procedures has at least two obvious advantages: speed and efficiency. It is faster to use stored procedures. In terms of efficiency, if an application requires a series of SQL operations at a time, but using stored procedures has at least two obvious advantages: speed and efficiency. It is faster to use stored procedures. In terms of efficiency, if the application needs to perform a series of SQL operations at a time, it needs to migrate to and from php and oracle. it is better to put the application directly to the database side to reduce the number of round trips and increase efficiency. However, in internet applications, speed is extremely important, so it is necessary to use stored procedures. I used php to call the stored procedure and made the following column.

The code is as follows:

// Create a test table create table test (id number (16) not null, name varchar2 (30) not null, primary key (id )); // insert an insert into test values (5, 'php _ book'); // create or replace procedure proc_test (p_id in out number, p_name out varchar2) as begin select name into p_name from test where id = 5; end proc_test;


Php code

The code is as follows:

 

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.