Home » Developer & Programmer » Precompilers, OCI & OCCI » illegal variable name/number
illegal variable name/number [message #254633] Fri, 27 July 2007 05:44 Go to next message
stockton
Messages: 10
Registered: July 2005
Location: South Africa
Junior Member
I am calling a stored procedure from my php program and get the following error/warning:-
Warning: ocibindbyname() [function.ocibindbyname]: OCIBindByName: ORA-01036: illegal variable name/number in C:\Program Files\Apache Group\Apache2\htdocs\Events\OracleGetClientTest.php on line 111

Warning: ocibindbyname() [function.ocibindbyname]: OCIBindByName: ORA-01036: illegal variable name/number in C:\Program Files\Apache Group\Apache2\htdocs\Events\OracleGetClientTest.php on line 112

My code looks like:-
$StartDate="2006/01/01 06:00:00";
$EndDate="2007/07/26 17:00:00";
$SQL = "begin spPackage.spTablesPlayed(:p_number, :p_recordset); end;";



$stmt = OCIParse($conn, $SQL );

$curs = OCINewCursor($conn);

if (!$stmt)

{

trigger_error(sprintf("spTablesPLayed Cannot parse query for [%s] ", $number), E_USER_ERROR);

die();

}

OCIBindByName($stmt,":p_number",&$number,15);
OCIBindByName($stmt,":p_startdate",&$StartDate, 20); <-------- line 111

OCIBindByName($stmt,":p_enddate",&$EndDate, 20); <-------- line 112

OCIBindByName($stmt,":p_recordset",&$curs,10,OCI_B_CURSOR);

and the relevant piece of the stored procedure look like:-

PROCEDURE spTablesPlayed(
p_number cards.card_number%type, --varchar2
p_startdate varchar2,
p_enddate varchar2,
cv_tablesplayed out tablesplayed_cur_type);

Please tell me what I am misunderstanding.
Re: illegal variable name/number [message #254643 is a reply to message #254633] Fri, 27 July 2007 06:14 Go to previous message
Frank
Messages: 7901
Registered: March 2000
Senior Member
There is no :p_startdate in your prepared call

Change
$SQL = "begin spPackage.spTablesPlayed(:p_number, :p_recordset); end;";

to
$SQL = "begin spPackage.spTablesPlayed(:p_number, :p_startdate, :p_enddate, :p_recordset); end;";

[Updated on: Fri, 27 July 2007 06:15]

Report message to a moderator

Previous Topic: Select into
Next Topic: Re: want to download Pro*c/C++ compiler free download site
Goto Forum:
  


Current Time: Thu Mar 28 08:23:51 CDT 2024