On Tue, 22 Oct 2002 20:37:34 -0400 Steve Sapovits <[EMAIL PROTECTED]> wrote:
> Looks like an Oracle error, which is what I'd expect. I'm just
> wondering if Oracle is supposed to support this or not ...
>
> Here's the trace output (sorry for any wrapping):
.. . .
> DBI::st=HASH(0x26b988))
> -> DESTROY for DBD::Oracle::st (DBI::st=HASH(0x26b988)~INNER)
> <- DESTROY= undef at cbindt line 13
> dbih_clearcom 0x33b2c0 (com 0x372e08, type 3) done.
>
> -> prepare for DBD::Oracle::db (DBI::db=HASH(0x335a78)~0x26b9ac
> 'CREATE TABLE foo2 AS SELECT * FROM foo WHERE col_2 = ?')
> New DBI::st (for DBD::Oracle::st, parent=DBI::db=HASH(0x26b9ac), id=)
> dbih_setup_handle(DBI::st=HASH(0x26ba60)=>DBI::st=HASH(0x277a00),
> DBD::Oracle::st, 33b398, Null!)
> dbih_make_com(DBI::db=HASH(0x26b9ac), DBD::Oracle::st, 208) thr#0
> dbd_preparse scanned 1 distinct placeholders
> dbd_st_prepare'd sql CREATE
> dbd_describe skipped for CREATE
> <- prepare= DBI::st=HASH(0x26ba60) at cbindt line 13
> -> execute for DBD::Oracle::st (DBI::st=HASH(0x26ba60)~0x277a00 1)
> bind :p1 <== 1 (type 0)
> bind :p1 <== 1 (size 1/2/0, ptype 5, otype 1)
> bind :p1 <== '1' (size 1/1, otype 1, indp 0, at_exec 1)
> OCIErrorGet after OCIBindByName (er1:ok): -1, 1036: ORA-01036:
> illegal variable name/number
>
> !! ERROR: 1036 'ORA-01036: illegal variable name/number (DBD ERROR:
> OCIBindByName)'
> <- execute= undef at cbindt line 16
> DBD::Oracle::st execute failed: ORA-01036: illegal variable name/number
> (DBD ERROR: OCIBindByName) at cbindt line 16.
> DBD::Oracle::st execute failed: ORA-01036: illegal variable name/number
> (DBD ERROR: OCIBindByName) at cbindt line 16.
.. . .
> >>This does it if I substitute the 'XXX' values with our access params.
> >>
> >>#!/usr/local/bin/perl
> >>
> >>use strict;
> >>use DBI;
> >>
> >>my $dbh = DBI->connect('DBI:Oracle:XXX', 'XXX', 'XXX', {RaiseError =>
> >>1});
> >>
> >>$dbh->do("CREATE TABLE foo (col_1 VARCHAR2(10), col_2 NUMBER)");
> >>$dbh->do("INSERT INTO foo VALUES ('foo', 1)");
> >>
> >>my $sth =
> >> $dbh->prepare("CREATE TABLE foo2 AS SELECT * FROM foo WHERE col_2 =
> >>?");
> >>
> >>$sth->execute(1);
When you talk to Oracle, just tell them it's an OCI application. You
should be able to get the parsed statement text from one of the database
views. I would expect the '?' to be converted to ':p1', but it would be
worth seeing if it's something different.
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.