On 28 Ιούν, 17:51, Jeremy Evans <[email protected]> wrote:
> On Jun 28, 3:45 am, vtypal <[email protected]> wrote:
>
> > Ideally the actions insert/update/delete should be followed by a
> > `commit' command on oracle db to permanently apply changes. As far as
> > i know ruby-oci8 driver by default has autocommit boolean property as
> > false.
> > There is some way to enable autocommit from my ruby code (via sequel),
> > without altering the defaults of ruby-oci8?
>
> The Sequel oracle adapter sets autocommit = true, so that it behaves
> like other adapters.  If you want to group a series of statements in a
> single transaction, you have to use Database#transaction.

Tested. With DB.run() autocommit is enabled, but with DB#[] autocommit
does not apply.

> > And one more question. There is some way to execute a series of
> > semicolon-separated raw sql statements ?   for example
> > DB = Sequel.connect('oracle://schema1:[email protected]:1521/MYDB')
> > DB['select * from admin_sec_user_account where user_id = 5; 'update
> > admin_sec_user_account set email_address = '[email protected]' where
> > user_id = 2']
> > Executing the second sql statement will complain about the
> > intermediate semicolon divisor.
>
> That requires parsing SQL, something Sequel does not do.  If the
> adapter does not natively support taking multiple statements, you'll
> have to split the statements yourself.  You could try using
> Database#run instead of Database#[] to execute multiple statements.
> I'm not sure if it will make a difference, though.
>
DB.run() will not work either. But it's ok. Splitting is quite easy,
and sequel rocks!


Thank you Jeremy.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to