RE: [PHP-DB] OCIExecute error
| From: | Karl Gruel | Date: | Thu, 14 Sep 2000 19:41:49 +0000 |
| Subject: | RE: [PHP-DB] OCIExecute error | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2894@lists.php.net to get a copy of this message | ||
> > I'm trying to execute the following select in a PHP script:
> >
> > select a.col1, a.col2, b.col1 as col3 from table1 a, table2
> b where a.col1 =
> > 'VAL' and (b.col2 = 'CODE' and b.col3 = a.col3)
> >
> > This select works fine in sql (Oracle 8i) and passes the
> call to OCIParse,
> > but when I try to execute it with OCIExecute, I get the
> following error:
> >
> > Warning OCIStmtExecute: ORA-00904: invalid column name in
> lookup.php on line
> > 82
> >
> > The lookup was working fine as a single table lookup, but
> I'm trying to add
> > code translation to the lookup so I don't have to do
> multiple lookups in the
> > database.
>
> Well, I am curious about one thing. you have "b.col1 as col3" and
> "b.col3=a.col3". Now, is there a b.col3? The reason that I ask is the
> renaming of b.col1 as col3. Perhaps that is exactly correct,
> but it looks
> a little strange to me. If you don't actually have a "col3", should it
> really be "col1"? Same with the "a" table as well.
>
> Just a thought (doesn't seem likely you'd make such an error)
The columns exist.. I could copy the statement to sqlplus and it would
work. I don't know what I did, but it started working when I was mucking
with it this morning.
Thanks anyway..
--
Karl Gruel
kgruel@paradigm4.com