[comp.databases] Comments in Unify 4.0/5.0 SQL

dbrus.dxs@unify.uucp (Dale R. Shaver) (07/13/90)

In Unify 4.0 and 5.0, SQL does not support the ANSI standard of
commenting with `--'.  So, someone suggested doing `!# comment...'
However, in the best case this can be slow, because a shell call
has to be made; in the worst case, if the user is not allowed,
because of an OS constraint, to begin a new process, this will
cause an error which may not be easily detectable.  

My suggestion is to make use of the "lines" command.  In SQL, 
you may specify how many lines of records you wish to display
between each header.  In SQL for Unify 4.0, the syntax is:

	lines X       <-- where X is between 0 and 32767 
					  (24 is the default, 0 means to print no header)

Everything after X is ignored by the parser, so this makes for
an easy workaround for adding comments:

	sql> lines 0    This query selects everything
	sql> lines 0    from the 'foo' table
	sql> lines 24
	sql> select * from foo/

The only thing you need to remember is that if you use "lines" as a 
comment-maker, then you must reset it to give the actual number of
lines you wish.
Dale Shaver, Unify Technical Support           Phone: (916) 922-1177, x 733
dxs@unify.UUCP                                   Fax: (916) 920-5306
{{ucdavis,csun,lll-crg}!csusac,pyramid,sequent}!unify!dxs
"Please continue the petty bickering; I find it quite intriguing" 

poage@sunny.ucdavis.edu (Tom Poage) (07/14/90)

In article <he43zl8@Unify.Com> dbrus.dxs@unify.uucp (Dale R. Shaver) writes:
>In Unify 4.0 and 5.0, SQL does not support the ANSI standard of
>commenting with `--'.
...
>	sql> lines 0    This query selects everything
>	sql> lines 0    from the 'foo' table
>	sql> lines 24
>	sql> select * from foo/
...
>Dale Shaver, Unify Technical Support           Phone: (916) 922-1177, x 733
>dxs@unify.UUCP                                   Fax: (916) 920-5306
>{{ucdavis,csun,lll-crg}!csusac,pyramid,sequent}!unify!dxs
>"Please continue the petty bickering; I find it quite intriguing" 

As an alternative, at least in Unify 4.0, you can put anything
after an `end' statement:

	lines 0
	select * from table1 /
	end
	This obscure script selects ....

Tom.
-- 
Tom Poage, Clinical Engineering
Universiy of California, Davis, Medical Center, Sacramento, CA
poage@sunny.ucdavis.edu  {...,ucbvax,uunet}!ucdavis!sunny!poage