Focal Point
[solved] Semi-colon

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5257020716

February 23, 2012, 11:12 AM
Venkat-
[solved] Semi-colon
Hello,

Does anyone know what is the purpose of having semi-colon at the end of WHERE/DEFINE statement?
Even the code works without having the semi colon.
Please let me know.

WHERE COUNTRY EQ 'USA' ;

This message has been edited. Last edited by: Venkat-,


product release:8203
o/s: windows 10
expected o/p formats: HTML,EXCEL,PDF
February 23, 2012, 11:17 AM
Prarie
They used to be required way back when...
Now they don't seem to matter. Not sure of the exact reason that changed.
February 23, 2012, 12:32 PM
N.Selph
There are random times when leaving out the semi-colon causes failure. Its best to leave it in.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
February 23, 2012, 12:33 PM
j.gross
In DEFINE, it's required between one definition and the next -- without it, the interpreter will think it's all one definition, usually resulting in an "undefined variable" message. The interpreter does not require it after the last definition -- end of definition is implied by the "END card", but I doubt that's documented.

BTW, same goes for ENDSTYLE -- if absent, it's implied by END.

In WHERE clauses of a TABLE request it's an optional part of the syntax (optional, whether de jure or de facto). If present, the interpreter know it's reached the end of the expression. If absent, the interpreter can generally deduce from the following word whether or not it's is a continuation -- but why leave it to chance. Even though the interpreter does not require it (and does a good job of inferring end or continuation of the expression when it reads the next word), supplying the closing s/c is a good habit.
February 23, 2012, 12:54 PM
Venkat-
Thanks all for the reply!


product release:8203
o/s: windows 10
expected o/p formats: HTML,EXCEL,PDF
February 23, 2012, 01:04 PM
<JG>
quote:
;
Is an optional semicolon that can be used to enhance the readability of the request. It does not affect the report


Is the official line.

However with compound statements and with Statements that include a function

i.e.
WHERE FIELD EQ EDIT(field,'999xx$')

It is generally advisable or required.
February 23, 2012, 01:13 PM
Danny-SRL
ALWAYS put the semi-colon.
It is in the manual.
And one day, someone will tighten the code and then... Red Face!


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

February 23, 2012, 03:41 PM
Waz
Always follow the manual, then if it breaks, you have a valid course of action.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 23, 2012, 05:01 PM
Venkat-
Thank you!


product release:8203
o/s: windows 10
expected o/p formats: HTML,EXCEL,PDF
February 23, 2012, 05:13 PM
Waz
If you with to flag this as closed, then please edit the first post in this thread, and add [CLOSED] to the title.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!