Before I file an RT ticket, I want to verify that I didn't miss the obvious …
When I use bind_param on a char (4) field in DBD::Pg, it only loads the
first character:
--8---
use 5.016;
use warnings;
use DBI;
use Data::Peek;
my $dbh = DBI-connect (dbi:Pg:, undef, undef, {
PrintError
= ?);
for (@llvr) {
$_-{$blob} or next;
$sth-bind_param (1, $_-{$blob}, { ora_type = ORA_BLOB });
$sth-bind_param (2, $_-{c_ll}, { ora_type = ORA_NUMBER });
$sth-bind_param (3, $_-{m_nr}, { ora_type = ORA_NUMBER });
$sth-execute
Date: Mon,
28 Jan 2013 14:31:44 +0100
From: h.m.br...@xs4all.nl
To: dbi-dev@perl.org
Subject: bind_param () - did something change?
I have a table with 5 BLOB's. BLOB's are easy in DBD::CSV and
DBD::Unify, but they need some help in Oracle.
I had a script that did load a table from a CSV
either - none of which surprised
me as in DBD::ODBC's case the call to SQLDescribeParam does not return
column names).
Martin
Date: Mon, 28 Jan 2013 14:31:44 +0100
From: h.m.br...@xs4all.nl
To: dbi-dev@perl.org
Subject: bind_param () - did something change?
I have a table with 5 BLOB's
Date: Mon, 28 Jan 2013 19:33:46 +
From: martin.ev...@easysoft.com
To: dbi-dev@perl.org
Subject: Re: bind_param () - did something change?
On 28/01/2013 19:03, John Scoles wrote:
I do not think so. That section of DBD::Oracle code does need some rework
as it was written
for bind_param:
The bind_param method takes a copy of $bind_value and associates it (binds it) with
a placeholder
As far as I am aware DBD::ODBC does not copy the scalar given to it -
so perhaps DBI does this. The problem I'm seeing in the provided
example is the pointer passed to ODBC's
for bind_param:
The bind_param method takes a copy of $bind_value and associates it (binds it) with
a placeholder
As far as I am aware DBD::ODBC does not copy the scalar given to it -
so perhaps DBI does this. The problem I'm seeing in the provided
example is the pointer passed to ODBC's
can help?
Some background:
DBI says for bind_param:
The bind_param method takes a copy of $bind_value and associates it
(binds it) with a placeholder
As far as I am aware DBD::ODBC does not copy the scalar given to it -
so perhaps DBI does this. The problem I'm seeing in the provided
example
exactly what is happening. I wonder if anyone can help?
Some background:
DBI says for bind_param:
The bind_param method takes a copy of $bind_value and associates it
(binds it) with a placeholder
As far as I am aware DBD::ODBC does not copy the scalar given to it -
so perhaps DBI does
$sth = $dbh-prepare($sql);
$sth-bind_param(1, $obj);
$sth-execute();
while (my $row = $sth-fetchrow_hashref()) {
print $row-{'RESULT'}, \n;
}
package Object;
use overload '' = 'to_s';
sub new() { bless { }, shift };
sub to_s() { my $self = shift; ref($self); }
and it printed
Object
Because
I've just been given an rt https://rt.cpan.org/Ticket/Display.html?id=78838 and
am at a loss to explain exactly what is happening. I wonder if anyone can help?
Some background:
DBI says for bind_param:
The bind_param method takes a copy of $bind_value and associates it (binds
On Wed, Aug 15, 2012 at 04:14:52PM +0100, Martin J. Evans wrote:
I've just been given an rt https://rt.cpan.org/Ticket/Display.html?id=78838
and am at a loss to explain exactly what is happening. I wonder if anyone can
help?
Some background:
DBI says for bind_param:
The bind_param
On 15/08/12 16:14, Martin J. Evans wrote:
I've just been given an rt
https://rt.cpan.org/Ticket/Display.html?id=78838 and am at a loss to
explain exactly what is happening. I wonder if anyone can help?
Some background:
DBI says for bind_param:
The bind_param method takes a copy of $bind_value
in the bind_param call the driver is free
to 'do something reasonable' which typically means treat the value as a
string (or a number if it knows the field is numric).
I think this is a case of user error.
It would be reasonable for a driver to complain if passed an object that
doesn't have string
.
Without any method attributes in the bind_param call the driver is free
to 'do something reasonable' which typically means treat the value as a
string (or a number if it knows the field is numric).
I think this is a case of user error.
It would be reasonable for a driver to complain if passed
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
I believe, but am prepared to be put right, other non-perl database drivers
also drop the ':' when binding.
Any other driver authors/users care to comment?
FWIW, DBD::Pg requires a leading colon, but strongly encourages the use of $1
Tim,
In the thread problem with DBD::ODBC and placeholders
[SEC=UNCLASSIFIED] on dbi-users recently you said:
Drivers that support named placeholders like :N where N is an
integer, could support both forms of binding: bind_param(:1,$v) and
execute($v)
It's not dis-allowed. Driver docs
: bind_param(:1,$v) and
execute($v)
It's not dis-allowed. Driver docs should clarify this issue.
Is it really your intention that to bind named parameter fred as in the
SQL insert into xxx values(:fred) you call bind_param(:fred,$v)?
That's the way DBD::Oracle has always done it.
As it happens DBD
like :N where N is an
integer, could support both forms of binding: bind_param(:1,$v) and
execute($v)
It's not dis-allowed. Driver docs should clarify this issue.
Is it really your intention that to bind named parameter fred as in
the
SQL insert into xxx values(:fred) you call
The examples under Data Types for Column Binding don't execute.
This is because the second argument to bind_col() should be a scalar
ref, and the examples just use Cundef. Should it be C\undef?
Best,
David
Index: DBI.pm
===
On Thu, May 25, 2006 at 11:48:33AM -0700, David Wheeler wrote:
The examples under Data Types for Column Binding don't execute.
This is because the second argument to bind_col() should be a scalar
ref, and the examples just use Cundef. Should it be C\undef?
The undef means don't actually
Patrick Galbraith wrote:
As well, he said to avoid
strcasencmp. I will take a look through the perl API to see if there is
a similar function.
I couldn't see one at a quick glance. There are strnEQ and strnNE, but
not case-insensitive variants?
FYI, Win32 does have a _strnicmp() with the
On Thu, Apr 07, 2005 at 09:21:19AM +0100, Steve Hay wrote:
Patrick Galbraith wrote:
As well, he said to avoid
strcasencmp. I will take a look through the perl API to see if there is
a similar function.
I couldn't see one at a quick glance. There are strnEQ and strnNE, but
not
= ? WHERE id = ?);
$sth-bind_param(1, 'one', SQL_VARCHAR());
$sth-bind_param(2, '1.#INF', SQL_DOUBLE());
$sth-bind_param(3, 1, SQL_INTEGER());
$sth-execute();
error message:
DBD::mysql::st bind_param failed: Non-numeric value bound as numeric!
at ./test_bind.pl line 44.
Error messages
Tim,
As it turns out, I talked to Monty this morning, and he said to use
'longlong' for the datatype (will require my_global.h) as it works with
all UNIXs and windows that MySQL runs on. As well, he said to avoid
strcasencmp. I will take a look through the perl API to see if there is
a
On Tue, Apr 05, 2005 at 09:29:59AM +0100, Steve Hay wrote:
Stephen Clouse wrote:
On Mon, Apr 04, 2005 at 03:41:56PM +0100, Steve Hay wrote:
Binding parameters: UPDATE foo SET str = 'one', num = 1.#INF WHERE
id = 1
You're being bitten by two things:
1. MySQL doesn't actually support
, JW_ERR_ILLEGAL_PARAM_NUM,
Non-numeric value bound as numeric!);
perl code to test:
$sth= $dbh-prepare(UPDATE bind SET string = ?, num = ? WHERE id = ?);
$sth-bind_param(1, 'one', SQL_VARCHAR());
$sth-bind_param(2, '1.#INF', SQL_DOUBLE());
$sth-bind_param(3, 1, SQL_INTEGER
On Sun, Jan 20, 2002 at 08:00:33PM -0800, Sterin, Ilya wrote:
-Original Message-
From: Tim Bunce [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 20, 2002 2:16 PM
To: Sterin, Ilya
Cc: [EMAIL PROTECTED]
Subject: Re: bind_param()
It would have to be a new method
Would it be worth while to redo bind_param() to allow it to except both
references and values, therefore allowing to execute with different
values, based on the changing values of the variable? Will this somehow
be effected with the way Perl might reallocate the pointer and assign a
different
Tim.
On Sun, Jan 20, 2002 at 12:47:13PM -0800, Sterin, Ilya wrote:
Would it be worth while to redo bind_param() to allow it to except both
references and values, therefore allowing to execute with different
values, based on the changing values of the variable? Will this somehow
be effected
-Original Message-
From: Tim Bunce [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 20, 2002 2:16 PM
To: Sterin, Ilya
Cc: [EMAIL PROTECTED]
Subject: Re: bind_param()
It would have to be a new method. Perhaps
New method is fine, I don't see a problem with it. Though I
I'm looking at DBI 1.14 and wondering why isn't there a bind_params method like:
$rc = $sth-bind_params(@refs_to_params); #dies if wrong number of params
or
$rc = $sth-bind_params(%hash_of_params_with_field_names_or_numbers); #dies if hash
key mismatch
It seems like an obvious idea, so I
Probably because you can accomplish the same with execute(@params) :-)
Ilya
-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 7/13/01 11:34 AM
Subject: Silly question re: bind_param vs: bind_columns
I'm looking at DBI 1.14 and wondering why isn't
33 matches
Mail list logo