Re: last insert id

2006-04-19 Thread Ron Savage
On Tue, 18 Apr 2006 12:56:24 +0200, Dr.Ruud wrote:

Hi

>> Nope. Method db_vendor() extracts the vendor's name from the
>> connect string passed to DBI, so I don't see how it could return
>> that :-))).
> Is it legal to pass 'MySQL'? How about '  mysql  '?

Sigh. DBI -> parse_dsn() does not accept something like 'dbi: mysql :test'.

And anyway, I control the config file this data comes from, so spaces won't
appear there...

This thread is now closed.
--
Cheers
Ron Savage, [EMAIL PROTECTED] on 20/04/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company




Tiny typo in docs for DBI.parse_dsn()

2006-04-19 Thread Ron Savage
Hi Tim

Near the end of parse_dsn()'s write up, $driver_dsn should be $driver.
--
Cheers
Ron Savage, [EMAIL PROTECTED] on 20/04/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company




Re: Bad int8 external representation "" (SQL-HY000)(DBD: st_execute/SQLExecute err=-1)

2006-04-19 Thread Ron Savage
On Wed, 19 Apr 2006 20:56:39 -0700 (PDT), Peter Loo wrote:

Hi Peter

> No Ron.  I did not chomp the record, but I am quite certain that it
> is not the issue.  The field it is complaining about is blank.  The
> odd thing is that the column it is going into is allowed for NULL
> values. I don't know what else to do, but will certainly give chomp
> a try.

OK.

You do realize a blank field (empty string) in Perl is /not/ a database null,
right?

To get a null use Perl's undef.

> Yes, I am only testing with one record.

I guessed chomp may be relevant as soon as I thought it died on the first line.

--
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html




Re: Bad int8 external representation "" (SQL-HY000)(DBD: st_execute/SQLExecute err=-1)

2006-04-19 Thread Jeffrey Seger
It's a numeric field and you are trying to insert an empty string rather
than undef (equivalent to null).

When you queried the other database and had the values in memorynot
written to a file... they stayed undef.  When you split the row from the
file, you have empty strings rather than undef or null.

You also need to be chomping.

On 4/19/06, Peter Loo <[EMAIL PROTECTED]> wrote:
>
> No Ron.  I did not chomp the record, but I am quite certain that it is
> not the issue.  The field it is complaining about is blank.  The odd
> thing is that the column it is going into is allowed for NULL values.
> I don't know what else to do, but will certainly give chomp a try.
>
> Yes, I am only testing with one record.
>
> Thanks.
>
> Peter
>
> --- Ron Savage <[EMAIL PROTECTED]> wrote:
>
> > On Tue, 18 Apr 2006 11:44:50 -0700, Loo, Peter # PHX wrote:
> >
> > Hi Peter
> >
> > > [unixODBC]ERROR:  copy: line 1, Bad int8 external representation ""
> > > (SQL-HY000)(DBD: st_execute/SQLExecute err=-1)
> >
> > Line 1, eh? First attempt to insert data? Did you try chomp-ing the
> > line?
> >
> > --
> > Cheers
> > Ron Savage, [EMAIL PROTECTED] on 19/04/2006
> > http://savage.net.au/index.html
> > Let the record show: Microsoft is not an Australian company
> >
> >
> >
>
>
> Peter Loo
> Worldwide Consulting, Inc.
> Phoenix, Arizona
> U.S.A.
>



--
--
The darkest places in hell are reserved for those who maintain their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)

They who would give up an essential liberty for temporary security, deserve
neither liberty or security.
Benjamin Franklin

Our lives begin to end the day we become silent about things that matter.
Martin Luther King

Our government can't be bought.  The oil companies will never give it up at
any price.
My opinion
--


Re: Bad int8 external representation "" (SQL-HY000)(DBD: st_execute/SQLExecute err=-1)

2006-04-19 Thread Peter Loo
No Ron.  I did not chomp the record, but I am quite certain that it is
not the issue.  The field it is complaining about is blank.  The odd
thing is that the column it is going into is allowed for NULL values. 
I don't know what else to do, but will certainly give chomp a try.

Yes, I am only testing with one record.

Thanks.

Peter

--- Ron Savage <[EMAIL PROTECTED]> wrote:

> On Tue, 18 Apr 2006 11:44:50 -0700, Loo, Peter # PHX wrote:
> 
> Hi Peter
> 
> > [unixODBC]ERROR:  copy: line 1, Bad int8 external representation ""
> > (SQL-HY000)(DBD: st_execute/SQLExecute err=-1)
> 
> Line 1, eh? First attempt to insert data? Did you try chomp-ing the
> line?
> 
> --
> Cheers
> Ron Savage, [EMAIL PROTECTED] on 19/04/2006
> http://savage.net.au/index.html
> Let the record show: Microsoft is not an Australian company
> 
> 
> 


Peter Loo
Worldwide Consulting, Inc.
Phoenix, Arizona
U.S.A.


Prepared statement not a cursor specification

2006-04-19 Thread Loo, Peter # PHX
Hi All,
 
Has anyone seen this error before and if so would you know the solution
to fixing it?
 
DBD::ODBC::st execute failed: [unixODBC]Prepared statement not a cursor
specification (SQL-07005)(DBD: describe/SQLDescribeCol err=-1)
 
I am trying to loop through the returned values of a select statement
and doing the updates accordingly.
 
Thanks.
 
Peter


This E-mail message is for the sole use of the intended recipient(s) and may 
contain confidential and privileged information.  Any unauthorized review, use, 
disclosure or distribution is prohibited.  If you are not the intended 
recipient, please contact the sender by reply E-mail, and destroy all copies of 
the original message.


Problem with DBD-Oracle

2006-04-19 Thread Kimball, Kevin
Please pardon the interruption, but I was hoping you could give me some
guidance with a problem I'm having installing the DBD-Oracle module
using PPM.  I get to the license agreement and it freezes?  I'm using
Perl 5.8.8.

Any suggestions would be greatly appreciated.


Thank you,

Kevin


Re: problem using table_info and column_info with DBD::Proxy

2006-04-19 Thread Tim Bunce
At this point your guess is as good as mine as I've no time to dig deeper.
Sorry.

Tim.

On Wed, Apr 19, 2006 at 01:07:35PM +0800, Allan Dyer wrote:
> On 18 Apr 2006 at 23:00, Tim Bunce wrote:
> > On Mon, Apr 10, 2006 at 03:14:21PM +0800, Allan Dyer wrote:
> > > > >
> > > > > I've found that the problem with table_info has been reported three
> > > > > times before in this group:
> > > > 
> > > > Here's how I call table_info(...). I have not used DBD::Proxy.
> > 
> > > Who's maintaining DBD::Proxy? Perhaps I should contact them direct.
> > 
> > I'd *love* someone to help maintain DBD::Proxy. Any volunteers?
> 
> Sorry, I can't commit on this. I can help document this problem, and test any 
> solutions suggested.
> 
> > Meanwhile, see this in Proxy.pm:
> > 
> > # XXX probably many more methods need to be added here.
> > # See notes in ToDo about method metadata
> > sub commit;
> > sub connected;
> > sub rollback;
> > sub ping;
> > 
> > try adding extra lines for any methods that seem unsupported by DBD::Proxy.
> 
> I didn't find any explanation of method metadata in ToDo, so I added:
> sub table_info;
> sub column_info;
> 
> > Please let me know if that helps.
> 
> For my column_info example, a change. I previously got:
> Can't call method "fetchall_hashref" on an undefined value at ./example2.pl  
> line 17.
> Now I get:
> DBD::Proxy::db column_info failed: Server returned error: Failed to execute 
> method CallMethod: Can't call method "execute" without a package or object 
> reference at /usr/lib/perl5/site_perl/5.8.8/i486-linux/DBI.pm line 1584.  
> 
> For my table_info example, no change, I still get:
> DBD::Proxy::db table_info failed: Server returned error: Failed to execute 
> method CallMethod: Can't call method "execute" without a package or object 
> reference at /usr/lib/perl5/site_perl/5.8.8/i486-linux/DBD/mysql.pm line 262.
> 
> it seems that table_info in mysql.pm is not getting a valid statement handle, 
> which implies the database handle it has been given is invalid. I looked at 
> ProxyServer.pm and found this comment in table_info:
> 
> # We wouldn't need to send all the rows at this point, instead we could
> # make use of $rsth->fetch() on the client as usual.
> # The problem is that some drivers (namely DBD::ExampleP, DBD::mysql and
> # DBD::mSQL) are returning foreign sth's here, thus an instance of
> # DBI::st and not DBI::ProxyServer::st. We could fix this by permitting
> # the client to execute method DBI::st, but I don't like this.
> 
> I'm wondering if this is related, but I'm finding it difficult to follow 
> what's 
> happening. Did the behaviour of DBD::mysql change after DBD:Proxy was 
> written, 
> perhaps?
> 
> Allan
> 
> 
> 
>  Allan Dyer, CISSP, MHKCS, MIAP | [EMAIL PROTECTED]
>  Chief Consultant| http://www.yuikee.com.hk/
>  Yui Kee Computing Ltd. | +852 28708555
>