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
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.
>
>
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
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
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
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
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
>
> 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
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
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
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
> 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
> 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
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
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
>>> "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:
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)) {$
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
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
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
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
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
-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
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
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
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
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
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
--
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
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
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
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
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
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
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,
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
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
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.
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
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
> 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
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
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
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
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
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
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,
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
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
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
__
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
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 (
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
53 matches
Mail list logo