When developing a WebI report based on free-hand SQL I usually get the query working on my database platform first, SQL Server Management Studio in my case. Then I drop my code into a free-hand SQL query.
Looking good, right? No. This will not work. When I click OK on the Query Script Editor box I get this error message…
After much trial and error it is a very simple solution. I cannot have that USE statement. And in my case since RetailData is not my default database so I need to fully qualify my table.
SELECT TOP 10 * FROM RetailData.dbo.Customer;
After getting that error I kept getting it even after correcting my query. I actually had to log out of BOBJ and log back in to create my report with the corrected query without the USE statement.
Hope this prevents some issues down the road for you.