RE: Clob insert problem on a Oracle db with DBI

2007-01-30 Thread Reidy, Ron
looks like it is missing commas. -- Ron Reidy Lead DBA Array BioPharma, Inc. -Original Message- From: Ron S Cetnar [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 30, 2007 1:10 PM To: dbi-users@perl.org Subject: Clob insert problem on a Oracle db with DBI I have a problem inserting a li

RE: Clob insert problem on a Oracle db with DBI

2007-01-30 Thread Garrett, Philip \(MAN-Corporate\)
Ron S Cetnar wrote: > I have a problem inserting a line of text into a CLOB data field in > Oracle. The version of PERL is 5.8 running on a AIX server 5.2. It > looks like when I'm doing the insert, it is looking at the text to > execute. The text is a sql statement that I'm trying to load. > >

Clob insert problem on a Oracle db with DBI

2007-01-30 Thread Ron S Cetnar
I have a problem inserting a line of text into a CLOB data field in Oracle. The version of PERL is 5.8 running on a AIX server 5.2. It looks like when I'm doing the insert, it is looking at the text to execute. The text is a sql statement that I'm trying to load. Any help would be greatly appre

Re: MySQL INSERT problem...

2004-09-17 Thread Hardy Merrill
I know you said the problem column is an enum column, but can you copy and paste in a "describe" of the table in question(acct_hist)? I've never used an "enum" column so I'm not sure I'll be any help, but a describe might help jog someones memory. Hardy Merrill >>> "NIPP, SCOTT V (SBCSI)" <[EMAI

MySQL INSERT problem...

2004-09-16 Thread NIPP, SCOTT V \(SBCSI\)
I have a database that I am working on a Perl script for to manage. Basically, this is a database of user accounts on about 80 Unix boxes. Most of it is working great, but I have one problem with the two of the INSERTs. The INSERTs are putting data into a history table such that we can m

RE: SQL- Insert problem

2004-08-13 Thread Shah, Urmil
dy Merrill Subject: RE: SQL- Insert problem Correct, but he he building dynamic SQL. The resulting insert statement's values clause looks like (v1,v1,,v4...); the problem is the ",,". This is why I suggested to use bind variables. - Ron Reidy Senior DBA Array BioPha

RE: SQL- Insert problem

2004-08-13 Thread Reidy, Ron
From: amonotod [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 2:04 PM To: [EMAIL PROTECTED] Cc: Ronald J Kimball; 'Hardy Merrill' Subject: RE: SQL- Insert problem > From: "Ronald J Kimball" <[EMAIL PROTECTED]> > Date: 2004/08/13 Fri PM 05:59:39 GMT >

RE: SQL- Insert problem

2004-08-13 Thread amonotod
> From: "Ronald J Kimball" <[EMAIL PROTECTED]> > Date: 2004/08/13 Fri PM 05:59:39 GMT > > Hardy Merrill [mailto:[EMAIL PROTECTED] wrote: > > > > Just in case the op doesn't make the connection, he needs to test his > > variables for undef before the execute, and if one is undef, then put > > Why

RE: SQL- Insert problem

2004-08-13 Thread Reidy, Ron
See below ... - Ron Reidy Senior DBA Array BioPharma, Inc. 303.386.1480 -Original Message- From: Shah, Urmil [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 1:49 PM To: [EMAIL PROTECTED] Subject: RE: SQL- Insert problem Here is the code if it helps. I

RE: SQL- Insert problem

2004-08-13 Thread amonotod
me PK and unique value constraints.       Urmil   -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 2:06 PM To: Shah, Urmil; Kong, Alan; [EMAIL PROTECTED] Subject: RE: SQL- Insert problem   See below ...   - Ron Reid

RE: SQL- Insert problem

2004-08-13 Thread Shah, Urmil
constraints.       Urmil   -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 2:06 PM To: Shah, Urmil; Kong, Alan; [EMAIL PROTECTED] Subject: RE: SQL- Insert problem   See below ...   - Ron Reidy Senior D

Re: SQL- Insert problem

2004-08-13 Thread amonotod
> From: amonotod <[EMAIL PROTECTED]> > Date: 2004/08/13 Fri PM 07:29:35 GMT > Note that I tested with MSSQL, but Well, yes, I did test with MSSQL, but as you can see from the DBI connection string, I also tested with Oracle 9i... :-) amonotod -- `\|||/ amonotod@| sun|perl|w

Re: SQL- Insert problem

2004-08-13 Thread amonotod
> From: "Shah, Urmil" <[EMAIL PROTECTED]> > Date: 2004/08/13 Fri PM 04:42:54 GMT > Need help in trying to insert an sql statement. As everyone else has been saying, you need to use placeholders. See my script below... Note that I tested with MSSQL, but > Regards, > Urmil Regards, amonotod

RE: SQL- Insert problem

2004-08-13 Thread Reidy, Ron
See below ... - Ron Reidy Senior DBA Array BioPharma, Inc. 303.386.1480 -Original Message- From: Shah, Urmil [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 1:02 PM To: Reidy, Ron; Kong, Alan; [EMAIL PROTECTED] Subject: RE: SQL- Insert problem Ok Here is

Re: SQL- Insert problem

2004-08-13 Thread Chris Sarnowski
query.pl line 354. <- DESTROY= undef -> DESTROY for DBD::Oracle::db (DBI::db=HASH(0x49ea08)~INNER) <- DESTROY= undef during global destruction Regards, Urmil -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 12:16 PM To: Kong, Alan; Sh

RE: SQL- Insert problem

2004-08-13 Thread Hardy Merrill
>>> "Ronald J Kimball" <[EMAIL PROTECTED]> 08/13/04 01:59PM >>> Hardy Merrill [mailto:[EMAIL PROTECTED] wrote: > > Just in case the op doesn't make the connection, he needs to test his > variables for undef before the execute, and if one is undef, then put > null("") in it, something like this:

RE: SQL- Insert problem

2004-08-13 Thread Ronald J Kimball
Hardy Merrill [mailto:[EMAIL PROTECTED] wrote: > > Just in case the op doesn't make the connection, he needs to test his > variables for undef before the execute, and if one is undef, then put > null("") in it, something like this: > > if (!defined($a)) {$a = "";} > if (!defined($b)) {$

RE: SQL- Insert problem

2004-08-13 Thread Reidy, Ron
A for this). - Ron Reidy Senior DBA Array BioPharma, Inc. 303.386.1480 -Original Message- From: Shah, Urmil [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 11:29 AM To: Reidy, Ron; Kong, Alan; [EMAIL PROTECTED] Subject: RE: SQL- Insert problem Ok I tried to use method 3 and as

RE: SQL- Insert problem

2004-08-13 Thread Hardy Merrill
il [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 11:07 AM To: Reidy, Ron; [EMAIL PROTECTED] Subject: RE: SQL- Insert problem I tried to use different methods to insert but all fails. 1) $sth=$dbh->prepare(insert into OPER_QUERY values ($a,$b,$c,$d) ) $sth->execute() o

RE: SQL- Insert problem

2004-08-13 Thread Shah, Urmil
ESTROY= undef -> DESTROY for DBD::Oracle::db (DBI::db=HASH(0x49ea08)~INNER) <- DESTROY= undef during global destruction Regards, Urmil -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 12:16 PM To: Kong, Alan; Shah, Urmil; [EMAIL PROTE

RE: SQL- Insert problem

2004-08-13 Thread Reidy, Ron
He should use bind variables (method 3). - Ron Reidy Senior DBA Array BioPharma, Inc. -Original Message- From: Kong, Alan [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 11:13 AM To: Shah, Urmil; Reidy, Ron; [EMAIL PROTECTED] Subject: RE: SQL- Insert problem

RE: SQL- Insert problem

2004-08-13 Thread Kong, Alan
Try the mothed 2 with non-numeric fields single-quoted. -Original Message- From: Shah, Urmil [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 1:07 PM To: Reidy, Ron; [EMAIL PROTECTED] Subject: RE: SQL- Insert problem I tried to use different methods to insert but all fails. 1

RE: SQL- Insert problem

2004-08-13 Thread Reidy, Ron
-Original Message- From: Shah, Urmil [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 11:07 AM To: Reidy, Ron; [EMAIL PROTECTED] Subject: RE: SQL- Insert problem I tried to use different methods to insert but all fails. 1) $sth=$dbh->prepare(insert into OPER_QUERY values ($a

RE: SQL- Insert problem

2004-08-13 Thread Shah, Urmil
ther way to insert please let me know. Urmil -Original Message- From: Reidy, Ron [mailto:[EMAIL PROTECTED] Sent: Friday, August 13, 2004 11:57 AM To: Shah, Urmil; [EMAIL PROTECTED] Subject: RE: SQL- Insert problem You have a NULL (not the word NULL) in your statement. FYI - You should lo

RE: SQL- Insert problem

2004-08-13 Thread Reidy, Ron
PROTECTED] Subject: SQL- Insert problem Need help in trying to insert an sql statement. 1) I have 15 columns in oracle database defined. 2) Through Perl DBI I am trying to loop and populate these 15 columns for 'n' of rows. 3) Some of the column values that I am trying to

SQL- Insert problem

2004-08-13 Thread Shah, Urmil
Need help in trying to insert an sql statement. 1) I have 15 columns in oracle database defined. 2) Through Perl DBI I am trying to loop and populate these 15 columns for 'n' of rows. 3) Some of the column values that I am trying to insert is null/empty and it is ok if they

Re: Beginner's insert problem results in unknown column value

2003-10-05 Thread Paul DuBois
is taken to be a column name. John - Original Message - From: "Paul DuBois" <[EMAIL PROTECTED]> To: "jmulkerin" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, October 05, 2003 5:42 PM Subject: Re: Beginner's insert problem results in unknown column val

Re: Beginner's insert problem results in unknown column value

2003-10-05 Thread Colin Wetherbee
jmulkerin said: > I used the placeholders and it works. > Thanks. > I still don't undertand why it didn't work the fisrt time. If you use placeholders, execute() properly quotes the values you pass to it. i.e., A2393 becomes 'A2393' or whatever is appropriate for your flavor of SQL. Colin --

Re: Beginner's insert problem results in unknown column value

2003-10-05 Thread jmulkerin
nt: Sunday, October 05, 2003 5:42 PM Subject: Re: Beginner's insert problem results in unknown column value > At 16:01 -0700 10/5/03, jmulkerin wrote: > >Oh most literate ones, can you tell me what's wrong? > > You didn't quote your data values, so they appear to be > colu

Re: Beginner's insert problem results in unknown column value

2003-10-05 Thread Paul DuBois
At 16:01 -0700 10/5/03, jmulkerin wrote: Oh most literate ones, can you tell me what's wrong? You didn't quote your data values, so they appear to be column references. Use placeholders instead, you'll be happier: my $stmt = qq {INSERT INTO log (Nbr, Bdate, dtime) VALUES (?,?,?)}; my $sth

Beginner's insert problem results in unknown column value

2003-10-05 Thread jmulkerin
Oh most literate ones, can you tell me what's wrong? I get this error: DBD::mysql::st execute failed: Unknown column '0928A' in 'field list' at test3.pl line 20. execute: INSERT INTO log (Nbr, Bdate, dtime) VALUES (123456, 10012003, 0928A): Unknown column '0928A in 'field list' at test

Re: MySQL, DATETIME, bind, insert problem

2003-08-04 Thread Mike Schienle
On Monday, August 4, 2003, at 8:21 AM, Stephen Collyer wrote: Mike Schienle wrote: It wasn't clear to me, and I'm definitely grateful for the code example. I've been converting perl's localtime into a SQL-ish date string and pushing that into the DB. This sounds to me like it's the pointer to O

Re: MySQL, DATETIME, bind, insert problem

2003-08-04 Thread Stephen Collyer
Mike Schienle wrote: On Monday, August 4, 2003, at 8:21 AM, Stephen Collyer wrote: Mike Schienle wrote: It wasn't clear to me, and I'm definitely grateful for the code example. I've been converting perl's localtime into a SQL-ish date string and pushing that into the DB. This sounds to me l

Re: MySQL, DATETIME, bind, insert problem

2003-08-04 Thread Stephen Collyer
Mike Schienle wrote: On Monday, August 4, 2003, at 6:56 AM, Stephen Collyer wrote: Michael A Chase wrote: The function must be in the prepared SQL, the values do not. A common example in Oracle is: $dbh -> {RaiseError} = 1; my $sth = $dbh -> prepare( join "\n", 'INSERT INTO testtable

Re: MySQL, DATETIME, bind, insert problem

2003-08-04 Thread Mike Schienle
On Monday, August 4, 2003, at 6:56 AM, Stephen Collyer wrote: Michael A Chase wrote: The function must be in the prepared SQL, the values do not. A common example in Oracle is: $dbh -> {RaiseError} = 1; my $sth = $dbh -> prepare( join "\n", 'INSERT INTO testtable ( dob, profession, age,

Re: MySQL, DATETIME, bind, insert problem

2003-08-04 Thread Stephen Collyer
Michael A Chase wrote: DBD::mysql is doing what is it supposed to do. 'NOW()' is a 5 character string, not a function. Placeholders pass values, not syntactic elements. Right. This is a distinction I've not seen made in any of the DBI docs, but it's a pretty important one. It's in htt

Re: MySQL, DATETIME, bind, insert problem

2003-08-03 Thread Michael A Chase
On Sun, 03 Aug 2003 09:49:12 + Stephen Collyer <[EMAIL PROTECTED]> wrote: > Michael A Chase wrote: > > >On Sat, 02 Aug 2003 12:32:42 + Stephen Collyer > <[EMAIL PROTECTED]> wrote: >>>2. When @bind_params contains, say, ('NOW()', 'Doctor', 30, 'Bill'), >>>it all goes horribly wrong, and M

Re: MySQL, DATETIME, bind, insert problem

2003-08-03 Thread Stephen Collyer
Michael A Chase wrote: On Sat, 02 Aug 2003 12:32:42 + Stephen Collyer <[EMAIL PROTECTED]> wrote: 2. When @bind_params contains, say, ('NOW()', 'Doctor', 30, 'Bill'), it all goes horribly wrong, and MySQL fails to interpret the 'NOW()' string as an attempt to call a MySQL specific function.

Re: MySQL, DATETIME, bind, insert problem

2003-08-02 Thread Michael A Chase
On Sat, 02 Aug 2003 12:32:42 + Stephen Collyer <[EMAIL PROTECTED]> wrote: > I have a problem binding arbitrary data to a MySQL DATETIME > column during an insert. > > I generate a SQL string like so: > > > INSERT INTO TestTable > (dob, profession, age, name) > VALUES > (?,?,?,?) > > where

MySQL, DATETIME, bind, insert problem

2003-08-02 Thread Stephen Collyer
I have a problem binding arbitrary data to a MySQL DATETIME column during an insert. I generate a SQL string like so: INSERT INTO TestTable (dob, profession, age, name) VALUES (?,?,?,?) where dob is of type DATETIME. This code is prepared and executed like so: $sth = $dbh->prepare($SQL); $result

RE: :ODBC and MSSQL 2000 insert problem (bug report)

2003-01-06 Thread Jeff Urlwin
> Hi, > > my $result; > $result = $dbh->do("INSERT INTO Test (TextCol,DateCol) VALUES > ('hello','20030106 23:48:01:000')"); # always OK > if( $result ) { > print "First INSERT OK.\n"; > } Right. That's because SQL Server is automatically performing the char --> da

DBD::ODBC and MSSQL 2000 insert problem (bug report)

2003-01-06 Thread Jirka Chraska
Hi, I have succesfully setup Linux -> Win2k MSSQL connection via DBI::Proxy. On Win2k I am using MSSQL 2000, DBD::ODBC version 1.01, DBI 1.32. Here is test program running on linux machine: #!/usr/bin/perl -w use DBI; my $dbh = DBI->connect('dbi:Proxy:hostname=sql.kskbono.cz;port=24001;d

Re: Insert Problem...

2002-07-31 Thread Tim Bunce
You can't insert lobs that way at the moment. Do the insert directly and not via PL/SQL. Tim. On Wed, Jul 31, 2002 at 06:55:08PM +0530, Sundarraj, Senthil Kumar (Cognizant) wrote: > The below program fails with the following exception > DBD::Oracle::st execute failed: (DBD ERROR: LOB refetch at

Insert Problem...

2002-07-31 Thread Sundarraj, Senthil Kumar (Cognizant)
The below program fails with the following exception DBD::Oracle::st execute failed: (DBD ERROR: LOB refetch attempted for unsupport ed statement type) at insert_clob.pl (i.e at execute statement) what could be the problem?How to check which version of DBD am using? use DBI; use Oraperl; #use D

Re: Oracle Insert Problem-Urgent

2001-10-17 Thread Michael A Chase
Message - From: "gopinath r" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, October 17, 2001 08:08 Subject: Oracle Insert Problem-Urgent > my problem is to insert a varchar2 datatype which > contains single quote(') into Oracle table from Pe

Re: Oracle Insert Problem-Urgent

2001-10-17 Thread Hardy Merrill
Good point, and maybe even better than that would be to use placeholders. Mark Vandenbroeck [[EMAIL PROTECTED]] wrote: > The more generic solution would be to use DBI's quote function : eg. > > my $st = $db->prepare("insert into Tname values(". > $db->quote("Gopi's") . ", '20')"); > > Hope th

Re: Oracle Insert Problem-Urgent

2001-10-17 Thread Mark Vandenbroeck
The more generic solution would be to use DBI's quote function : eg. my $st = $db->prepare("insert into Tname values(". $db->quote("Gopi's") . ", '20')"); Hope this helps, Mark Hardy Merrill wrote: > I think I remember that to escape a single quote so that you > can include it in a string,

Re: Oracle Insert Problem-Urgent

2001-10-17 Thread Hardy Merrill
I think I remember that to escape a single quote so that you can include it in a string, you need to escape a single quote with a single quote, like this: inset into Tname values('Gopi''s','20'); HTH. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com gopinat

RE: Oracle Insert Problem-Urgent

2001-10-17 Thread George Xu
hope this helps eg. inset into Tname values('Gopi'''s','20'); -Original Message- From: gopinath r [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 17, 2001 6:08 AM To: [EMAIL PROTECTED] Subject: Oracle Insert Problem-Urgent Hai my problem is

Oracle Insert Problem-Urgent

2001-10-17 Thread gopinath r
Hai my problem is to insert a varchar2 datatype which contains single quote(') into Oracle table from Perl. i am using ActivePerl for windows...how to handle this problem. eg. inset into Tname values('Gopi's','20'); -- Thanks gopi __

FW: MS SQL 7 and identity columns insert problem

2001-02-23 Thread Steve Howard
Sorry, a possibly significant typo in my originalautocommit is left on the default (ON)- not off. Thanks, Steve Howard Has anyone been successful in doing explicit inserts into columns with identity properties from PERL? I would appreciate any help, or any experience anyone has had with th

Re: MS SQL 7 and identity columns insert problem

2001-02-23 Thread Michael Peppler
Steve Howard writes: > Has anyone been successful in doing explicit inserts into columns with > identity properties from PERL? I would appreciate any help, or any > experience anyone has had with this. > > I am using dbi with dbd::odbc, and MS SQL 7.0. autocommit is left on the > default (

MS SQL 7 and identity columns insert problem

2001-02-23 Thread Steve Howard
Has anyone been successful in doing explicit inserts into columns with identity properties from PERL? I would appreciate any help, or any experience anyone has had with this. I am using dbi with dbd::odbc, and MS SQL 7.0. autocommit is left on the default (off). I have thus far tried unsuccessfu