V4RB getting table name from cursor
Ruslan Zasukhin
sunshine at public.kherson.ua
Mon Dec 8 10:42:38 CST 2003
on 12/8/03 10:16 AM, Ivan Smahin at ismahin at ks.aval.ua wrote:
Thank you, Ivan.
> Hello Ruslan,
>
> 1. Field name has to be unique within single table.
> 2. It's possible to have two same-named fields from different
> tables.
> 3. You can refer (and in most cases it's single way to refer)
> to the field using such syntax
>
> select SCHEMA_NAME.OWNER_NAME.TABLE_NAME.FIELD_NAME ....
>
> you can omit some parts
> for example
>
> select * from master..sysusers
>
> (owner is omitted)
>
>
> Now
> for example
> sysusers and syslogins tables both have fields with name suid.
>
> try to execute
> select suid, suid from sysusers, master..syslogins
> result is Ambiguous column name suid
> select master..syslogins.suid, suid from sysusers, master..syslogins
> result is Ambiguous column name suid
> select master..syslogins.suid, master..syslogins.suid from sysusers,
> master..syslogins
> result is cursor which contain two fields with the same names suid
>
>
> Another example
> select 5
> result is cursor which contain one UNNAMED field
> select 5 as five
> result is cursor which contain one field named five
>
>
>
> Oracle behavior is a bit different
>
> select 5 from dual
> column is named 5
>
> Other aspects are the same
>
> for example SYS.USER$, SYS.USER_HISTORY$ both have field named
> USER#
>
> select USER# from SYS.USER$, SYS.USER_HISTORY$
> result is Ambiguous column name USER#
>
> select SYS.USER$.USER#, SYS.USER$.USER# from SYS.USER$, SYS.USER_HISTORY$
> result is cursor which contain two fields with the same names USER#
>
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list