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

using SQL query

Status
Not open for further replies.

atarrqis

IS-IT--Management
Nov 26, 2004
155
US
oracle 10g and CR11

I'm trying to update a report that uses a SQL query. I've never used this before and may not understand how this was originally created. I think I've figured out to do a Database Expert, Edit Command. However, even if I try and do it as an Add Command on a blank report I get the following error - Failed to retrieve data from the database; Invalid Identifier; Failed to execute SQL statement.

The query is:
select
LEVEL,
s.doc_no,
s.doc_rev,
s.sub_doc_no, d.document_title, s.sub_doc_class, s.sub_doc_rev
FROM doc_structure s, document_data d
where s.doc_no = d.document_number
and s.doc_rev = d.document_revision
AND d.document_status = 'Released'
CONNECT BY s.doc_no = PRIOR s.sub_doc_no
AND s.doc_rev = PRIOR s.sub_doc_rev
START WITH s.doc_no = {?doc_no}
and s.doc_rev = {?doc_rev}

where doc_no and doc_rev are in the parameter list. The query works correctly outside of Crystal.
 
what type of database are you writing your query again, oracle, sql server, mysql?? because while each one support 99.9 % of the sql langauage, each maybe a bit different.
 
I indicated oracle 10g in the beginning of my thread.
 
Hi,
Is the connection type ( ADO, ODBC, Oracle Server, whatever) the same in the report that works and the one that fails?


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Oracle server
but thanks, I think I've found the answer to my problem - I need single quotes around the parameter name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top