DBI:ODBC-Question

O

Oliver Osterholz

<html><style>p {margin: 0px}</style><body style='font-size:9pt; font-family:Verdana; font-family: Verdana' ><P>Hi, </P><P>I'm trying to execute a prepared statement several times:</P><P>dbh=DBI.connect("dbi:ODBC:TESTDB", "test", "test")</P><P>sth=dbh.prepare("select * from z_da where entitaet_c = ?")</P><P>sth.execute("egpa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ")</P><P>sth.execute("kbpa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ")</P><P>On the second execute i get the Message:</P><FONT color=#0000ff size=2><P>DBI::DatabaseError: S1010 (0) [Oracle][ODBC]Function sequence error.</P><P>D:/Programme/ruby/lib/ruby/site_ruby/1.8/DBD/ODBC/ODBC.rb:204:in `execute'</P><P>D:/Programme/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:743:in `execute'</P></FONT><P>Does anybody know what's wrong here? I guess I miss something important.</P><P>Another problem is that since the db-field entitaet_c is!
defined as char(20) I have to write</P><P>sth.execute("egpa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ") to get results. I didn't expect that since this works fine:</P><P>dbh.execute("select * from z_da where entitaet_c='egpa'")</P><P>thank you for your help</P><P>Oliver</P></body></html>
______________________________________________________________________________<br>WEB.DE FreeMail wird 5 Jahre jung! Feiern Sie mit uns und<br>nutzen Sie die neuen Funktionen <A HREF="http://f.web.de/features/?mc=021130"><B>http://f.web.de/features/?mc=021130</B></A>
 

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
473,754
Messages
2,569,526
Members
44,997
Latest member
mileyka

Latest Threads

Top