Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > SQL Server DBI insert silently fails

Reply
Thread Tools

SQL Server DBI insert silently fails

 
 
Leslie Viljoen
Guest
Posts: n/a
 
      07-28-2006
Hi all

I am having problems when trying to insert records using dbi-0.1.0 on
Windows XP.
I am using the ADO driver to connect to SQL Server, like so:

connectString = "DBI:ADOrovider=SQLOLEDB.1;Data Source=10.0.0.1;User
id=xxxx; password=xxxx;Initial Catalog=DevDB"

I get rows == nil when I run this:

qry = "insert into G2.dbo.Device (IPadress, SerialNumber, VehicleID, " +
"SerialNumberB, Tag1, Tag2, FwVersion, HwVersion) values
(?, ?, ?, ?, ?, ?, ?, ?)"
rows = @database.do(qry, device[:ip], device[:serial],
device[:serial], device[:serial], 0, 0, 0, 0)
print "rows done: "
p rows


..and the record is not inserted. I get no other error response.


The strange thing is that select queries function perfectly, giving me
valid data back.
Any ideas?


Les

 
Reply With Quote
 
 
 
 
Daniel Berger
Guest
Posts: n/a
 
      07-28-2006
Leslie Viljoen wrote:
> Hi all
>=20
> I am having problems when trying to insert records using dbi-0.1.0 on
> Windows XP.
> I am using the ADO driver to connect to SQL Server, like so:
>=20
> connectString =3D "DBI:ADOrovider=3DSQLOLEDB.1;Data =

Source=3D10.0.0.1;User
> id=3Dxxxx; password=3Dxxxx;Initial Catalog=3DDevDB"
>=20
> I get rows =3D=3D nil when I run this:
>=20
> qry =3D "insert into G2.dbo.Device (IPadress, SerialNumber, VehicleID, =

" +
> "SerialNumberB, Tag1, Tag2, FwVersion, HwVersion) values
> (?, ?, ?, ?, ?, ?, ?, ?)"
> rows =3D @database.do(qry, device[:ip], device[:serial],
> device[:serial], device[:serial], 0, 0, 0, 0)
> print "rows done: "
> p rows
>=20
>=20
> ..and the record is not inserted. I get no other error response.
>=20
>=20
> The strange thing is that select queries function perfectly, giving me
> valid data back.
> Any ideas?
>=20
>=20
> Les
>=20


Did you commit after inserting?

- Dan


This communication is the property of Qwest and may contain confidential =
or
privileged information. Unauthorized use of this communication is =
strictly=20
prohibited and may be unlawful. If you have received this communication =

in error, please immediately notify the sender by reply e-mail and =
destroy=20
all copies of the communication and any attachments.

 
Reply With Quote
 
 
 
 
Leslie Viljoen
Guest
Posts: n/a
 
      07-28-2006
On 7/28/06, Daniel Berger <(E-Mail Removed)> wrote:
> Leslie Viljoen wrote:
> > Hi all
> >
> > I am having problems when trying to insert records using dbi-0.1.0 on
> > Windows XP.
> > I am using the ADO driver to connect to SQL Server, like so:
> >
> > connectString = "DBI:ADOrovider=SQLOLEDB.1;Data Source=10.0.0.1;User
> > id=xxxx; password=xxxx;Initial Catalog=DevDB"
> >
> > I get rows == nil when I run this:
> >
> > qry = "insert into G2.dbo.Device (IPadress, SerialNumber, VehicleID, " +
> > "SerialNumberB, Tag1, Tag2, FwVersion, HwVersion) values
> > (?, ?, ?, ?, ?, ?, ?, ?)"
> > rows = @database.do(qry, device[:ip], device[:serial],
> > device[:serial], device[:serial], 0, 0, 0, 0)
> > print "rows done: "
> > p rows
> >
> >
> > ..and the record is not inserted. I get no other error response.
> >
> >
> > The strange thing is that select queries function perfectly, giving me
> > valid data back.
> > Any ideas?
> >
> >
> > Les
> >

>
> Did you commit after inserting?


You were right! I didn't realise that some databases don't commit automatically!
I'm really grateful for your help.

Les

 
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
SwingWorker.execute() silently fails? Ben Phillips Java 3 10-09-2008 12:55 AM
How to update the sql query data in the background silently? WuBin ASP .Net 2 08-21-2008 06:04 PM
Perl script fails silently at start, can't debug Jon Hendry Perl Misc 5 03-07-2007 11:41 PM
Installshield setup silently fails do to bloated environment Joel Rubin Computer Support 0 07-18-2005 10:48 PM
JSP silently fails to compile Ronald Fischer Java 9 10-21-2003 08:27 PM



Advertisments