Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Sponsored Links



Passing parameter of Oracle procedure in PHP

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 22-04-2009
Halina's Avatar
Member
 
Join Date: May 2008
Posts: 982
Passing parameter of Oracle procedure in PHP

I would enjoy if you have information regarding the parameters of a stored procedure in oracle.

Indeed, I run the procedure as follows with the desired result (in a writing table ..)

Code:
Declare   
  - p_trayno NUMBER; 
  p_frame_1 VARCHAR2 (255); 
  p_frame_2 VARCHAR2 (255); 
  p_frame_3 VARCHAR2 (255); 
  p_frame_4 VARCHAR2 (255); 
  p_frame_exp1 VARCHAR2 (255); 
  p_frame_exp2 VARCHAR2 (255); 
  p_frame_exp3 VARCHAR2 (255); 
  p_frame_exp4 VARCHAR2 (255); 
  p_msg VARCHAR2 (255); 

  P_tray NUMBER: = 35764; 
  begin 

  PDL.Pr_send ( 
                           p_tray, 
                            p_frame_1, 
                            p_frame_2, 
                            p_frame_3, 
                            p_frame_4, 
                            p_frame_exp1, 
                            p_frame_exp2, 
                            p_frame_exp3, 
                            p_frame_exp4, 
                            p_msg); 
                            end; 
                            / 
   commit;
In fact with the exception of p_tray which is an IN parameter while the others are output parameter OUT ..

My problem actually occurs when I call the procedure in PHP:
Here is the end of the code concerned.

PHP Code:
req_write 
  

  Begin PDL.pr_send (: tray_no,: p_frame_1,: p_frame_2,: p_frame_3, 
  : p_frame_4,: p_frame_exp1,: p_frame_exp2, 
  : p_frame_exp3,: p_frame_exp4); end; commit "


  $ 
stmt_write OCIParse ($ conn, $ req_write); 
  
oci_bind_by_name ($ stmt_write ": tray_no", $ tray_no8), // in parameter 
  
oci_execute ($ stmt_write); 
Here is the error message I get:

Quote:
Warning: oci_execute () [function.oci-execute]: ORA-06550: line 1, column 1: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare exit for function goto if loop mod null procedure package pragma raise return select update while separate type with <identifier> <identifier between quotes> <variable bind> <<form table define call close current delete fetch lock insert open rollback SAVEPOINT set sql execute commit forall merge pipe The library OPERATOR_ symbol " "was ignored. ORA-0655
In fact I need to spend the first parameter of the procedure (but do I refer others OUT ?).
Reply With Quote
  #2  
Old 22-04-2009
XSI's Avatar
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 248
Re: Passing parameter of Oracle procedure in PHP

Try replacing

PHP Code:
req_write 
  

  Begin PDL.pr_send (: tray_no,: p_frame_1,: p_frame_2,: p_frame_3, 
  : p_frame_4,: p_frame_exp1,: p_frame_exp2, 
  : p_frame_exp3,: p_frame_exp4); end; commit "

by

PHP Code:
req_write 
  

  exec PDL.pr_send (: tray_no,: p_frame_1,: p_frame_2,: p_frame_3, 
  : p_frame_4,: p_frame_exp1,: p_frame_exp2, 
  : p_frame_exp3,: p_frame_exp4); commit "

Reply With Quote
  #3  
Old 22-04-2009
Halina's Avatar
Member
 
Join Date: May 2008
Posts: 982
Re: Passing parameter of Oracle procedure in PHP

When I replace the old query:

PHP Code:
req_write 
  

  exec PDL.pr_send (: tray_no,: p_frame_1,: p_frame_2,: p_frame_3, 
  : p_frame_4,: p_frame_exp1,: p_frame_exp2, 
  : p_frame_exp3,: p_frame_exp4); commit "

I don't have an error of execution, against by performing a search in the tables, I realize that had no concerned. I try also without 'exec' but same result.

you have an idea please?
Reply With Quote
  #4  
Old 22-04-2009
XSI's Avatar
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 248
Re: Passing parameter of Oracle procedure in PHP

It is a syntax error. When you write "Begin PDL.pr_send (: tray_no,: p_frame_1 ...", the line is not interpreted, it considers that it is a single command.

Try not commit, just

PHP Code:
req_write 
  

execute PDL.pr_send (: tray_no,: p_frame_1,: p_frame_2,: p_frame_3, 
  : p_frame_4,: p_frame_exp1,: p_frame_exp2, 
  : p_frame_exp3,: p_frame_exp4); " 
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Passing parameter of Oracle procedure in PHP"
Thread Thread Starter Forum Replies Last Post
Passing object as a parameter in a method Karumbu Software Development 4 06-01-2011 01:07 AM
Passing an ArrayList From the Form as Parameter Sheenas Software Development 8 20-06-2010 11:45 AM
Problem While Passing Parameter To Servlet In JSP Jagdish Gada Software Development 5 29-01-2010 02:33 PM
Passing function parameter and static Banjiji Software Development 3 27-10-2009 08:32 PM
Parameter passing using NavigateURL Sachit Software Development 3 26-03-2009 10:25 AM


All times are GMT +5.5. The time now is 11:26 AM.