Jump to content

[SOLVED] illegal variable name/number


Recommended Posts

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.