Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

[SOLVED] SELECT IN clause on JasperReports #42

#1

Hi everyone!

Recently I sent an e-email to Mr. Dietmar asking how use an IN clause on my SQL Query. He kindly answer me to put my doubt in GitQ in order to get help from JasperReportsIntegration community.
Well, meanwhile I could solve the problem and decide to post this topic to help someone who have the same issue.
Since JasperReportsIntegration accept string parameters, I've decided to use a trick to transform a string sequence into query lines using REGEX and CONNECT BY:

select *
  from table_name
  where column_name in (select regexp_substr($P{p_parameter},'[^:]+',1,level) value 
                          from dual 
                       connect by level <= length ($P{p_parameter}) - length(replace($P{p_parameter},':'))+1)

This way, you can pass a parameter value: 1:2:3:4:5:6..:n
The Shuttle component can be used in Oracle Apex to provide the string sequence.
Well, that's it! I hope it helps :)

For all people involved in this project, thank you very much for this awsome tool!

Regards,
Fabricio

  • replies 0
  • views 101
  • likes 1