[gnome-db] Parameter specification into SQL Query



Hello,

 

How should I specify ‘paramters’ in a Gda::Command ?

 

I’ve got the following (in Ruby)

 

@update_user = Gda::Command.new( “UPDATE GARGOYLE.GRGL_USERS SET LOGIN=$1, NAME=$2, EMAIL=$3”

                             , Gda::Command::TYPE_SQL

                             , Gda::Command::OPTION_STOP_ON_ERRORS )

 

And then, later, I would like to write something like

 

Dsn_connection.begin_transaction( toto = Gda::Transaction.new( ‘toto’ ) )

Dsn_connection.execute_single_command( @update_user,

      Gda::ParameterList.new(

            Gda::Parameter.new( ‘$1’ , <value to substitute $1 into @update_user> ),

            Gda::Parameter.new( ‘$2’ , <value to substitute $2 into @update_user> ),

            Gda::Parameter.new( ‘$3’ , <value to substitute $3 into @update_user> ) ) )

Dsn_connection.commit_transaction( toto )

 

Thanks

 

Marzullo Laurent

Atos Origin - Gestion de Configuration

mail: laurent marzullo atosorigin com

Tél: 01 44 (44 55 54)

 

 

 

Marzullo Laurent

Atos Origin - Gestion de Configuration

mail: laurent marzullo atosorigin com

Tél: 01 44 (44 55 54)

 

*********************************
This message and any attachments (the "message") are confidential and intended solely for the addressees. Any unauthorised
use or dissemination is prohibited.
Messages are susceptible to alteration. France Telecom Group shall not be liable for the message if altered, changed or
falsified.
If you are not the intended addressee of this message, please cancel it immediately and inform the sender.
********************************


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]