[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Error when calling a Oracle Stored Proc

sam944

6/22/2006 8:49:00 PM

Hi,

Can some one tell me why I get this error message when I call my Oracle
Stored Procedure using the DBI Module ? ...

c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `execute': ORA-06550:
line 1, column 7: (DBI::DatabaseError)
PLS-00201: identifier 'MY_TEST.Test_Stored_Proc' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored from
c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `exec'
from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:111:in `do_ocicall'
from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `exec'
from c:/ruby/lib/ruby/site_ruby/1.8/DBD/OCI8/OCI8.rb:162:in
`execute'
from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:777:in `execute'
from C:/dev/ruby/progs/dbi/test_storeproc.rb:11
from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:629:in `prepare'
from C:/dev/ruby/progs/dbi/test_storeproc.rb:7

My ruby code is as follows...

require "dbi"

dbh = DBI.connect('DBI:OCI8:SAMDEV.WORLD', 'username, 'password')

p1 = "Jtxy"

dbh.prepare("BEGIN MY_TEST.Test_Stored_Proc'(?,?); END;") do |sth|
sth.bind_param(1, p1)
po_resultString = ' ' * 256
sth.bind_param(2, resultStr)
sth.execute
while true
sth.execute
#puts sth.func(:bind_value, 2)
end
end

Param #1 'p1' is a string IN param and Param2 ('resultStr') is a
VARCHAR2 OUT Param

It would be very helpful if someone could tell me what I am doing wrong
in my script

Many Thanks,

Sam

7 Answers

Robert Klemme

6/22/2006 9:22:00 PM

0

sam944 wrote:
> Hi,
>
> Can some one tell me why I get this error message when I call my Oracle
> Stored Procedure using the DBI Module ? ...
>
> c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `execute': ORA-06550:
> line 1, column 7: (DBI::DatabaseError)
> PLS-00201: identifier 'MY_TEST.Test_Stored_Proc' must be declared
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignored from

Are you sure this SP does exist? Did you maybe create the SP with
another user than the one you use from your script?

> c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `exec'
> from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:111:in `do_ocicall'
> from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `exec'
> from c:/ruby/lib/ruby/site_ruby/1.8/DBD/OCI8/OCI8.rb:162:in
> `execute'
> from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:777:in `execute'
> from C:/dev/ruby/progs/dbi/test_storeproc.rb:11
> from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:629:in `prepare'
> from C:/dev/ruby/progs/dbi/test_storeproc.rb:7
>
> My ruby code is as follows...
>
> require "dbi"
>
> dbh = DBI.connect('DBI:OCI8:SAMDEV.WORLD', 'username, 'password')
>
> p1 = "Jtxy"
>
> dbh.prepare("BEGIN MY_TEST.Test_Stored_Proc'(?,?); END;") do |sth|

There seems to be a single quote too much in this line.

> sth.bind_param(1, p1)
> po_resultString = ' ' * 256
> sth.bind_param(2, resultStr)
> sth.execute
> while true
> sth.execute
> #puts sth.func(:bind_value, 2)
> end
> end
>
> Param #1 'p1' is a string IN param and Param2 ('resultStr') is a
> VARCHAR2 OUT Param
>
> It would be very helpful if someone could tell me what I am doing wrong
> in my script

An alternative would be to use "CALL":

dbh.prepare("CALL MY_TEST.Test_Stored_Proc(?,?)") do |sth|

HTH

Kind regards

robert

sam944

6/22/2006 9:29:00 PM

0

Hi Robert

Thanks for your suggestion.

Unfortunately, It does not work for me eiather and I get this error
message

c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `execute': ORA-06576: not
a valid function or procedure name (DBI::DatabaseError)
from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `exec'
from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:111:in `do_ocicall'
from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `exec'
from c:/ruby/lib/ruby/site_ruby/1.8/DBD/OCI8/OCI8.rb:162:in
`execute'
from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:777:in `execute'
from C:/dev/ruby/progs/dbi/test_storeproc.rb:12
from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:629:in `prepare'
from C:/dev/ruby/progs/dbi/test_storeproc.rb:8

Sam

Robert Klemme wrote:
> sam944 wrote:
> > Hi,
> >
> > Can some one tell me why I get this error message when I call my Oracle
> > Stored Procedure using the DBI Module ? ...
> >
> > c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `execute': ORA-06550:
> > line 1, column 7: (DBI::DatabaseError)
> > PLS-00201: identifier 'MY_TEST.Test_Stored_Proc' must be declared
> > ORA-06550: line 1, column 7:
> > PL/SQL: Statement ignored from
>
> Are you sure this SP does exist? Did you maybe create the SP with
> another user than the one you use from your script?
>
> > c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `exec'
> > from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:111:in `do_ocicall'
> > from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:571:in `exec'
> > from c:/ruby/lib/ruby/site_ruby/1.8/DBD/OCI8/OCI8.rb:162:in
> > `execute'
> > from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:777:in `execute'
> > from C:/dev/ruby/progs/dbi/test_storeproc.rb:11
> > from c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:629:in `prepare'
> > from C:/dev/ruby/progs/dbi/test_storeproc.rb:7
> >
> > My ruby code is as follows...
> >
> > require "dbi"
> >
> > dbh = DBI.connect('DBI:OCI8:SAMDEV.WORLD', 'username, 'password')
> >
> > p1 = "Jtxy"
> >
> > dbh.prepare("BEGIN MY_TEST.Test_Stored_Proc'(?,?); END;") do |sth|
>
> There seems to be a single quote too much in this line.
>
> > sth.bind_param(1, p1)
> > po_resultString = ' ' * 256
> > sth.bind_param(2, resultStr)
> > sth.execute
> > while true
> > sth.execute
> > #puts sth.func(:bind_value, 2)
> > end
> > end
> >
> > Param #1 'p1' is a string IN param and Param2 ('resultStr') is a
> > VARCHAR2 OUT Param
> >
> > It would be very helpful if someone could tell me what I am doing wrong
> > in my script
>
> An alternative would be to use "CALL":
>
> dbh.prepare("CALL MY_TEST.Test_Stored_Proc(?,?)") do |sth|
>
> HTH
>
> Kind regards
>
> robert

Chris Hulan

6/22/2006 9:46:00 PM

0

sam944 wrote:
....
> dbh.prepare("BEGIN MY_TEST.Test_Stored_Proc'(?,?); END;") do |sth|
maybe this quote char is the issue?----------------------^ (between the
proc name and the open bracket)

sam944

6/22/2006 9:50:00 PM

0

I removed the extra quote characted between the procname and open
bracket. I still get the same error..


ChrisH wrote:
> sam944 wrote:
> ...
> > dbh.prepare("BEGIN MY_TEST.Test_Stored_Proc'(?,?); END;") do |sth|
> maybe this quote char is the issue?----------------------^ (between the
> proc name and the open bracket)

sam944

6/22/2006 10:46:00 PM

0

Does anyone have a sample Oracle Stroed Proc they are calling from Ruby
using DBI/OCI8 ?

sam944 wrote:
> I removed the extra quote characted between the procname and open
> bracket. I still get the same error..
>
>
> ChrisH wrote:
> > sam944 wrote:
> > ...
> > > dbh.prepare("BEGIN MY_TEST.Test_Stored_Proc'(?,?); END;") do |sth|
> > maybe this quote char is the issue?----------------------^ (between the
> > proc name and the open bracket)

ti-coune

11/18/2010 12:13:00 AM

0


"nadagami" <nadagami@globetrotter.net> a ?crit dans le message de news:
1be8ac9d-35ba-46db-bedb-cbb25bc2a343@p1g2000yqm.googlegroups.com...
Ma solution : la partition du Qu?bec, avec un parti qui nous
repr?sente ? Qu?bec.



Vote pour Graveline.
--
ti-coune


nadagami

11/18/2010 9:33:00 AM

0

On 17 nov, 19:13, "ti-coune" <ti.co...@alinto.comX> wrote:
> "nadagami" <nadag...@globetrotter.net> a crit dans le message de news:
> 1be8ac9d-35ba-46db-bedb-cbb25bc2a...@p1g2000yqm.googlegroups.com...
> Ma solution : la partition du Qu bec, avec un parti qui nous
> repr sente Qu bec.
>
> Vote pour Graveline.
> --
> ti-coune



Ça nous prend un territoire et ce nous, il est francoq.


nadagami