Jump to content

QueryString


ktrinad

Recommended Posts

By: Samanth Athrey - samanth_athrey

QueryString

2002-04-08 23:19

Hi,

 

Is it possible for me to call a stored procedure instead of directly passing the SQL query??

 

thanx in advance

sva

 

 

By: Samanth Athrey - samanth_athrey

RE: QueryString - solved it

2002-04-09 04:39

Hi All,

 

I just did some tweeking and to my luck, it worked. I don't know if i did the right thing.

 

in the queryString tag just pass the stored procedure name and if it accepts any parameters, pass in brackets ([]).. u have the report working ;)

 

thanx

sva

 

 

By: Outey Ky - chhunak

RE: HOW? - QueryString - solved it - HOW?

2002-11-01 11:39

What is being returned as the OUPUT???? Is it a SQL statement that is built by the Stored Procedure, or as in the case of PL/SQL (Oracle) is a set of OUT parameters that represent the fields (Columns of data being returned) of data being returned???? Our stored procedures accept x number of IN parameters & return Y number of OUT parameters (resultant fields of data as table types (arrays of data)) What would the syntax look like in the QueryString tag?

 

Thanx - Your reply would be MOST appreciated!!!

 

 

By: Sri - annesrinivas

RE: HOW? - QueryString - solved it - HOW?

2004-03-24 02:31

Just wondering if anyone managed to figure out how we could handle a stored proc returning OUT parameters .....

 

Thanks in advance.

 

 

By: Outey Ky - chhunak

RE: HOW? - QueryString - HOW?

2002-11-01 12:22

Here is our Query string:

 

<queryString><![CDATA[

exec GEDIT_FSR_REPORTPKG(423,TO_DATE('29-Sep-1989','dd-mon-yyyy'),TO_DATE('29-Sep-2002','dd-mon-yyyy'),?,?,?,?,?,?,?,?,?,?,?,?,?)

]]></queryString>

 

 

<field name="t_fsrprotonum" class="java.lang.String"/>

<field name="t_fsrrptnum" class="java.lang.String"/>

<field name="t_fsrtitle" class="java.lang.String"/>

<field name="t_fsrdate" class="java.sql.Timestamp"/>

<field name="t_datesent" class="java.sql.Timestamp"/>

<field name="t_fileloc" class="java.lang.String"/>

<field name="t_submnum" class="java.lang.String"/>

<field name="t_indiccode" class="java.lang.String"/>

<field name="t_indictext" class="java.lang.String"/>

<field name="t_compnum" class="java.lang.String"/>

<field name="t_compname" class="java.lang.String"/>

<field name="t_apptype" class="java.lang.String"/>

<field name="t_serialnum" class="java.lang.String"/>

 

 

 

By: Outey Ky - chhunak

RE: HOW? - QueryString - HOW?

2002-11-01 15:37

Here is our Query string:

 

<queryString><![CDATA[

exec GEDIT_FSR_REPORTPKG(423,TO_DATE('29-Sep-1989','dd-mon-yyyy'),TO_DATE('29-Sep-2002','dd-mon-yyyy'),?,?,?,?,?,?,?,?,?,?,?,?,?)

]]></queryString>

 

 

<field name="t_fsrprotonum" class="java.lang.String"/>

<field name="t_fsrrptnum" class="java.lang.String"/>

<field name="t_fsrtitle" class="java.lang.String"/>

<field name="t_fsrdate" class="java.sql.Timestamp"/>

<field name="t_datesent" class="java.sql.Timestamp"/>

<field name="t_fileloc" class="java.lang.String"/>

<field name="t_submnum" class="java.lang.String"/>

<field name="t_indiccode" class="java.lang.String"/>

<field name="t_indictext" class="java.lang.String"/>

<field name="t_compnum" class="java.lang.String"/>

<field name="t_compname" class="java.lang.String"/>

<field name="t_apptype" class="java.lang.String"/>

<field name="t_serialnum" class="java.lang.String"/>

 

 

 

By: Teodor Danciu - teodord

RE: HOW? - QueryString - HOW?

2002-11-03 12:21

 

Hi,

 

Unfortunately, JasperReports is not yet specialized

in executing stored procedures as SQL queries.

It ca do that only with simple stored procedures

that return result set and do not have

OUT parameters.

This type of stored procedure can be called using

a PreparedStatement object, like JasperReports

always does.

However, stored procedures should be called using

CallableStatement objects, in order to be able to

register OUT parameters. JasperReports does not

support them yet.

This would probably be my next target.

 

Until then, the only way around the problem is to

execute the JDBC call outside JasperReports,

because the default SQL query executor of the

library cannot handle such JDBC calls yet.

 

You could still put the SQL query in the report

design, but you should manually load the

JasperReport object and get the query text and

execute it yourself in your application. Then you

could wrap the return array of data into a custom

JRDataSource before passing it to the report filling

routines.

 

I hope this helps.

Teodor

 

 

 

By: Outey Ky - chhunak

RE: QueryString

2002-11-04 07:03

Hi,

 

Actually, I didn't quite understand your last paragraph(forgive me). What do you mean by manually load the JasperReport object, and wrap the return array of data into a custom JRDataSource before passing it to the report filling routines.

 

Thank you.

 

 

 

 

By: Teodor Danciu - teodord

RE: QueryString

2002-11-04 13:03

 

Hi,

 

Explaining all this in detail would be equivalent

to rewriting the "ultimate guide" on this forum.

 

Anyway, manually loading means using the

dori.jasper.engine.util.JRLoader class to load

dori.jasper.engine.JasperReport objects.

 

Wrapping the array into a data source means using

a custom made implementation of the

dori.jasper.engine.JRDataSource interface

in order for engine to use this data when filling the

report.

Check the "datasource" sample to see how the

library's implementations of this interface are used.

 

I hope this helps.

Teodor

 

 

 

By: Outey Ky - chhunak

RE: QueryString

2002-11-04 13:24

Thank you, I understand.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...