Re: Getting the database name of a given table?
Posted in 2010
Am I missing something ?
Isn't it just :
SELECT "db1" dbname, some_cols FROM DB1:atable UNION
SELECT "db2", some_cols FROM DB2:atable UNION
SELECT "db3", some_cols FROM DB3:atable
On Friday 19 March 2010 11:40:05 David N. Heydon wrote:
> Hi All.
>
> If I have a piece of SQL like:-
>
> SELECT some_cols FROM DB1:atable UNION
> SELECT some_cols FROM DB2:atable UNION
> SELECT some_cols FROM DB3:atable>
> How can I also return as a column the database the row matches so I can
> differentiate between DB1, DB2 and DB3 in the above example?
>
> I've tried a few things but no success so far. Any inspiration appreciated!
>
> TIA.
>
> David
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
--
Mike Aubury
http://www.aubit.com/
Aubit Computing Ltd is registered in England and Wales, Number: 3112827
Registered Address : Clayton House,59 Piccadilly,Manchester,M1 2AQ