Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!fciva!dag From: dag@fciva.FRANKLIN.COM (Daniel A. Graifer) Newsgroups: comp.databases Subject: Re: Comments in SQL scripts -- is there standard Summary: Preprocess the script Keywords: SQL UNIFY Message-ID: <527@fciva.FRANKLIN.COM> Date: 11 Jul 90 12:51:24 GMT References: <216@cti1.UUCP> Reply-To: dag@fciva.UUCP (Daniel A. Graifer) Organization: Franklin Mortgage Capital Corp, McLean, Va. Lines: 57 In article <216@cti1.UUCP> kmeek@cti1.UUCP (Kevin Meek) writes: >Is there anything in the SQL standards about how comments can >be inserted into an SQL script? [...] > >If there is no standard does anyone using UNIFY 2000 know if/how >you can insert comments into a Unify SQL script. >[...] >Kevin Meek >Comprehensive Technologies Int'l Inc. >2121 Crystal Drive Suite #103 >Arlington, VA 22202 >uunet!cit1!kmeek OR cti1!kmeek@uunet.uu.net I'm not sure about Unify 2000, but we are using Unify 4.0, which doesn't support comments in SQL. 1) Many systems which do support c-like comments also support #include, #if/#endif, etc. because they invoke the c-preprocessor. The AGEN compiler for Accell does this. You could certainly do this yourself, especially if: 2) You put your SQL queries in shell scripts as we do with most of ours. This allows passing parameters to SQL. Use the bourne shell << Input document facility: #shell script to produce monthly report if [ $# != 2 ] then echo "Usage: $0 mm yy" >&2 exit 1 fi MM=$1 YY=$2 if [ $MM != 12 ] then NM=`expr $MM + 1` NY=$YY else NM=1 NY=`expr $YY + 1` fi SQL<= $MM/01/$YY and datefield < $NM/01/$NY / EOF 3) If you wanted to insert comments in the SQL part, but didn't want to fool with cpp, (or you don't have the developer's toolkit which I believe is where cpp is delivered) you could just pipe something like the above throught grep -v '#'. Hope this helps Dan -- Daniel A. Graifer Franklin Mortgage Capital Corporation uunet!dag@fmccva.franklin.com 7900 Westpark Drive, Suite A130 (703)448-3300 McLean, VA 22102