DBI-1.623, DBD::Pg-2.19.3, bind_param ()

2013-03-04 Thread H.Merijn Brand
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

bind_param () - did something change?

2013-01-28 Thread H.Merijn Brand
= ?); 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

RE: bind_param () - did something change?

2013-01-28 Thread John Scoles
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

Re: bind_param () - did something change?

2013-01-28 Thread Martin J. Evans
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

RE: bind_param () - did something change?

2013-01-28 Thread John Scoles
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

Re: Strange bind_param issue

2012-09-06 Thread Martin J. Evans
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

Re: Strange bind_param issue

2012-08-16 Thread Martin J. Evans
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

Re: Strange bind_param issue

2012-08-16 Thread Charles Jardine
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

Re: Strange bind_param issue

2012-08-16 Thread Martin J. Evans
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

Re: Strange bind_param issue

2012-08-16 Thread Charles Jardine
$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

Strange bind_param issue

2012-08-15 Thread Martin J. Evans
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

Re: Strange bind_param issue

2012-08-15 Thread Tim Bunce
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

Re: Strange bind_param issue

2012-08-15 Thread Charles Jardine
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

Re: Strange bind_param issue

2012-08-15 Thread Tim Bunce
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

Re: Strange bind_param issue

2012-08-15 Thread Martin J. Evans
. 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

Re: bind_param for named parameters - clarification sought

2008-05-14 Thread Greg Sabino Mullane
-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

bind_param for named parameters - clarification sought

2008-05-13 Thread Martin Evans
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

Re: bind_param for named parameters - clarification sought

2008-05-13 Thread Tim Bunce
: 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

Re: bind_param for named parameters - clarification sought

2008-05-13 Thread Jonathan Leffler
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

bind_param() Doc Patch

2006-05-25 Thread David Wheeler
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 ===

Re: bind_param() Doc Patch

2006-05-25 Thread Tim Bunce
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

Re: Problem with bind_param using DBD::mysql

2005-04-07 Thread Steve Hay
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

Re: Problem with bind_param using DBD::mysql

2005-04-07 Thread Tim Bunce
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

Re: Problem with bind_param using DBD::mysql

2005-04-06 Thread Tim Bunce
= ? 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

Re: Problem with bind_param using DBD::mysql

2005-04-06 Thread Patrick Galbraith
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

Re: Problem with bind_param using DBD::mysql

2005-04-05 Thread Tim Bunce
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

Re: Problem with bind_param using DBD::mysql

2005-04-05 Thread Patrick Galbraith
, 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

Re: bind_param()

2002-01-21 Thread Tim Bunce
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

bind_param()

2002-01-20 Thread Sterin, Ilya
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

Re: bind_param()

2002-01-20 Thread Tim Bunce
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

RE: bind_param()

2002-01-20 Thread Sterin, Ilya
-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

Silly question re: bind_param vs: bind_columns

2001-07-13 Thread jadams01
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

RE: Silly question re: bind_param vs: bind_columns

2001-07-13 Thread Sterin, Ilya
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