Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My query works with no problems, bu

Status
Not open for further replies.

TheVMan

IS-IT--Management
Feb 19, 2001
110
US
My query works with no problems, but when coldfusion process it I get the following error:

Just in time compilation error

Invalid token found on line 41 at position 1. ColdFusion was looking at the following text:

</cfq
Invalid expression element. The usual cause of this error is a misspelling in the expression text.

Here's the code from my .cfm:
<cfquery name=&quot;daily&quot; datasource=&quot;database&quot; username=&quot;user&quot; password=&quot;password&quot;>
SELECT
CASE
WHEN (COLUMNA = 'A' AND COLUMNB = 'A') THEN 'Result 1'
WHEN (COLUMNA = 'B' AND COLUMNB = 'B') THEN 'Result 2'
WHEN (COLUMNA = 'C' AND COLUMNB = 'C') THEN 'Result 3'
WHEN (COLUMNA = 'D' AND COLUMNB = 'C') THEN 'Result 4'
WHEN (COLUMNA = 'E' AND COLUMNB = 'E') THEN 'Result 5'
END (NAMED ENTITY),
BASE_SNAPSHOT_DT
FROM TABLE;
</cfquery>

As you can see, the cfquery is closed. I'm wondering if I'm missing something obvious or perhaps I hit a bug? I can take this SQL out and replace it another simple select statement, leaving all of the cfquery parameters the same and it works properly. Any help would be appreciated. Thanks.

V
 
I'm no SQL expert, so maybe I'm way off base, but should there be a &quot;;&quot; after &quot;FROM TABLE&quot;? Just a guess. Hope I'm right!
 
The ; ends a Teradata query. It can go after the FROM, WHERE, GROUP BY, wherever. Thanks

V
 
Add the ODBC(or whatever datatype your using) with the query tag.
Now what is line 41 pointing to exactly and is BASE_SNAPSHOT_DT another field?
 
Line 41 is the </cfquery> The ODBC Datasource is in the cfquery tag. BASE_SNAPSHOT_DT is just another column. Thans.
 
I actually put that in as another attempt to get it to pass the query. You can disregard. I'm just going to pre-populate the page with a document scheduler. Thanks for your help.

V
 
Sorry not much help, I've had nothing but problems when trying to do a case statement in a query
 
Hi,
TABLE is a reserved word in teradata. Therefore if the name of the table is &quot;Table&quot; as the query implies and not something like Employee.

FROM TABLE;

would have to be

FROM &quot;TABLE&quot;;

to allow the Parser to know this is a Literal and not a reserved word.

--

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top