Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > dump_results

Reply
Thread Tools

dump_results

 
 
aaron80v@yahoo.com.au
Guest
Posts: n/a
 
      07-03-2007

Does anyone know if DBI dump results API allow a dump without putting
single quotes around the column values?
I don't see an option.

Aaron

 
Reply With Quote
 
 
 
 
Martien verbruggen
Guest
Posts: n/a
 
      07-03-2007
On Tue, 03 Jul 2007 04:13:25 -0700,
http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> wrote:
>
> Does anyone know if DBI dump results API allow a dump without putting
> single quotes around the column values?


DBI::dump_results() calls DBI::neat_list() for each row, which calls
DBI::neat() for each element. DBI::neat() quotes string valuess, which
is, I presume, what you're asking about?

> I don't see an option.


I don't know of a (documented) option either. You could always replace
DBI::neat() with your own method, but I wouldn't recommend that without
knowing what the puprose is.

What is the purpose of your question?

Martien
--
|
Martien Verbruggen | Unix is user friendly. It's just selective
| about its friends.
|
 
Reply With Quote
 
 
 
 
aaron80v@yahoo.com.au
Guest
Posts: n/a
 
      07-03-2007
On Jul 3, 8:34 pm, Martien verbruggen <(E-Mail Removed)> wrote:
> On Tue, 03 Jul 2007 04:13:25 -0700,
> (E-Mail Removed) <(E-Mail Removed)> wrote:
>
>
>
> > Does anyone know if DBI dump results API allow a dump without putting
> > single quotes around the column values?

>
> DBI::dump_results() calls DBI::neat_list() for each row, which calls
> DBI::neat() for each element. DBI::neat() quotes string valuess, which
> is, I presume, what you're asking about?
>
> > I don't see an option.

>
> I don't know of a (documented) option either. You could always replace
> DBI::neat() with your own method, but I wouldn't recommend that without
> knowing what the puprose is.
>
> What is the purpose of your question?
>
> Martien
> --
> |
> Martien Verbruggen | Unix is user friendly. It's just selective
> | about its friends.
> |


The purpose is to get the right value delimiter such as double-quote,
no quote at all etc for batch load data into database. For example, by
default using dump_results(), even integer, smallint, decimal are
delimited with single quote which during loaded will be mistaken to be
varchar.

Aaron

 
Reply With Quote
 
Martien verbruggen
Guest
Posts: n/a
 
      07-06-2007
On Tue, 03 Jul 2007 06:49:02 -0700,
(E-Mail Removed) <(E-Mail Removed)> wrote:
> On Jul 3, 8:34 pm, Martien verbruggen <(E-Mail Removed)> wrote:
>> On Tue, 03 Jul 2007 04:13:25 -0700,
>> (E-Mail Removed) <(E-Mail Removed)> wrote:
>>
>>
>>
>> > Does anyone know if DBI dump results API allow a dump without putting
>> > single quotes around the column values?

>>
>> DBI::dump_results() calls DBI::neat_list() for each row, which calls
>> DBI::neat() for each element. DBI::neat() quotes string valuess, which
>> is, I presume, what you're asking about?


>> What is the purpose of your question?


> The purpose is to get the right value delimiter such as double-quote,
> no quote at all etc for batch load data into database. For example, by
> default using dump_results(), even integer, smallint, decimal are
> delimited with single quote which during loaded will be mistaken to be
> varchar.


dump_results() is meant, according to the DBI documentation, to provide
output for humans. Specifically it states:

Since it uses "neat_list" to format and edit the string for reading
by humans, it is not recomended for data transfer applications.

So you're using a function for a purpose for which it is specifically
documented not to be meant. I suggest that maybe you need to have a look
at the DBI:umper module, or maybe you should simply override
DBI::neat() as I suggested.

Martien
--
|
Martien Verbruggen | Failure is not an option. It comes bundled
| with your Microsoft product.
|
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments