RE: 4GL Query problem !
Posted in 1999
Interesting point of view.
Sadly there are alot of us dumb code cutters out there.
I agree with the comment about everything being parameters, but,
surely you are not saying that your naming convention is better than mine or
Tony Flaherty's
The particular problem was concerned with ambiguity between table column
names and variable names.
If some people do not like putting an @ in front of a column name then more
power to them.
I agree with Tony on that point. If I wanted my code to look like email
addresses then I start coding in html
I personally would hate to debug code where the global and modular variable
had the same naming convention as locals.
At the end of the day, any mechanism for making code easier to read is a
good thing whether it is yours, Tony's or mine.
> -----Original Message-----
> From: Robert Taylor [SMTP:robertt@scotlegal.com]
> Sent: Thursday, July 22, 1999 2:43 PM
> To: informix-list@iiug.org
> Subject: Re: 4GL Query problem !
>
> You might think its good but personally I find it just a bit dumb. If you
> can't read it then its probably over complicated. Also , I think global /
> modular variables are a no no unless there is no other way , everything
> should be parameters. Arrays are the obvious exception.
>
> Tony Flaherty <aef@mfs.misys.co.uk> wrote in message
> news:932635496.21678.0.nnrp-01.c1ed1f69@news.demon.co.uk...
> > A good naming convention within 4GL is to prefix everything with a
> letter
> > indicating the scope of the variable, e.g. l_myvar for local, m_myvar
> for
> > modular etc. It makes the code easier to read and as an after effect
> > prevents you ever having to consider this type of ambiguity in SQL
> > statements, well at least so long as you don't name your columns
> l_colname
> > ;o).
> >
> >
> > --
> > ---------------------------------------
> > Tony Flaherty aef@mfs.misys.co.uk
> > Analyst Programmer
> > Misys Financial Systems
> > All statements and opinions are my own,
> > Misys don't pay me enough to have opinions
> > on their behalf
> >
> > .
> > Art S. Kagel wrote in message <3795FCA9.E7D2CE90@bloomberg.net>...
> > >Ramdas Gopinath wrote:
> > >>
> > >> Hi Nayan,
> > >> Just check to see whether you have a variable defined with the same
> name.
> > It
> > >> is always better to prefix a column name with the table name or the
> @.
> > >
> > >Correct. Just a note, using the tablename will not save you from the
> > >confusion that the @ is there to resolve if, as is common practice,
> > >you have structures with the same names as the table declared 'LIKE
> > ><tablename>' so it is alwasy good practive in 4GL to prefix column
> > >names in where clauses with the at sign (@) or to religiously avoid
> > >naming program objects after the database objects they map.
> > >
> > >Art S. Kagel
> > >
> > >> Gopi
> > >>
> > >> NayAn JaiN <nayan.jain@tatainfotech.com> wrote in message
> > >> news:7n3l0u$7e7$1@news.xmission.com...
> > >> >
> > >> > Hi all,
> > >> >
> > >> > I have a silly question, but wasnt able to figure out what is
> happening
> > >> > and how is it happening.
> > >> >
> > >> > Here is a query statement that is written in a 4gl program.
> > >> >
> > >> > SELECT insp_periodicity
> > >> > INTO g_insp_periodicity
> > >> > FROM smm_insp_period
> > >> > WHERE @insp_autho = gr_smrpm01.sti_iii_cd> > >> >
> > >> > Please notice there is a "@" sign before field "insp_autho"
> > >> >
> > >> > now if this "@" sign is there then this query gives status = 0
> > >> > and if i remove this then it gives status = 100.
> > >> >
> > >> > What does this "@" sign means and how does this affect the query.
> > >> >
> > >> > BTW, I wrote a dummy program with the same query. There it works in
> > both
> > >> > the cases...means...with or without "@" sign, i get status = 0.
> > >> >
> > >> > But when i run the same query in dbaccess, i get a syntax error at
> "@"
> > >> > sign.
> > >> >
> > >> > Cant figure out.
> > >> >
> > >> > TIA,
> > >> >
> > >> > With Regards
> > >> > Nayan Jain !
> > >> >
> > >> >
> > >> >
> > >> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> -
> > >> > Ye Lamhe, Ye pal ham baraso yaad karenge ...
> > >> >
> >
>