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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL expression 1

Status
Not open for further replies.

YANKRAY

Technical User
Nov 7, 2003
283
Using CR 10.0

I am trying to write a SQL expression.
The following error keeps popping up

"Error in compiling SQL Expression:
Query Engine Error: "ORa-00936: missing expression '.

This is my SQL expression:

SELECT "ITEM_TRANS_LOG"."ITEM_NO"
FROM "JIT"."ITEM_TRANS_LOG" "ITEM_TRANS_LOG"
WHERE "ITEM_TRANS_LOG"."ITEM_NO"='007-00302-73'

What does Crystal not like about this expression?

Thanks,
 
It's not Crystal that doesn't like the query, it's Oracle. When reading errors, always read from the right to the left (bottom to top). When read that way, the first error you come to is the root error.

In your case, the error you should be concerned with is:

ORa-00936: missing expression

Have one of your DBAs look up that particular Oracle error code for more information.

You could also try running the statement in SQL Plus to see if there is a problem.

Also, are there other things that might effect the query at run time? Do you have an additional parameter that isn't showing up in this query?
 
What is the intent of this SQL Expression?

Do you understand what they are?

To determine what Crystal is doing with your SQL Expression, check the Database->Show SQL Query.

In this case, It hink that you'll find that you're embedding a select statement into the existing select statement without correlation, so naturally Oracle would reject it, as will Crystal.

If you are trying to supply SQL in lieu of using the Crystal interface to return data, use a Command Object, not a SQL Expression.

If you intend to use a SQL Expression, I suggest that you come after architectural advice, rather than asking why things don't work.

Post:

Crystal version (you did)
database/connectivity used (inadvertently did, but not the connectivity)
Example data
Expected output

If a SQL Expression makes sense, someone will likely suggest it.

Also state whether you have the ability/permissions to create database objects, such as Views/SPs.

-k
 
You need to put the entire expression within parens.

-LB
 
Certainly parens will help, but this won't correlate to anything, so I suspect that the problem might run deeper.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top