REP-0492: Unrecognized token
Yesterday I was trying to build a report in Oracle Dev6i. I have build the query in Toad9.5.0.31, I have executed query several times in Toad and it runs fine but when I paste same query in report builder and click 'OK' button it shows error ( REP-0492: Unrecognized token: ' '. ).
I have tried everything possible to get rid of this error but I was so disappointed that time. This type of error occurs when query is containing syntax errors, but in my case my query was working fine in toad but not in Oracle Report Builder.
Instead of prolong my sad story lets discuss the solution. If I compare my error ( REP-0492: Unrecognized token: ' '. ) with its description ( REP-0492: Unrecognized token: '<token name>'. ) then I can easily figure out that there is some extra spaces in my query as my error was illustrating by replacing '<token name>' with ' ', where token name is just one space shows in single quotes.
So I deleted all extra spaces from my query and report builder accepted my query.
I am surprised why report builder was not accepting my query though I have built so many reports with the queries having so many spaces. This is still an answered question for me.
May be this was due to some 'tabs' in my query but this is just my hypothesis I am not sure about the exact reason of the error but I am sure about the solution "Just remove all spaces and error will be vanished" :).
All the best.
Error Description :
REP-0492: Unrecognized token: '<token name>'.
Cause: The SELECT statement that you entered contains an item that is not part of SQL syntax.
Action: Review your SELECT statement and ensure that it follows SQL syntax.
Extra spaces illustrated in red color which I have deleted.
SELECT rc.CUSTOMER_ID,
rc.customer_name,
hcpa.overall_credit_limit
FROM ra_customers rc,
ra_site_uses_all rsu,
ra_addresses_all raa,
hz_cust_profile_amts hcpa
WHERE raa.customer_id = rc.customer_id
AND rsu.address_id = raa.address_id
AND hcpa.site_use_id = rsu.site_use_id
AND rsu.primary_flag = 'Y'
AND rsu.status = 'A'
AND rsu.site_use_code = 'BILL_TO'
AND rsu.org_id = 111
AND rc.customer_id in(3211,3222,3233,3244)
Your feedback/comment is quite important for improving this blog so feel free to leave your comments & suggestions
0 comments:
Post a Comment