sql - INSERT failed because the following SET options have incorrect setting only in Perl Sybase -
i have following perl script:
use strict; use warnings; use dbi; $db_connect = 'dbi:sybase:server=10.2.2.2\catdb;charset=utf8;database=dev'; $db_username = "*****"; $db_password = "*****"; $dbh = dbi->connect($db_connect, $db_username, $db_password,{ raiseerror => 1, printerror => 1, autocommit => 1, syb_chained_txn => 0, syb_enable_utf8 => 1 } ) || die "failed connect boris database: $dbi::errstr\n"; $insertcontractsql2 = ' begin declare @contractid int update dbo.sequences set nextcontractid = nextcontractid + 1 set @contractid = (select nextcontractid dbo.sequences) set ansi_null_dflt_on, ansi_nulls, ansi_padding, ansi_warnings, arithabort, concat_null_yields_null, quoted_identifier on set ansi_null_dflt_off, arithignore, cursor_close_on_commit, implicit_transactions, nocount, numeric_roundabort, xact_abort off insert dbo.contracts (contractid ,modifieddate ,franchiseid ,familyid ,educatorid ,startdate ,enddate ,contracttypeid ,payrate1 ,payrate2 ,payrate3 ,payrate1hours ,payrate2hours ,payrate3hours ,wageadmincontractorrate ,porsecontributioncontractorrate ,wageadminamount ,accamount ,porsecontributionamount ,winzsubsidyamount ,winzsubsidyamountchildcareoscar ,accinvoicedperquarteramount ,familyapamount ,otherfortnightpayment ,otherfortnightpaymentdesc ,referralagencyid ,nextappraisaldate ,nextappraisaltypeid ,pendingapproval ,active ,modifiedby ,beingedited ,moenetworkid ,newflag ,receiveddate ,freeeceamount ,optionalchargerate ,optionalchargeagreement ,terminationapproved ,agreeddeductions ,payrateece ,payrateecehours ,preececlarity ,totaloptionalcharges ,nonchildporsecontributionamount ,freeecetopup ,donation ,nonchildwinzchildcareamount ,manuallyterminated ,contractduplicatedflag ,createdate ,rosteredcontractid) values ( @contractid ,getdate() ,63,22901,9134,\'2014-06-03 00:00:00.0\',\'2014-06-28 00:00:00.0\',2,0,0,0,5,0,0,4.75,0,0,0,0,0,0,0,0,0,null,null,null,null,0,1,\'admin\',1,null,0,\'2014-06-10 00:00:00.0\',0,0,0,0,null,0,0,0,0,0,0,0,0,0,0,\'2014-06-03 15:30:15.037\',4) end '; $dbh->do($insertcontractsql2);
when runs get:
/usr/bin/perl test.pl dbd::sybase::db failed: server message number=1934 severity=16 state=1 line=10 server=bobster\bobster1 text=insert failed because following set options have incorrect settings: 'ansi_nulls, concat_null_yields_null, ansi_warnings, ansi_padding'. verify set options correct use indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or xml data type methods and/or spatial index operations. @ test.pl line 89.
now lousy question know. have run same query via 3 different guis sql server , don't error. have gone through first 3 or 4 pages of google results, , have gotten nowhere. information appreciated.
note: assume because query runs in other tools set options correct
please refer this link may need set order create table persisted, computed column, following connection settings must enabled:
set ansi_nulls on set ansi_padding on set ansi_warnings on set arithabort on set concat_null_yields_null on set numeric_roundabort on set quoted_identifier on
you can set $sth->do() method or isql. need execute them first after connect db, before executing "select", "update" or other command.
Comments
Post a Comment