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!

JDBC query with Sybase database

Status
Not open for further replies.

akar

Technical User
Jun 12, 2002
1
US
Hi
I am working with Oracle 9i Reports Builder connecting to Sybase database using jdbc-odbc driver type.
I could connect to the database, use a simple query and generate reports.
Problem is only when, I use a variable in WHERE clause and have
1. group functions in SELECT statements (i.e. sum(), count()..)
2. NOT IN operation in one of conditions
Error message was thrown saying "Incorrect Syntax near ':.' "
(I declare a variable in USER PARAMETER and use the same in WHERE clause by refering say "where trandate=:m_trandate".)
Though there is no syntax error AT ALL. Am very sure about it, because when I execute the same statement in "isql" , it works perfectly.

Let me know whether Is it a limitation on Report Builder with Sybase db or Is any configuration do I miss??
Also, let me know if there is any work around process to handle this situation.

Sample Query I tried :
select item, avg(rate) from inventory
where item=:mitem /* mitem is a variable */
group by item

Error Message :
ERR 62007 : SQL Error:37000[SYBASE][ODBC Sybase driver][SQL Server]Incorrect syntax near ':'.

Any information is welcome.

Thanks & Regards
Anand
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top