Re: stored procedure as data source

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Mon, 27 Aug 2007 21:27:01 +0200
Message-ID: <46d3258e$0$233$e4fe514c_at_news.xs4all.nl>


"zlotawy" <spawnek_at_wp.NO_SPAM.pl> schreef in bericht news:farh8v$p5o$1_at_inews.gazeta.pl...
>> 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 Received on Mon Aug 27 2007 - 21:27:01 CEST

Original text of this message