
Informix 4GL Construct Statement and ANSI Databases
->Subject: Informix 4GL Construct Statement and ANSI Databases
->Date: 2 Nov 1993 14:10:49 GMT
->Organization: Intergraph Corporation, Huntsville, AL
->
->ANSI Databases require the table owner's name to be attached to the
->table references in sql statements, as in
->
-> SELECT * from "joe".data WHERE id > 100
->
->The use of these table names works fine evereywhere within I4GL
->(I'm running version 4.1) except in the CONSTRUCT statement. When
->a query by example form is filled in and the Accept key pressed,
->CONSTRUCT returns a WHERE clause for a select statement, and includes
->the tablename with the data element, as in
->
-> "WHERE data.id > 100"
->
->When appended to the select statement and executed, an error occurs.
->Only if I append the owner name to this table name, so that the resulting
->query becomes :
->
-> SELECT * from "joe".data WHERE "joe".data.id > 100
->
->Does the query work. I have had to write a subroutine to parse the "Where"
->clause and add owner names to table names, but this is very non-portable.
->Is there any other way around this problem?
->Inquiring minds want to know!
->--
->----------------------------------------------------------------
->Joe Ryburn | CIM Manager | Intergraph Corporation
->Ext 5639 | Manufacturing Integration | Huntsville, AL 35894
->----------------------------------------------------------------
One approach involves using synonyms:
CREATE SYNONYM data FOR "joe".data
Then reference the file as just 'data'. If the program is only for your use
(how likely is that?), then this should work. If it is for general use, this
might not work for you, because there are Informix version specific limitations
on synonyms: public in some versions, private in others. Jonathan Leffler
Regards,
Alan ___________________________
______________________| R. Alan Popiel |__________________________
\ Internet: | Martin Marietta, Tech Ops | /
)Voice: | Denver, CO 80201-0179 USA | (
/ 303-977-9998 |___________________________| (But you knew that!) \
/________________________) (____________________________\