PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > Ruby DBI class
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Ruby DBI class

Réponse
 
LinkBack Outils de la discussion
Vieux 09/06/2008, 18h28   #1
tcfodor@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Ruby DBI class

Hi all!

I'm using the Ruby DBI class to create connections to both a MSSQL and
an Oracle database to verify the data migration between them is
successful. My test works fine on XP, but on Vista (currently with
SP1, but my problem has always happened on Vista), I get a
segmentation fault when I perform my first select statement on the
Oracle database. Select statements are performed against the MSSQL
database prior to the Oracle database and work fine. I'm running the
test from a command prompt that has administrator privileges.

- Here's my Oracle connection:

@ora_connect = DBI.connect("DBI:ADO:Provider=OraOLEDB.Oracle;Data
Source=devserver;User Id=read_all;Password=password")


- Here is my method for running a select statement:

def getDBValue(connection, query, id1, *id2)
dbi_query = connection.prepare(query)
dbi_query.execute(id1, *id2)
#fetch the result
return dbi_query.fetch
end


- Here is the first Oracle select statement:

createDateTime = getDBValue(@ora_connect, "SELECT CREATED_TIME FROM
ORATEST.POLICY WHERE POLICYNUM = ?", policyNumber)


- Here is the error message I get:

c:/ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb:94: [BUG] Segmentation
fault ruby 1.8.6 (2007-03-13) [i386-mswin32]


Has anyone else seen this? Does anyone have any ideas on workarounds
or how to fix it?

Thanks in advance for your !

-Tiffany
  Réponse avec citation
Vieux 09/06/2008, 20h35   #2
Daniel Berger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby DBI class



On Jun 9, 11:33=A0am, tcfo...@gmail.com wrote:
> Hi all!
>
> I'm using the Ruby DBI class to create connections to both a MSSQL and
> an Oracle database to verify the data migration between them is
> successful. =A0My test works fine on XP, but on Vista (currently with
> SP1, but my problem has always happened on Vista), I get a
> segmentation fault when I perform my first select statement on the
> Oracle database. =A0Select statements are performed against the MSSQL
> database prior to the Oracle database and work fine. =A0I'm running the
> test from a command prompt that has administrator privileges.
>
> - Here's my Oracle connection:
>
> @ora_connect =3D DBI.connect("DBI:ADO:Provider=3DOraOLEDB.Oracle;Da ta
> Source=3Ddevserver;User Id=3Dread_all;Password=3Dpassword")
>
> - Here is my method for running a select statement:
>
> def getDBValue(connection, query, id1, *id2)
> =A0 =A0 dbi_query =3D connection.prepare(query)
> =A0 =A0 dbi_query.execute(id1, *id2)
> =A0 =A0 #fetch the result
> =A0 =A0 return dbi_query.fetch
> end
>
> - Here is the first Oracle select statement:
>
> createDateTime =3D getDBValue(@ora_connect, "SELECT CREATED_TIME FROM
> ORATEST.POLICY WHERE POLICYNUM =3D ?", policyNumber)
>
> - Here is the error message I get:
>
> c:/ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb:94: [BUG] Segmentation
> fault ruby 1.8.6 (2007-03-13) [i386-mswin32]
>
> Has anyone else seen this? =A0Does anyone have any ideas on workarounds
> or how to fix it?
>
> Thanks in advance for your !


What version of Ruby and DBI are you using? Line 94 of my ADO.rb file
is just a comment. Can you paste that line at least?

Thanks,

Dan

  Réponse avec citation
Vieux 09/06/2008, 23h30   #3
tcfodor@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Ruby DBI class

On Jun 9, 1:35 pm, Daniel Berger <djber...@gmail.com> wrote:
> On Jun 9, 11:33 am, tcfo...@gmail.com wrote:
>
>
>
> > Hi all!

>
> > I'm using the Ruby DBI class to create connections to both a MSSQL and
> > an Oracle database to verify the data migration between them is
> > successful. My test works fine on XP, but on Vista (currently with
> > SP1, but my problem has always happened on Vista), I get a
> > segmentation fault when I perform my first select statement on the
> > Oracle database. Select statements are performed against the MSSQL
> > database prior to the Oracle database and work fine. I'm running the
> > test from a command prompt that has administrator privileges.

>
> > - Here's my Oracle connection:

>
> > @ora_connect = DBI.connect("DBI:ADO:Provider=OraOLEDB.Oracle;Data
> > Source=devserver;User Id=read_all;Password=password")

>
> > - Here is my method for running a select statement:

>
> > def getDBValue(connection, query, id1, *id2)
> > dbi_query = connection.prepare(query)
> > dbi_query.execute(id1, *id2)
> > #fetch the result
> > return dbi_query.fetch
> > end

>
> > - Here is the first Oracle select statement:

>
> > createDateTime = getDBValue(@ora_connect, "SELECT CREATED_TIME FROM
> > ORATEST.POLICY WHERE POLICYNUM = ?", policyNumber)

>
> > - Here is the error message I get:

>
> > c:/ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb:94: [BUG] Segmentation
> > fault ruby 1.8.6 (2007-03-13) [i386-mswin32]

>
> > Has anyone else seen this? Does anyone have any ideas on workarounds
> > or how to fix it?

>
> > Thanks in advance for your !

>
> What version of Ruby and DBI are you using? Line 94 of my ADO.rb file
> is just a comment. Can you paste that line at least?
>
> Thanks,
>
> Dan


Sorry about that - I'm using Ruby version 1.8.6 and DBI version 0.1.1

Here's the code around line 94:

90 def execute
91 # TODO: use Command and Parameter
92 # TODO: substitute all ? by the parametes
93 sql = bind(self, @statement, @params)
94 @res_handle = @handle.Execute(sql)
95
96 # TODO: SELECT and AutoCommit finishes the result-set
97 # what to do?
98 if @db['AutoCommit'] == true and not SQL.query?(@statement)
then
99 @db.commit
100 end

101 rescue RuntimeError => err
102 raise DBI:atabaseError.new(err.message)
103 end


Thanks for taking at look at this!

-Tiffany
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h05.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12527 seconds with 11 queries