RE: [PEAR-DEV] oci8 "modifyLimitQuery" strangeness
| From: | Graeme Merrall | Date: | Fri, 05 Apr 2002 09:50:13 +0000 |
| Subject: | RE: [PEAR-DEV] oci8 "modifyLimitQuery" strangeness | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-5196@lists.php.net to get a copy of this message | ||
> > > can someone please help me on that?
> > >
> > > the query i send to "modifyLimitQuery" is this:
> > >
> > > SELECT c.*,d.*,t.NAME as type
> > > FROM EVENT_DATE d,EVENT c,EVENT_TYPE t
> > > WHERE d.TIMESTAMP>1017917901
> > > AND d.EVENT_ID=c.ID
> > > AND t.ID=c.EVENTTYPE_ID
> > > ORDER BY d.TIMESTAMP
>
> is it possible that this makes the problem with oracle:
> c.*,d.*
> the asterisks, are those "illegal" with oracle
> is there some oracle specialist out there ?
>
Well I wouldn't say I'm an expert but I've used it plenty.
Sounds like you have duplicate column names in the EVENT_DATE and EVENT
tables. table.* is certainly perfectly acceptable although some argue that
it's use is not a good idea. For example, if you added a column of type LONG
to that table and filled it with lots of data, the above query would cause
Oracle (or any DB) to select the contents of that column whether it was used
or not.
A better method is to specify the actual columns you want to select from
those two tables. It's safer and you'll probably find the duplicate columns.
If you actually *do* need the two columns, try "SELECT a.id AS a_id, b.id
FROM a,b etc"
Cheers,
Graeme