Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > python error PLS-00306: wrong number or types of arguments in

Reply
Thread Tools

python error PLS-00306: wrong number or types of arguments in

 
 
Adeoluwa Odein
Guest
Posts: n/a
 
      07-13-2011
Hello
I am using the zxJDBC package with jython (similar to python), and I
am having "python error PLS-00306: wrong number or types of arguments"
error when using the "callproc()" method to execute a stored
procedure.

The Oracle stored procedure takes a single OUT varchar2 parameter. My
code is as follows:

p = [None]
c.callproc('pkg1_returns', p);

....
What I am doing corresponds to the examples..but I can seem to know
why it is not working. Help.


"Adeoluwa"
 
Reply With Quote
 
 
 
 
John Gordon
Guest
Posts: n/a
 
      07-13-2011
In <01efb6ac-deaa-4bdb-8b2d-> Adeoluwa Odein <> writes:

> Hello
> I am using the zxJDBC package with jython (similar to python), and I
> am having "python error PLS-00306: wrong number or types of arguments"
> error when using the "callproc()" method to execute a stored
> procedure.


> The Oracle stored procedure takes a single OUT varchar2 parameter. My
> code is as follows:


> p = [None]
> c.callproc('pkg1_returns', p);


If the procedure takes a varchar2 parameter, why are you passing [None]?

It might help if you posted the method signature of the Oracle stored
procedure you're trying to call.

--
John Gordon A is for Amy, who fell down the stairs
B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

 
Reply With Quote
 
 
 
 
Adeoluwa Odein
Guest
Posts: n/a
 
      07-13-2011















Thanks, your assistance will be greatly appreciated on the right way
forward. See the Stored Procedure Below -very simple:



create or replace package c2_pkg
as
procedure openc;
procedure closec;
procedure RS22(v out varchar);
end;
/

create or replace package body c2_pkg
as
v_first_time boolean := TRUE;
v_cursor number;
cursor srvr_cur
is
select distinct b.mid from SVR a,VAR b where a.mid = b.mid;

procedure openc
as
begin
if not srvr_cur%ISOPEN
then
open srvr_cur;
end if;

end openc;

procedure closec
as
begin
close srvr_cur;
end closec;


procedure RS22(v out varchar2)
as
-- Server varchar2(64);

begin
Server := NULL;
fetch srvr_cur into Server;
v := Server;

end RS22;

end;
/




















On Jul 13, 1:40*pm, John Gordon <gor...@panix.com> wrote:
> In <01efb6ac-deaa-4bdb-8b2d-b603bddde...@n5g2000yqh.googlegroups.com> Adeoluwa Odein <stratfordtena...@gmail.com> writes:
>
> > Hello
> > I am using the zxJDBC package with jython (similar to python), and I
> > am having "python error PLS-00306: wrong number or types of arguments"
> > error when using the "callproc()" method to execute a stored
> > procedure.




> > The Oracle stored procedure takes a single OUT varchar2 parameter. *My
> > code is as follows:
> > p = [None]
> > c.callproc('pkg1_returns', p);

>
> If the procedure takes a varchar2 parameter, why are you passing [None]?
>
> It might help if you posted the method signature of the Oracle stored
> procedure you're trying to call.
>
> --
> John Gordon * * * * * * * * * A is for Amy, who fell down the stairs
> gor...@panix.com * * * * * * *B is for Basil, assaulted by bears
> * * * * * * * * * * * * * * * * -- EdwardGorey, "The Gashlycrumb Tinies"


 
Reply With Quote
 
John Gordon
Guest
Posts: n/a
 
      07-13-2011
In <9e937261-d05d-477a-90d2-> Adeoluwa Odein <> writes:

> Thanks, your assistance will be greatly appreciated on the right way
> forward. See the Stored Procedure Below -very simple:


I don't see a procedure named "pkg1_returns", which is the prodecure
called by your code. Where is this procedure?

--
John Gordon A is for Amy, who fell down the stairs
B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

 
Reply With Quote
 
Adeoluwa Odein
Guest
Posts: n/a
 
      07-13-2011
The actual jython/python call is:

p = [None]
c.callproc('c2_pkg.RS22', p);

I used a placeholder initially; now that you have the SQL code, there
it is. It essentially invokes the stored procedure, and it should
return the OUT variable p, with some value. It doesn't have to be a
cursor fetch; even a minor text assignment.






On Jul 13, 2:10*pm, John Gordon <gor...@panix.com> wrote:
> In <9e937261-d05d-477a-90d2-a690e85e1...@h17g2000yqn.googlegroups.com> Adeoluwa Odein <stratfordtena...@gmail.com> writes:
>
> > Thanks, your assistance will be greatly appreciated on the right way
> > forward. *See the Stored Procedure Below -very simple:

>
> I don't see a procedure named "pkg1_returns", which is the prodecure
> called by your code. *Where is this procedure?
>
> --
> John Gordon * * * * * * * * * A is for Amy, who fell down the stairs
> gor...@panix.com * * * * * * *B is for Basil, assaulted by bears
> * * * * * * * * * * * * * * * * -- EdwardGorey, "The Gashlycrumb Tinies"


 
Reply With Quote
 
John Gordon
Guest
Posts: n/a
 
      07-13-2011
In <d45161dc-648c-4a44-a563-> Adeoluwa Odein <> writes:

> The actual jython/python call is:


> p =3D [None]
> c.callproc('c2_pkg.RS22', p);


> I used a placeholder initially; now that you have the SQL code, there
> it is. It essentially invokes the stored procedure, and it should
> return the OUT variable p, with some value. It doesn't have to be a
> cursor fetch; even a minor text assignment.


That procedure is defined as taking one parameter, but you're passing
an empty parameter list. Why?

--
John Gordon A is for Amy, who fell down the stairs
B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

 
Reply With Quote
 
Adeoluwa Odein
Guest
Posts: n/a
 
      07-13-2011
On Jul 13, 2:26*pm, John Gordon <gor...@panix.com> wrote:
> In <d45161dc-648c-4a44-a563-317b5f5e5...@h14g2000yqd.googlegroups.com> Adeoluwa Odein <stratfordtena...@gmail.com> writes:
>
> > The actual jython/python call is:

It's taking an OUT parameter.. I'm just following the examples as
documented by zxJDBC. How can I fix it?




> > p =3D [None]
> > c.callproc('c2_pkg.RS22', p);
> > I used a placeholder initially; now that you have the SQL code, there
> > it is. *It essentially invokes the stored procedure, and it should
> > return the OUT variable p, with some value. *It doesn't have to be a
> > cursor fetch; even a minor text assignment.

>
> That procedure is defined as taking one parameter, but you're passing
> an empty parameter list. *Why?
>
> --
> John Gordon * * * * * * * * * A is for Amy, who fell down the stairs
> gor...@panix.com * * * * * * *B is for Basil, assaulted by bears
> * * * * * * * * * * * * * * * * -- EdwardGorey, "The Gashlycrumb Tinies"


 
Reply With Quote
 
Adeoluwa Odein
Guest
Posts: n/a
 
      07-13-2011
On Jul 13, 2:26*pm, John Gordon <gor...@panix.com> wrote:
> In <d45161dc-648c-4a44-a563-317b5f5e5...@h14g2000yqd.googlegroups.com> Adeoluwa Odein <stratfordtena...@gmail.com> writes:
>
> > The actual jython/python call is:
> > p =3D [None]
> > c.callproc('c2_pkg.RS22', p);
> > I used a placeholder initially; now that you have the SQL code, there
> > it is. *It essentially invokes the stored procedure, and it should
> > return the OUT variable p, with some value. *It doesn't have to be a
> > cursor fetch; even a minor text assignment.

>
> That procedure is defined as taking one parameter, but you're passing
> an empty parameter list. *Why?
>
> --
> John Gordon * * * * * * * * * A is for Amy, who fell down the stairs
> gor...@panix.com * * * * * * *B is for Basil, assaulted by bears
> * * * * * * * * * * * * * * * * -- EdwardGorey, "The Gashlycrumb Tinies"


I'm new to jython...
 
Reply With Quote
 
John Gordon
Guest
Posts: n/a
 
      07-13-2011
> It's taking an OUT parameter.. I'm just following the examples as
> documented by zxJDBC. How can I fix it?


I suspect the example you're looking at was for a procedure which has no
arguments, so in that case it would make sense to pass an empty parameter
list.

I haven't worked with OUT parameters so I don't know if this will work,
but try it and see what happens:

my_string = ""
p = [my_string]
c.callproc('c2_pkg.RS22', p);
print p

--
John Gordon A is for Amy, who fell down the stairs
B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

 
Reply With Quote
 
Adeoluwa Odein
Guest
Posts: n/a
 
      07-13-2011
On Jul 13, 4:09*pm, John Gordon <gor...@panix.com> wrote:
> > It's taking an OUT parameter.. I'm just following the examples as
> > documented by zxJDBC. *How can I fix it?

>
> I suspect the example you're looking at was for a procedure which has no
> arguments, so in that case it would make sense to pass an empty parameter
> list.
>
> I haven't worked with OUT parameters so I don't know if this will work,
> but try it and see what happens:
>
> * my_string = ""
> * p = [my_string]
> * c.callproc('c2_pkg.RS22', p);
> * print p
>
> --
> John Gordon * * * * * * * * * A is for Amy, who fell down the stairs
> gor...@panix.com * * * * * * *B is for Basil, assaulted by bears
> * * * * * * * * * * * * * * * * -- EdwardGorey, "The Gashlycrumb Tinies"



The same error. The sample were found on the following site --I copied
exactly what is written there:
1. http://www.jython.org/archive/21/docs/zxjdbc.html



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Argument type of function and safe types and types, arguments canhandle safely ittium C++ 4 12-09-2011 11:05 AM
PLS-00306: wrong number or types of arguments in call Pial ASP .Net 4 08-27-2010 04:17 PM
Call again a variadic function (... variable number of arguments)with same arguments that its variadic wrapper moreau.steve@gmail.com C Programming 3 12-31-2008 07:13 AM
Re: Python 2.5: wrong number of arguments given in TypeError forfunction argument aggregation (dictionary input vs the norm) M.-A. Lemburg Python 0 10-31-2008 09:34 AM
functions and arguments.length; passing unknown number of arguments oldyork90 Javascript 10 09-27-2008 03:05 AM



Advertisments