dbTalk Databases Forums  

stored procedure as data source

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss stored procedure as data source in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
zlotawy
 
Posts: n/a

Default stored procedure as data source - 08-25-2007 , 08:43 AM






Hello,
there is stored procedure which has one argument of type: REF CURSOR
RETURN record in INOUT mode.

When I set the procedure as data source in Reports, I do not have to give
any arguments. I can write in form only name of package and name of
procedure without any arguments. And report is generated correctly.


I would like to create more paramteric procedure.

I added new argument. Type: number, mode: IN.

And I have problem how to write name of procedure in form of JDBC data
source.

I think it should be something like this:

package.procedure(argument_ref_cursor, 5);

But there are errors.. Wrong number of arguments, wront types and cetera.

package.procedure(new_argument => 5) is bad too.

Maybe anyone knows how to make it and could help me?

Regards,
Wojtek



Reply With Quote
  #2  
Old   
Frank van Bortel
 
Posts: n/a

Default Re: stored procedure as data source - 08-25-2007 , 08:46 AM






-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

zlotawy wrote:

Quote:
Maybe anyone knows how to make it and could help me?
Not without versions (db *and* developer), and a snippet
of code, and the *exact* error (copy/paste - not your interpretation)
- --
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFG0DLALw8L4IAs830RAqwAAJ9OiXR5HFKNIYnLp086dI tFnTJW0ACeM+ek
a+mcZy/YCADojHR/b1veDuo=
=4fNg
-----END PGP SIGNATURE-----


Reply With Quote
  #3  
Old   
zlotawy
 
Posts: n/a

Default Re: stored procedure as data source - 08-26-2007 , 04:30 AM



Quote:
Not without versions (db *and* developer), and a snippet
of code, and the *exact* error (copy/paste - not your interpretation)
- --


Hello,
I have Oracle 10g Expres Edition and Reports 10.


This code works correctly:

PACKAGE package:
TYPE cursor IS REF CURSOR RETURN record;
PROCEDURE generate(datas IN OUT cursor)

Body:
PROCEDURE generate(datas IN OUT cursor) is
BEGIN
OPEN datas FOR SELECT bonus.empno, bonus.ename, job, sal, comm FROM
bonus;
END generate;

But this not:

PACKAGE package:

PROCEDURE generate(datas IN OUT cursor dupa IN NUMBER);
Body:
PROCEDURE generate(datas IN OUT cursor, new_argument IN NUMBER) IS
BEGIN
OPEN datas FOR SELECT bonus.empno, bonus.ename, job, sal, comm FROM
bonus;
END generate;


In Report Wizard I set data source as JDBC Query. In form of it I have to
write name of procedure.

In first cause I wrote
package.generate
and it was correct.


How to write new verision of procedure (with new_argument)?

package.generate(new_argument => 5) causes error: "wrong number of types of
arguments in call to'GENERATE' "


Thanks for every help,
Wojtek




Reply With Quote
  #4  
Old   
Shakespeare
 
Posts: n/a

Default Re: stored procedure as data source - 08-27-2007 , 02:27 PM




"zlotawy" <spawnek (AT) wp (DOT) NO_SPAM.pl> schreef in bericht
news:farh8v$p5o$1 (AT) inews (DOT) gazeta.pl...
Quote:
Not without versions (db *and* developer), and a snippet
of code, and the *exact* error (copy/paste - not your interpretation)
- --



Hello,
I have Oracle 10g Expres Edition and Reports 10.


This code works correctly:

PACKAGE package:
TYPE cursor IS REF CURSOR RETURN record;
PROCEDURE generate(datas IN OUT cursor)

Body:
PROCEDURE generate(datas IN OUT cursor) is
BEGIN
OPEN datas FOR SELECT bonus.empno, bonus.ename, job, sal, comm FROM
bonus;
END generate;

But this not:

PACKAGE package:

PROCEDURE generate(datas IN OUT cursor dupa IN NUMBER);
Body:
PROCEDURE generate(datas IN OUT cursor, new_argument IN NUMBER) IS
BEGIN
OPEN datas FOR SELECT bonus.empno, bonus.ename, job, sal, comm FROM
bonus;
END generate;


In Report Wizard I set data source as JDBC Query. In form of it I have to
write name of procedure.

In first cause I wrote
package.generate
and it was correct.


How to write new verision of procedure (with new_argument)?

package.generate(new_argument => 5) causes error: "wrong number of types
of arguments in call to'GENERATE' "


Thanks for every help,
Wojtek


Procedures i n your package specification MUST match the definitions in the
body, so if you change the interface (parameters) in the body, you should do
that in the specification as well. If you want, you can define BOTH
definitions in the spec and the body (with one and two parameters): this is
called overloading. Oracle will, by the parameters you specify, determine
which of the two to call.

Note: you CAN have procs in the body you don't specify in the specification,
but they will not be callable from 'the outside world', only from within
other procs in your package.

Shakespeare




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.