Errors while trying to use Oracle REF_CURSOR procedure

Stimulsoft Reports.JAVA discussion
denis.awfm
Posts: 23
Joined: Wed Sep 25, 2019 7:19 pm

Errors while trying to use Oracle REF_CURSOR procedure

Post by denis.awfm »

Hello.
Cannot use Oracle stored procedure in StimulSoft Designer (updated to version 2019.3.6).
Trying to do as it is told in example here

Error pops up.
Fields in the image are from regular "select * from employees;" query.
When trying to manually put any field to a text box on a data band, when previewing - same error is shown.
What I am doing wrong? I have to use ref_cursor parameter in order by link the report to "runtime" dataset as stored procedure is planned to have much more complex query. Now it fails even on simpliest select from one table.
Thanks in advance,
Denis.

Image
Image
denis.awfm
Posts: 23
Joined: Wed Sep 25, 2019 7:19 pm

Re: Errors while trying to use Oracle REF_CURSOR procedure

Post by denis.awfm »

Somehow images are not loaded to head thread message.
Adding them here:
https://ibb.co/SQ70Nqf
https://ibb.co/SNPydwx

Just in case if still not available, will list the procedure source and error message as text below:
create or replace PROCEDURE TEST_EMPLOYEES
(
PEMPLOYEEID IN VARCHAR2,
res_cursor out sys_refcursor
) AS
BEGIN
open res_cursor
for 'SELECT * FROM EMPLOYEES WHERE EMPLOYEEID like :EMPLOYEEID'
using PEMPLOYEEID;
NULL;
return;
END TEST_EMPLOYEES;
/

SQL text for data source (type: stored procedure)
CALL TEST_EMPLOYEES(@PEMPLOYEEID,@res_cursor)
Parameter PEMPLOYEEID is defined and set to "100%"

And here is the error message in Designer when attempting to execute
ORA-06550: line 1, column 12:
PLS-00103: Encountered the symbol "TEST_EMPLOYEES" when expecting one of the following: := . ( @ % ;
Lech Kulikowski
Posts: 6265
Joined: Tue Mar 20, 2018 5:34 am

Re: Errors while trying to use Oracle REF_CURSOR procedure

Post by Lech Kulikowski »

Hello,

Please check:
viewtopic.php?f=19&t=48791

Thank you.
denis.awfm
Posts: 23
Joined: Wed Sep 25, 2019 7:19 pm

Re: Errors while trying to use Oracle REF_CURSOR procedure

Post by denis.awfm »

Hi Lech.
I already looked at that thread, it does not solving my problem.
And the run-time creation of the report (like it is done in the latest Attachment StimulsoftOracleStoredProcedureSample.zip => TestOracle.java)

public class TestOracle {

/**
* @param args
* @throws StiException
* @throws FileNotFoundException
*/
public static void main(String[] args) throws FileNotFoundException, StiException {
StiReport report = StiReport.newInstance();
StiPage page = report.getPages().get(0);
report.setDictionary(new StiDictionary(report));
StiOracleDatabase db = new StiOracleDatabase("test", "test", "url=jdbc:oracle:thin:@192.168.64.128:1521:orcl;user=sys as sysdba;password=oracle");
report.getDictionary().getDatabases().add(db);
StiOracleSource source = new StiOracleSource("test.DataSource", "DataSource", "DataSource", "CALL doublingProc(@Parameter1, @Column1)");
source.setType(StiSqlSourceType.StoredProcedure);
source.setDictionary(report.getDictionary());
report.getDictionary().getDataSources().add(source);
source.setColumns(new StiDataColumnsCollection());
source.getColumns().add(new StiDataColumn("Column1", "Column1", "Column1", StiSystemTypeEnum.SystemInt32.getSystemType()));
source.setParameters(new StiDataParametersCollection());
StiDataParameter param = new StiDataParameter("Parameter1", 8, 0);
param.setExpression("1");
source.getParameters().add(param);

StiDataBand dataBand = new StiDataBand();
dataBand.setDataSourceName("DataSource");
dataBand.setHeight(0.5);
dataBand.setName("DataBand");
page.getComponents().add(dataBand);

StiText dataText = new StiText(new StiRectangle(0, 0, page.getWidth(), 0.5));
dataText.setText("{DataSource.Column1}");
dataText.setName("DataText");
dataText.getBorder().setSide(StiBorderSides.All);
dataBand.getComponents().add(dataText);
report.Render();
StiExportManager.exportPdf(report, new FileOutputStream("c:/0/report.pdf"));

}

}

is NOT helpful for me.
I would like to design the report in the Designer, not programmatically. It supposed to be a complex report with variable number of columns.

Any other help you could give me?

Regards,
Denis.
Lech Kulikowski
Posts: 6265
Joined: Tue Mar 20, 2018 5:34 am

Re: Errors while trying to use Oracle REF_CURSOR procedure

Post by Lech Kulikowski »

Hello,

We need some additional time to investigate the issue, we will let you know about the result.

Thank you.
denis.awfm
Posts: 23
Joined: Wed Sep 25, 2019 7:19 pm

Re: Errors while trying to use Oracle REF_CURSOR procedure

Post by denis.awfm »

Hi Lech and All,
any feedback on the topic? Maybe there is a workaround I could use?
Regards,
Denis.
Lech Kulikowski
Posts: 6265
Joined: Tue Mar 20, 2018 5:34 am

Re: Errors while trying to use Oracle REF_CURSOR procedure

Post by Lech Kulikowski »

Hello,

We are working on the issue, we will let you know about the result.

Thank you.
denis.awfm
Posts: 23
Joined: Wed Sep 25, 2019 7:19 pm

Re: Errors while trying to use Oracle REF_CURSOR procedure

Post by denis.awfm »

Hi Lech,
any news regarding the problem?
Just a reminder.
Cheers,
Denis.
Vadim
Posts: 363
Joined: Tue Apr 23, 2013 11:23 am

Re: Errors while trying to use Oracle REF_CURSOR procedure

Post by Vadim »

denis.awfm
Posts: 23
Joined: Wed Sep 25, 2019 7:19 pm

Re: Errors while trying to use Oracle REF_CURSOR procedure

Post by denis.awfm »

Hi Vadim.
I used that example again, now with the latest version (2020.1).
Still same error (see attachment).

But if I try to use : instead of @ and omit the "call" it provides another error message "Not all variables bound" (another attachment)

Can you please guide me what could I do.
I am licensed user ("Developer") and I really need this thing to work (Oracle stored procedure as data source).
I have installed ODP.NET when I created Oracle data source in my report, so did not do any configuration for it.

Please respond,
Denis Spirin.
Attachments
Screen Shot 2019-12-26 at 09.27.05.png
Screen Shot 2019-12-26 at 09.27.05.png (155.74 KiB) Viewed 3489 times
Screen Shot 2019-12-26 at 09.18.24.png
Screen Shot 2019-12-26 at 09.18.24.png (210.1 KiB) Viewed 3489 times
Post Reply