Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #9417 > unrolled thread
| Started by | Adeoluwa Odein <stratfordtenants@gmail.com> |
|---|---|
| First post | 2011-07-13 10:11 -0700 |
| Last post | 2011-07-13 11:33 -0700 |
| Articles | 16 — 3 participants |
Back to article view | Back to comp.lang.python
python error PLS-00306: wrong number or types of arguments in Adeoluwa Odein <stratfordtenants@gmail.com> - 2011-07-13 10:11 -0700
Re: python error PLS-00306: wrong number or types of arguments in John Gordon <gordon@panix.com> - 2011-07-13 17:40 +0000
Re: python error PLS-00306: wrong number or types of arguments in Adeoluwa Odein <stratfordtenants@gmail.com> - 2011-07-13 10:58 -0700
Re: python error PLS-00306: wrong number or types of arguments in John Gordon <gordon@panix.com> - 2011-07-13 18:10 +0000
Re: python error PLS-00306: wrong number or types of arguments in Adeoluwa Odein <stratfordtenants@gmail.com> - 2011-07-13 11:18 -0700
Re: python error PLS-00306: wrong number or types of arguments in John Gordon <gordon@panix.com> - 2011-07-13 18:26 +0000
Re: python error PLS-00306: wrong number or types of arguments in Adeoluwa Odein <stratfordtenants@gmail.com> - 2011-07-13 11:32 -0700
Re: python error PLS-00306: wrong number or types of arguments in John Gordon <gordon@panix.com> - 2011-07-13 20:09 +0000
Re: python error PLS-00306: wrong number or types of arguments in Adeoluwa Odein <stratfordtenants@gmail.com> - 2011-07-13 13:33 -0700
Re: python error PLS-00306: wrong number or types of arguments in John Gordon <gordon@panix.com> - 2011-07-13 21:02 +0000
Re: python error PLS-00306: wrong number or types of arguments in Adeoluwa Odein <stratfordtenants@gmail.com> - 2011-07-13 14:06 -0700
Re: python error PLS-00306: wrong number or types of arguments in John Gordon <gordon@panix.com> - 2011-07-13 21:19 +0000
Re: python error PLS-00306: wrong number or types of arguments in Adeoluwa Odein <stratfordtenants@gmail.com> - 2011-07-13 14:28 -0700
Re: python error PLS-00306: wrong number or types of arguments in Adeoluwa Odein <stratfordtenants@gmail.com> - 2011-07-13 14:28 -0700
Re: python error PLS-00306: wrong number or types of arguments in Terry Reedy <tjreedy@udel.edu> - 2011-07-13 17:18 -0400
Re: python error PLS-00306: wrong number or types of arguments in Adeoluwa Odein <stratfordtenants@gmail.com> - 2011-07-13 11:33 -0700
| From | Adeoluwa Odein <stratfordtenants@gmail.com> |
|---|---|
| Date | 2011-07-13 10:11 -0700 |
| Subject | python error PLS-00306: wrong number or types of arguments in |
| Message-ID | <01efb6ac-deaa-4bdb-8b2d-b603bdddec57@n5g2000yqh.googlegroups.com> |
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"
[toc] | [next] | [standalone]
| From | John Gordon <gordon@panix.com> |
|---|---|
| Date | 2011-07-13 17:40 +0000 |
| Message-ID | <ivklaj$ik5$1@reader1.panix.com> |
| In reply to | #9417 |
In <01efb6ac-deaa-4bdb-8b2d-b603bdddec57@n5g2000yqh.googlegroups.com> Adeoluwa Odein <stratfordtenants@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
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | Adeoluwa Odein <stratfordtenants@gmail.com> |
|---|---|
| Date | 2011-07-13 10:58 -0700 |
| Message-ID | <9e937261-d05d-477a-90d2-a690e85e124d@h17g2000yqn.googlegroups.com> |
| In reply to | #9419 |
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
> -- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | John Gordon <gordon@panix.com> |
|---|---|
| Date | 2011-07-13 18:10 +0000 |
| Message-ID | <ivkn1u$17t$1@reader1.panix.com> |
| In reply to | #9420 |
In <9e937261-d05d-477a-90d2-a690e85e124d@h17g2000yqn.googlegroups.com> Adeoluwa Odein <stratfordtenants@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
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | Adeoluwa Odein <stratfordtenants@gmail.com> |
|---|---|
| Date | 2011-07-13 11:18 -0700 |
| Message-ID | <d45161dc-648c-4a44-a563-317b5f5e5699@h14g2000yqd.googlegroups.com> |
| In reply to | #9421 |
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
> -- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | John Gordon <gordon@panix.com> |
|---|---|
| Date | 2011-07-13 18:26 +0000 |
| Message-ID | <ivko10$hvc$1@reader1.panix.com> |
| In reply to | #9422 |
In <d45161dc-648c-4a44-a563-317b5f5e5699@h14g2000yqd.googlegroups.com> Adeoluwa Odein <stratfordtenants@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
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | Adeoluwa Odein <stratfordtenants@gmail.com> |
|---|---|
| Date | 2011-07-13 11:32 -0700 |
| Message-ID | <e7fd08c5-e2e4-4699-b75d-5bcf796484ff@m18g2000vbl.googlegroups.com> |
| In reply to | #9423 |
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
> -- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | John Gordon <gordon@panix.com> |
|---|---|
| Date | 2011-07-13 20:09 +0000 |
| Message-ID | <ivku18$s45$1@reader1.panix.com> |
| In reply to | #9424 |
> 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
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | Adeoluwa Odein <stratfordtenants@gmail.com> |
|---|---|
| Date | 2011-07-13 13:33 -0700 |
| Message-ID | <86b9e6f2-e18e-41b9-92a2-86ea8d7b4592@f35g2000vbr.googlegroups.com> |
| In reply to | #9432 |
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
> -- Edward Gorey, "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
[toc] | [prev] | [next] | [standalone]
| From | John Gordon <gordon@panix.com> |
|---|---|
| Date | 2011-07-13 21:02 +0000 |
| Message-ID | <ivl15d$l54$1@reader1.panix.com> |
| In reply to | #9434 |
In <86b9e6f2-e18e-41b9-92a2-86ea8d7b4592@f35g2000vbr.googlegroups.com> Adeoluwa Odein <stratfordtenants@gmail.com> writes:
> 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
Ah, I see. You're supposed to call c.fetchall() afterwards to retrieve
the OUT parameter.
Also, the example page defines the called object as a function, not a
procedure. Maybe that's the problem? Try defining RS22 as a function
and see if that helps.
You might also try defining it outside of a package, as that is how the
example code does it.
--
John Gordon A is for Amy, who fell down the stairs
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | Adeoluwa Odein <stratfordtenants@gmail.com> |
|---|---|
| Date | 2011-07-13 14:06 -0700 |
| Message-ID | <0730c5fb-3b65-45ce-9cc5-69d639f48281@g2g2000vbl.googlegroups.com> |
| In reply to | #9436 |
On Jul 13, 5:02 pm, John Gordon <gor...@panix.com> wrote: > In <86b9e6f2-e18e-41b9-92a2-86ea8d7b4...@f35g2000vbr.googlegroups.com> Adeoluwa Odein <stratfordtena...@gmail.com> writes: > > > 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 > if you define the function in the execute() method, it works (as seen on the page). But this is a stored procedure already residing on the DB. A function/procedure outside of a package, actually works, but then you lose access to private data; which is while I used a package. > Ah, I see. You're supposed to call c.fetchall() afterwards to retrieve > the OUT parameter. > > Also, the example page defines the called object as a function, not a > procedure. Maybe that's the problem? Try defining RS22 as a function > and see if that helps. > > You might also try defining it outside of a package, as that is how the > example code does it. > > -- > John Gordon A is for Amy, who fell down the stairs > gor...@panix.com B is for Basil, assaulted by bears > -- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | John Gordon <gordon@panix.com> |
|---|---|
| Date | 2011-07-13 21:19 +0000 |
| Message-ID | <ivl245$b78$1@reader1.panix.com> |
| In reply to | #9438 |
In <0730c5fb-3b65-45ce-9cc5-69d639f48281@g2g2000vbl.googlegroups.com> Adeoluwa Odein <stratfordtenants@gmail.com> writes:
> if you define the function in the execute() method, it works (as seen
> on the page). But this is a stored procedure already residing on the
> DB. A function/procedure outside of a package, actually works, but
> then you lose access to private data; which is while I used a package.
Did you try changing RS22 from a procedure to a function inside the
package?
--
John Gordon A is for Amy, who fell down the stairs
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | Adeoluwa Odein <stratfordtenants@gmail.com> |
|---|---|
| Date | 2011-07-13 14:28 -0700 |
| Message-ID | <65ea5860-caf7-4fc5-ab46-829ce29948d9@y13g2000yqy.googlegroups.com> |
| In reply to | #9442 |
On Jul 13, 5:19 pm, John Gordon <gor...@panix.com> wrote: > In <0730c5fb-3b65-45ce-9cc5-69d639f48...@g2g2000vbl.googlegroups.com> Adeoluwa Odein <stratfordtena...@gmail.com> writes: > > > if you define the function in the execute() method, it works (as seen > > on the page). But this is a stored procedure already residing on the > > DB. A function/procedure outside of a package, actually works, but > > then you lose access to private data; which is while I used a package. > > Did you try changing RS22 from a procedure to a function inside the > package? > > -- > John Gordon A is for Amy, who fell down the stairs > gor...@panix.com B is for Basil, assaulted by bears > -- Edward Gorey, "The Gashlycrumb Tinies" Correction, the previous actually works, and still gives me access to private data. So I will most likely use it. Basically, just call a function, outside a package. It resolves this entire dilemma. Implementing similar program in Perl DBI, works without any problem. Python/Jython seem quite difficult to work with Store Procedures, in my opinion. Thanks a lot.
[toc] | [prev] | [next] | [standalone]
| From | Adeoluwa Odein <stratfordtenants@gmail.com> |
|---|---|
| Date | 2011-07-13 14:28 -0700 |
| Message-ID | <f5f5369b-1138-4318-83af-e9e9e0029980@e21g2000vbz.googlegroups.com> |
| In reply to | #9442 |
On Jul 13, 5:19 pm, John Gordon <gor...@panix.com> wrote: > In <0730c5fb-3b65-45ce-9cc5-69d639f48...@g2g2000vbl.googlegroups.com> Adeoluwa Odein <stratfordtena...@gmail.com> writes: > > > if you define the function in the execute() method, it works (as seen > > on the page). But this is a stored procedure already residing on the > > DB. A function/procedure outside of a package, actually works, but > > then you lose access to private data; which is while I used a package. > > Did you try changing RS22 from a procedure to a function inside the > package? > > -- > John Gordon A is for Amy, who fell down the stairs > gor...@panix.com B is for Basil, assaulted by bears > -- Edward Gorey, "The Gashlycrumb Tinies" The same problem, if done inside a package. I just left it outside a package, and it works.
[toc] | [prev] | [next] | [standalone]
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2011-07-13 17:18 -0400 |
| Message-ID | <mailman.1005.1310591906.1164.python-list@python.org> |
| In reply to | #9434 |
On 7/13/2011 4:33 PM, Adeoluwa Odein wrote: > 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 The jython-users mailing list might be a better place to ask your question. Most people here are CPython users. http://sourceforge.net/mail/?group_id=12867 -- Terry Jan Reedy
[toc] | [prev] | [next] | [standalone]
| From | Adeoluwa Odein <stratfordtenants@gmail.com> |
|---|---|
| Date | 2011-07-13 11:33 -0700 |
| Message-ID | <5f0ba12a-4de1-4032-941e-59f3b6878c4b@y13g2000yqy.googlegroups.com> |
| In reply to | #9423 |
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
> -- Edward Gorey, "The Gashlycrumb Tinies"
I'm new to jython...
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web