From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Greg Aiken Sent: 11 May 2012 01:15 To: Perl-Win32-Users@listserv.activestate.com Subject: dbd-anydata - i cant get it to INSERT new records
> dear win32 perl users, ... > use DBI; > use DBD::AnyData; > > my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):'); > > > #i am trying to insert new record to an existing tab delimited file > #'oldfile.txt' is an ascii encoded two line file: > #FIELD1\tFIELD2\n > #abc\tdef\n > > $dbh->func('insertnewrecstooldfile', 'Tab', 'oldfile.txt', 'ad_import'); > > > > #test 1 - attempt using DO with hard-coded 'values' > > #$return1 = $dbh->do("INSERT INTO insertnewrecstooldfile (FIELD1,FIELD2) > VALUES ('ghi', 'jkl')"); > #print "return1 = $return1\n"; > #$dbh->disconnect; > #exit; > > #result: returns 1, but the file does NOT contain the new record! >From a quick look at the documentation ('perldoc DBD::AnyData'), it looks like >you are creating an in memory table with ad_import, but I can see no sign of >the updated table being saved with ad_export. Possibly ad_catalog would do >what you want. [N.B. I haven't used DBD::AnyData, but it looks interesting. Thanks for the pointer.] HTH -- Brian Raven Please consider the environment before printing this e-mail. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs