Re: 4GL coding
Posted in 1998
In article <6a36vg$pc4$1@mendelevium.btinternet.com>, Graeme Norton
<Graeme.Norton@btinternet.com> writes
>I sometimes use the syntax
>
>select @tablename.colname from tablename
>where @tablename col2 ....
>
Why not just use
select tablename.colname from tablename
where tablename.col2...
i.e. remove the @ 's, they are redundant.
They are only need when selecting from a column which is the same
name as a variable E.g.
select @col1
into col1
from mytable
where @col1 = col2.
>I prefer to prefix columns by their table name for ease of use when
>debugging - easier for someone else. However, a colleague has said to me
>that using the @ sign is slower for executing the SQL as it has to keep
>referring to the database. Is this true, my crude tests have been
>inconclusive.
>
Not sure, but doing
select mycolumn
from mydb@myserver:mytable
is slower because Informix will connect via the network even if
the database is actually on the local server.
>Also is it better to alias a table in a query and prefix columns with the
>alias rather than the proper name or is it just used by lazy people who cant
>be bothered to type the full name.
>
>Graeme Norton
>
>
--
David Williams
Maintainer of the Informix FAQ
Primary site (Beta Version) http://www.smooth1.demon.co.uk
Official site http://www.iiug.org/techinfo/faq/faq_top.html
I see you standin', Standin' on your own, It's such a lonely place for you, For
you to be If you need a shoulder, Or if you need a friend, I'll be here
standing, Until the bitter end...
So don't chastise me Or think I, I mean you harm...
All I ever wanted Was for you To know that I care