Re: mysql_insert_id and transactions
Jason Hall wrote: allrighty, here is the trouble I'm having. I'm tyring to do a transaction in mysql/innodb in perl with the following basic flow eval{ Insert my first record get the insert_id (using $sth-{mysql_insert_id}) try using $sth-{mysql_insertid}, no '_id'. This works for us. keith -- - Keith Clay, [EMAIL PROTECTED] Lead Programmer, Web Integration and Programming 286 Adams Center for Teaching Excellence Abilene Christian University Abilene, TX 79699 (915) 674-2187 (915) 674-2834 -
Re: merant / ODBC - DBI/DBD
Mitsuda, Alex wrote: You can do this using DBD::Sybase Library and DBI as long as the SQLServer7 has most uptodate patch, without having to use Merant/ODBC solution. Though I'm not sure how the DBD::Sybase install will go without actually having Sybase on the box... It works great as long as you have the freetds (I'm using 0.51) and the 0.91 version of DBD::Sybase. The newest version will NOT work. Once you set up your interfaces file in freetds and everything is compiled and installed, it works like a charm. keith -- - Keith Clay, [EMAIL PROTECTED] Lead Programmer, Web Integration and Programming 286 Adams Center for Teaching Excellence Abilene Christian University Abilene, TX 79699 (915) 674-2187 (915) 674-2834 -
RE: unixODBC and FreeTDS to MS SQL Server.
You have you use version 0.91 of DBD::Sybase to connect to a mysql server. I am using Freetds version 0.51. This setup works fine and no odbc driver is needed just DBD::Sybase. keith _ Keith A. Clay, [EMAIL PROTECTED] Abilene Christian University Lead Programmer, Web Integration and Programming 286 Adams Center for Teaching Excellence (915) 674-2187 (915) 674-2834 (fax) _ ...continue to walk like that One walked... -Original Message- From: Jeff Urlwin [mailto:[EMAIL PROTECTED]] Sent: Friday, October 26, 2001 7:48 PM To: Amit Gandre; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: unixODBC and FreeTDS to MS SQL Server. Well, I'm not especially solid on the FreeTDS. I did not realize that FreeTDS supplied an ODBC driver. I thought that FreeTDS was to be used with DBD::Sybase to talk to SQL Server. Jeff Hi I am having problems working with the DBD::ODBC driver. I am using unixODBC and FreeTDS connecting to MS SQL Server. They work well together and I have tested it. THe problem comes when I try to use Perl DBD::ODBC (version 0.28). So, I know my DSN entery is ok. This is the code (5 lines) and the Error I get. CAn you please tell me why this may happen? I have tried searching for a week now. #!/usr/bin/perl use DBI; use DBD::ODBC; my $DSN ='driver={myserver};hostname=x.y.x;port=200;database=X;uid=x;pwd=x;'; my $dbh= DBI-connect(dbi::ODBC:$DSN) or die $DBI::errstr\n; The error I get is DBI-connect() failed:[unixODBC][Drver Manager] Data source name not found, and no default driver specified (SQL-IM002). I have set the $DBI_DSN variable to dbi:odbc:myserver I know the unixODBC and the free TDS have been installed right. Can you help me with this? Thanks Amit
info from DBI trace
Folks, Now that I figured out the data problem, how do I obtain the following information from DBI? Thamks. keith -- - Keith Clay, [EMAIL PROTECTED] Lead Programmer, Web Integration and Programming 286 Adams Center for Teaching Excellence Abilene Christian University Abilene, TX 79699 (915) 674-2187 (915) 674-2834 - dbd_st_prepare'd sql f2669392 select * from table1 - prepare= DBI::st=HASH(0x106388) at /usr/local/lib/perl5/site_perl/5.6.1/Acu/EclassDb.pm line 79 - execute for DBD::ODBC::st (DBI::st=HASH(0x106388)~0xfe834) dbd_st_execute (for sql f2669392 after)... dbd_describe sql 2669392: num_fields=4 col 1: VARBINARY len= 8 disp= 17, prec= 8 scale=0 col 2: VARCHAR len= 51 disp= 51, prec= 50 scale=0 col 3: VARCHAR len= 51 disp= 51, prec= 50 scale=0 col 4: INTEGER len= 4 disp= 12, prec= 10 scale=0 col 1: 'id' sqltype=VARBINARY, ctype=SQL_C_BINARY, maxlen=17 col 2: 'lname' sqltype=VARCHAR, ctype=SQL_C_CHAR, maxlen=51 col 3: 'fname' sqltype=VARCHAR, ctype=SQL_C_CHAR, maxlen=51 col 4: 'age' sqltype=INTEGER, ctype=SQL_C_CHAR, maxlen=12
Re: Encrypted data via dbi into postgres
We upload jpegs using bind parameters into mysql using the following: $stmt=replace into mytable (fld1,bfld1) values ('fld1',?); $sth=$dbh-prepare($stmt); $sth-execute($var_with_binary_data); James D. White wrote: 7384998737264839 when encrypted by Crypt::Twofish would look like qþÕ*¨Ñ?.'¿Ò?½ -- - Keith Clay, [EMAIL PROTECTED] Lead Programmer, Web Integration and Programming 286 Adams Center for Teaching Excellence Abilene Christian University Abilene, TX 79699 (915) 674-2187 (915) 674-2834 -
Error retrieving data from MS_SQL from solaris
Folks, Here is the DBI trace of trying to get data from an MS-SQL Database from solaris8. Note that it gets the field names, but no data. keith DBI::db=HASH(0x109d64) trace level set to 9 in DBI 1.19-nothread Note: perl is running without the recommended perl -w option - prepare for DBD::ODBC::db (DBI::db=HASH(0x109e24)~0x109d64 'select * from table1') dbih_setup_handle(DBI::st=HASH(0x109e60)=DBI::st=HASH(0x190fa4), DBD::ODBC::st, 109e9c, Null!) dbih_make_com(DBI::db=HASH(0x109d64), DBD::ODBC::st, 164) dbih_setup_attrib(DBI::st=HASH(0x190fa4), Err, DBI::db=HASH(0x109d64)) SCALAR(0x10542c) (already defined) dbih_setup_attrib(DBI::st=HASH(0x190fa4), State, DBI::db=HASH(0x109d64)) SCALAR(0x105474) (already defined) dbih_setup_attrib(DBI::st=HASH(0x190fa4), Errstr, DBI::db=HASH(0x109d64)) SCALAR(0x105450) (already defined) dbih_setup_attrib(DBI::st=HASH(0x190fa4), Handlers, DBI::db=HASH(0x109d64)) ARRAY(0x109de8) (already defined) dbih_setup_attrib(DBI::st=HASH(0x190fa4), Debug, DBI::db=HASH(0x109d64)) 9 (already defined) dbih_setup_attrib(DBI::st=HASH(0x190fa4), FetchHashKeyName, DBI::db=HASH(0x109d64)) 'NAME' (already defined) dbd_st_prepare'd sql f2649272 select * from table1 - prepare= DBI::st=HASH(0x109e60) at /usr/local/lib/perl5/site_perl/5.6.1/Acu/EclassDb.pm line 85 - execute for DBD::ODBC::st (DBI::st=HASH(0x109e60)~0x190fa4) dbd_st_execute (for sql f2649272 after)... dbd_describe sql 2649272: num_fields=4 col 1: VARBINARY len= 8 disp= 17, prec= 8 scale=0 col 2: VARCHAR len= 51 disp= 51, prec= 50 scale=0 col 3: VARCHAR len= 51 disp= 51, prec= 50 scale=0 col 4: INTEGER len= 4 disp= 12, prec= 10 scale=0 col 1: 'id' sqltype=VARBINARY, ctype=SQL_C_BINARY, maxlen=17 col 2: 'lname' sqltype=VARCHAR, ctype=SQL_C_CHAR, maxlen=51 col 3: 'fname' sqltype=VARCHAR, ctype=SQL_C_CHAR, maxlen=51 col 4: 'age' sqltype=INTEGER, ctype=SQL_C_CHAR, maxlen=12 - execute= -1 at /usr/local/lib/perl5/site_perl/5.6.1/Acu/EclassDb.pm line 92 - rows for DBD::ODBC::st (DBI::st=HASH(0x109e60)~0x190fa4) - rows= -1 at /usr/local/lib/perl5/site_perl/5.6.1/Acu/EclassDb.pm line 98 - FETCH for DBD::ODBC::st (DBI::st=HASH(0x190fa4)~INNER 'NAME') - FETCH= [ 'id' 'lname' 'fname' 'age' ] at /usr/local/lib/perl5/site_perl/5.6.1/Acu/EclassDb.pm line 99 - DESTROY for DBD::ODBC::st (DBI::st=HASH(0x190fa4)~INNER) - DESTROY= undef at /usr/local/lib/perl5/site_perl/5.6.1/Acu/Eclass.pm line 434 - $DBI::err (*) FETCH from lasth=DBI::db=HASH(0x109d64) - err= undef - $DBI::err (*) FETCH from lasth=DBI::db=HASH(0x109d64) - err= undef - disconnect for DBD::ODBC::db (DBI::db=HASH(0x109e24)~0x109d64) - disconnect= 1 at /usr/local/lib/perl5/site_perl/5.6.1/Acu/EclassDb.pm line 125 - DESTROY for DBD::ODBC::db (DBI::db=HASH(0x109d64)~INNER) - DESTROY= undef during global destruction 0:No records found: ROWS: -- - Keith Clay, [EMAIL PROTECTED] Lead Programmer, Web Integration and Programming 286 Adams Center for Teaching Excellence Abilene Christian University Abilene, TX 79699 (915) 674-2187 (915) 674-2834 -