Hi'

I am trying to construct an DBI SQL statement like:

$my_stmt = $my_dbcon->prepare("CREATE TABLE BLABLABLA AS (SELECT * FROM ANOTHER_TABLE 
WHERE ID = ?)");
   :
  <Calculate $ID>
   :
$my_stmt->execute($ID);

When i do this i get the following DBD error:

DBD::Oracle::st execute failed: ORA-01036: illegal variable name/number (DBD ERR
OR: OCIBindByName) at .....

If i calculate $ID in advance and then perform the following:

$my_stmt = $my_dbcon->prepare("CREATE TABLE BLABLABLA AS (SELECT * FROM ANOTHER_TABLE 
WHERE ID = '$ID')");
$my_stmt->execute;

it works just fine!

Is placeholders not allowed in DDL statements or what?

--------

Im using:       PERL 5.6, DBI vers. 1.14, DBD::Oracle driver vers. 1.06
on:             SUN Solaris 5.6, Oracle RDBMS 8.1.7/8.1.6

---------

-- Lars S. Eskildsen (M.Sc.) - Software Developer
-- Stibo Directory Solutions - ADVICE
-- e-mail: MAILTO:[EMAIL PROTECTED]   
-- www   : http://www.stibo-ds.com

-- Address     : Soeren Nymarksvej 21
-- Postal Code : DK-8270 Hoejbjerg
-- Country     : Denmark
     
-- Phone (Main)   : (+45) 87 33 44 55
--  ""   (Direct) : (+45) 87 33 44 21
-- Fax            : (+45) 87 33 44 99

Reply via email to