Re: OCIExecute error

From: Date: Thu, 14 Sep 2000 19:36:05 +0000
Subject: Re: OCIExecute error
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-2892@lists.php.net to get a copy of this message
On Wed, 13 Sep 2000, Karl Gruel wrote: > > 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) John

« previous php.db (#2892) next »