Home » Open Source » Programming Interfaces » Oracle procedure+php
Oracle procedure+php [message #148820] Mon, 28 November 2005 06:50 Go to next message
galaxy
Messages: 62
Registered: October 2005
Member
Hi,

I have a problem with an oracle procedure and php.
The procedure was created successful without warnings or errors.
It only puts an insert in a table with the vars you gave to the procedure.

But when I tried to call the procedure from php, the following error occur:

ORA-06550: line 1, column 89:PLS-00103: Encountered the symbol "\"
when expecting one of the following: ( - + case mod new not null
others avg count current exists max min prior sql stddev sum variance
execute
forall merge time timestamp interval date pipeThe symbol \"\"
was ignored.ORA-06550: line 2, column 117:PLS-00103: E

I have bind all vars with ocibindbyname. But i can't find an error. And I dont understand what this error is about.

Could somebody help me?
Re: Oracle procedure+php [message #148848 is a reply to message #148820] Mon, 28 November 2005 12:01 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
It would help if you post the procedure code.
Re: Oracle procedure+php [message #148922 is a reply to message #148820] Tue, 29 November 2005 01:26 Go to previous message
galaxy
Messages: 62
Registered: October 2005
Member
This is what I have done.

In Oracle9i:

create or replace package test_insertData as
procedure new_test(
x1 in VARCHAR2,
x2 in VARCHAR2,
x3 in VARCHAR2,
x4 in VARCHAR2,
x5 in NUMBER,
x6 in VARCHAR2,
x7 in VARCHAR2);
end test_insertData;
/
create or replace package body test_insertData as
procedure new_test(
x1 in VARCHAR2,
x2 in VARCHAR2,
x3 in VARCHAR2,
x4 in VARCHAR2,
x5 in NUMBER,
x6 in VARCHAR2,
x7 in VARCHAR2)
is
v_ex exception;
begin
insert into testtable
(x1,x2,x3,x4,x5,x6,x7)
values
(x1,x2,x3,x4,x5,x6,x7);
exception
when v_ex then
raise_application_error(-20001,'Es konnte kein Satz angelegt werden!');
when others then
raise_application_error(-20003, 'Unbekannter Fehler!' || SQLERRM);
end new_test;
end test_insertData;
/
This was created successfull.

This in PHP:

$insert = "begin test_insertData.new_test(:bind1,...,bind7) end;";

ocibindbyname($sql_fund_update,":bind1",$upd_1,32);
....
ocibindbyname($sql_fund_update,":bind7",$upd_7,32);

$upd_1 bis $upd_7 are vars that exists in php.

$result = @ociexecute($insert,OCI_DEFAULT);

and then the error which is in my first article appears.

Can somebody help me?


Previous Topic: OCI8 PHP BIG PROBLEM
Next Topic: Creating oracle tables through PHP/HTML
Goto Forum:
  


Current Time: Fri Mar 29 09:06:23 CDT 2024