|
Archives of the TeradataForumMessage Posted: Tue, 02 May 2006 @ 16:55:34 GMT
SQL Assistant has a *primitive* parser in it for reasons I've never been quite able to fathom, but Mike Dempsey says are essential for operation. The parser has been the source of numerous complaints over the years, with lost comments and lost newlines being the most frequent glitches. My personal favorite is below. /dave hough ----- Let's assume you are generating some maintenance scripts by using SQL to extract key information from the dictionary, and let's further assume that you want to generate a comment line or three at the logical breaks in the script generation: select '/* ' || trim(databasename) || ' */' as A_Label from dbc.databases where databasename = user; If you run this in BTEQ you'll get what you'd expect: /* YourUser */ If you run this from SQL Assistant with double feet: /* YourUser */ If you run this from SQL Assistant with single feet: (blank) The reason is that the parser has ignored the quotes and stripped everything between /* and */ and thrown it away, including the executable code. You can fix it by splitting the comment tokens like this: select '/' || '* ' || trim(databasename) || ' *' || '/' as A_Label from dbc.databases where databasename = user; But if you're creating a lot of comments this is really, really painful.
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||