ORA-01036: illegal variable name/number pro*C trigger

From: hcacote <Hugo.Cacote_at_cern.ch>
Date: 21 Feb 2003 06:50:36 -0800
Message-ID: <6c97fc89.0302210650.1fa7514e_at_posting.google.com>


Hi all,

Im trying to create a simple trigger using pro*c (im running linux version 7.3 and oracle 8i). But unfortunately im getting the following error:

Oracle error--->>>>>>BUMMM
ORA-01036: illegal variable name/number

in "..."
on line 0 of .

The code related to the mistake:

/******************************************************************************/
VARCHAR dynstmt[100];
emp_number = 2;
new_salary = 300;

.......

strcpy(dynstmt.arr,

         "CREATE OR REPLACE TRIGGER LOG_SALARY_AGAIN AFTER UPDATE ON EMP_TAB FOR EACH ROW BEGIN INSERT INTO EMP_LOG (EMP_ID, NEW_SALARY, ACTION) VALUES (:v1,:v2,'OUT'); END;");
  dynstmt.len = strlen(dynstmt.arr);
  EXEC SQL PREPARE S FROM :dynstmt;
  EXEC SQL EXECUTE S USING :emp_number, :new_salary;

/******************************************************************************/

Can someone give a hint of what could be causing this trouble??? i presume that is related with the variable bindings (or placeholders)...but im getting no where.

Thanks,
Hugo Caçote Received on Fri Feb 21 2003 - 15:50:36 CET

Original text of this message