Skip to main content



      Home
Home » Archived » BIRT » [solved] Parameter Marker in FROM clause
[solved] Parameter Marker in FROM clause [message #1824013] Mon, 06 April 2020 09:50 Go to next message
Eclipse UserFriend
Suppose I have a simple SQL query:

select * from wmwhse21.itrn where adddate = 20191111


I want the user to be able to choose the database upon which to run the query at run-time. I've tried putting

select * from aa where adddate = 20191111 and aa = ?


i.e. placing a parameter marker in the FROM clause, but after keying in wmwhse21.itrn as aa in the BIRT report web viewer I get the error:

org.eclipse.birt.report.engine.api.EngineException: Cannot get the result set metadata. org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object. SQL error #1:ORA-00942: table or view does not exist ; java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist


----

I understand that parameter markers are meant for WHERE clauses, but is it possible to use them in the FROM statement?

If not, how should I go about allowing users to key in the desired database to run the query against at run-time?

For reference, the database ID and database alias are different (e.g. "wmwhse21" is named Chicago Warehouse for instance, and you need to input the former to run the query), so I figure a choose-from-dropdown would work best for my users.

[Updated on: Tue, 07 April 2020 03:50] by Moderator

Re: Parameter Marker in FROM clause [message #1824034 is a reply to message #1824013] Mon, 06 April 2020 15:25 Go to previous messageGo to next message
Eclipse UserFriend
I think you should be able to do it in the beforeOpen method of the dataset. Set the Select Statements as usual and then extend the query in the beforeOpen method. (See screenshot)

index.php/fa/37759/0/

  • Attachment: From Parm.jpg
    (Size: 38.62KB, Downloaded 449 times)
Re: Parameter Marker in FROM clause [message #1824059 is a reply to message #1824034] Tue, 07 April 2020 03:51 Go to previous message
Eclipse UserFriend
Thanks Jerry, this is exactly what I was looking for. Cheers!
Previous Topic:auto adjustment cell
Next Topic:birt report engine
Goto Forum:
  


Current Time: Mon Jul 21 12:38:33 EDT 2025

Powered by FUDForum. Page generated in 0.04262 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top