Banging head against the wall..

G

Graham

Quick question: I just need another set of eyes on this as I cannot see
what is wrong:-
sth = $dbh.prepare("select sal.isid, sal.access_level from
roles_dev.spig_access_list sal, filer_uncs stdy where
stdy.foldertype_qualifier=sal.spig_project and
stdy.foldertype_qualifier=? ")

when executed generates an error of
C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:384:in `parse':
ORA-01003: no statement parsed (DBI::DatabaseError)
from C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:253:in
`initialize'
from C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:124:in `new'
from C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:124:in
`prepare'
from C:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:624:in `prepare'
from U:/Ruby_progs/sync/sync.rb:179

However - if I comment out this block of code, and skip to the next
block of code which reads:
sth = $dbh.prepare("select isid from
table(ldap.find_by_department(?))")

... this works perfectly.
I cannot see any difference here. Can anyone see anything obvious?
Thx
 
R

Robert Klemme

Graham said:
Quick question: I just need another set of eyes on this as I cannot
see what is wrong:-
sth = $dbh.prepare("select sal.isid, sal.access_level from
roles_dev.spig_access_list sal, filer_uncs stdy where
stdy.foldertype_qualifier=sal.spig_project and
stdy.foldertype_qualifier=? ")

when executed generates an error of
C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:384:in `parse':
ORA-01003: no statement parsed (DBI::DatabaseError)
from C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:253:in
`initialize'
from C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:124:in `new'
from C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:124:in
`prepare'
from C:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:624:in `prepare'
from U:/Ruby_progs/sync/sync.rb:179

However - if I comment out this block of code, and skip to the next
block of code which reads:
sth = $dbh.prepare("select isid from
table(ldap.find_by_department(?))")

.. this works perfectly.
I cannot see any difference here. Can anyone see anything obvious?
Thx

Maybe it's not in the SQL put in the process. Do you have any cursors or
whatever open when you issue the #prepare? Also the second SQL looks
quite strange to me. Not that it would explain why the second call works
but is this really valid Oracle SQL?

Kind regards

robert
 
D

Dick Davies

I'd try single quotes - maybe you've getting some sort of variable
interpolation?


Quick question: I just need another set of eyes on this as I cannot see
what is wrong:-
sth =3D $dbh.prepare("select sal.isid, sal.access_level from
roles_dev.spig_access_list sal, filer_uncs stdy where
stdy.foldertype_qualifier=3Dsal.spig_project and
stdy.foldertype_qualifier=3D? ")
=20
when executed generates an error of
C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:384:in `parse':
ORA-01003: no statement parsed (DBI::DatabaseError)
from C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:253:in
`initialize'
from C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:124:in `= new'
from C:/ruby/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:124:in
`prepare'
from C:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:624:in `prepare'
from U:/Ruby_progs/sync/sync.rb:179
=20
However - if I comment out this block of code, and skip to the next
block of code which reads:
sth =3D $dbh.prepare("select isid from
table(ldap.find_by_department(?))")
=20
... this works perfectly.
I cannot see any difference here. Can anyone see anything obvious?
Thx
=20
=20
=20


--=20
Rasputin :: Jack of All Trades - Master of Nuns
 
G

Graham

GOT IT!.. It was the error message which was confusing me. What Oracle
was trying to say was that I didn't have access (by the user of the
connection) to one of the tables. Once I fixed this - it worked.

In answer to your 2nd part, the table() construct allow me to wrap the
return values of the stored procedure call to an Oracle / LDAP
interface as an anonymous table. Nice construct (no idea if any other
database would support it though)

Thanks for trying to assist... just talking about it helps
Graham
 
R

Robert Klemme

Graham said:
GOT IT!.. It was the error message which was confusing me. What Oracle
was trying to say was that I didn't have access (by the user of the
connection) to one of the tables. Once I fixed this - it worked.

Great! Error messages can be a nuisance sometimes.
In answer to your 2nd part, the table() construct allow me to wrap the
return values of the stored procedure call to an Oracle / LDAP
interface as an anonymous table. Nice construct (no idea if any other
database would support it though)

Ah! Learn something new every day... My guess would be that there is no
other database that supports this. After all it's Oracle. :)
Thanks for trying to assist... just talking about it helps
Graham

You're welcome!

Kind regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,183
Messages
2,570,964
Members
47,511
Latest member
svareza

Latest Threads

Top