LOAD 
Author Message
 LOAD

Dear recipient:
I execute a next command:

load from "/usr2/informix/serme/energias/energias.csv" DELIMITER ","
   insert into energias;

The file energias.csv  is resulted of export a table in db2:
"TUL01",20,40
"MAM01",10,30
........

My table energias have a next structure:

nombre  char(6);
valor1    integer;
valor2    integer;

When I to execute a LOAD and to make query languaje select * from
energias with dbaccess, the field nombre to load  "TUL01 , "MAM01. Take
a " ( double quotes) like character.
I need to load this field without double quotes.
e.g
       TUL01
       MAM01

Can you help me please?

Thanks for your atentions.



Wed, 18 Jun 1902 08:00:00 GMT
 LOAD


Quote:

>Dear recipient:

Dear Poster:

Quote:
>I execute a next command:

>load from "/usr2/informix/serme/energias/energias.csv" DELIMITER ","
>    insert into energias;

>The file energias.csv  is resulted of export a table in db2:
>"TUL01",20,40
>"MAM01",10,30
>........

>My table energias have a next structure:

>nombre  char(6);
>valor1    integer;
>valor2    integer;

>When I to execute a LOAD and to make query languaje select * from
>energias with dbaccess, the field nombre to load  "TUL01 , "MAM01. Take
>a " ( double quotes) like character.
>I need to load this field without double quotes.
>e.g
>        TUL01
>        MAM01

>Can you help me please?

Pipe your file through sed, awk or tr to get rid of the "'s first.

Something like

cat /usr2/informix/serme/energias/energias.csv | tr -d \" > /tmp/load

(You need the \ to escape the " from the shell)

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.



Wed, 18 Jun 1902 08:00:00 GMT
 LOAD

Quote:


> >Dear recipient:

> Dear Poster:

> >I execute a next command:

> >load from "/usr2/informix/serme/energias/energias.csv" DELIMITER ","
> >    insert into energias;

> >The file energias.csv  is resulted of export a table in db2:
> >"TUL01",20,40
> >"MAM01",10,30
> >........

> >My table energias have a next structure:

> >nombre  char(6);
> >valor1    integer;
> >valor2    integer;

> >When I to execute a LOAD and to make query languaje select * from
> >energias with dbaccess, the field nombre to load  "TUL01 , "MAM01. Take
> >a " ( double quotes) like character.
> >I need to load this field without double quotes.
> >e.g
> >        TUL01
> >        MAM01

> >Can you help me please?

> Pipe your file through sed, awk or tr to get rid of the "'s first.

> Something like

> cat /usr2/informix/serme/energias/energias.csv | tr -d \" > /tmp/load

> (You need the \ to escape the " from the shell)

Or you enclose it in single quotes...

Another alternative is the ubiquitous SQLCMD available from the IIUG
archives.  It has a load/unload mode that works with CSV data (more or
less; there's always a chance that there are bugs in it -- and handling
embedded quotes in CSV is always interesting).

--
Yours,

Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
     "I don't suffer from insanity; I enjoy every minute of it!"



Wed, 18 Jun 1902 08:00:00 GMT
 LOAD


Quote:

>Another alternative is the ubiquitous SQLCMD available from the IIUG
>archives.

Ubiquitous? I could see, "The ever popular SQLCMD" or "The oft-mentioned....". Maybe the {*filter*} (or Menlo culture) have taken their toll.

That's not to say it ain't good, just that it ain't omnipresent.

Quote:
>It has a load/unload mode that works with CSV data (more or
>less; there's always a chance that there are bugs in it -- and handling
>embedded quotes in CSV is always interesting).

>--
>Yours,

>Guardian of DBD::Informix v1.00.PC1 -- http://www.***.com/
>     "I don't suffer from insanity; I enjoy every minute of it!"

==
Maintainer of the procrastinator's FAQ.                                      Well, maybe tomorrow I will be.

_____________________________________________________________
Want a new web-based email account ? ---> http://www.***.com/



Wed, 18 Jun 1902 08:00:00 GMT
 LOAD

Quote:



> >Another alternative is the ubiquitous SQLCMD available from the IIUG
> >archives.

> Ubiquitous? I could see, "The ever popular SQLCMD"

No Informix installation is complete without SQLCMD.

sqlcmd, from

         http://www.iiug.org

has very useful load/unload format, among many other features.

--
David Stes Molenstraat 5 B-2018 Antwerpen, Vlaanderen, Belgie



Wed, 18 Jun 1902 08:00:00 GMT
 LOAD


Quote:




> > >Another alternative is the ubiquitous SQLCMD available from the IIUG
> > >archives.

> > Ubiquitous? I could see, "The ever popular SQLCMD"

I never thought I'd see someone out-pedant JL, I *am* impressed.

Quote:
>No Informix installation is complete without SQLCMD.

Bollocks, I've done 100's, probably 1000's of Informix installations where
they never missed it. I'm not knocking it, it is very good, but I think
you're seriously misguided if you really think "no Informix installation is
complete without SQLCMD."

Quote:
>sqlcmd, from

>     http://www.iiug.org

>has very useful load/unload format, among many other features.

It does indeed. (JL, I'm not knocking SQLCMD, I'm just entering into the
spirit of pedantry. :0)

--
Pedantically yours,
Obnoxio

Informix Marketing -- bringing a knife to the Database Gunfight since
1985!!!

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.



Wed, 18 Jun 1902 08:00:00 GMT
 LOAD


Quote:





>> > >Another alternative is the ubiquitous SQLCMD available from the IIUG
>> > >archives.

>> > Ubiquitous? I could see, "The ever popular SQLCMD"

>I never thought I'd see someone out-pedant JL, I *am* impressed.

I impressed you? Gosh, that puts me right up there with the new Informix management team doesn't it? At least it wasn't the marketing group that impressed you. I don't think I could live with that.

Quote:
>>No Informix installation is complete without SQLCMD.

>Bollocks, I've done 100's, probably 1000's of Informix installations where
>they never missed it. I'm not knocking it, it is very good, but I think
>you're seriously misguided if you really think "no Informix installation is
>complete without SQLCMD."

>>sqlcmd, from

>>         http://www.iiug.org

>>has very useful load/unload format, among many other features.

>It does indeed. (JL, I'm not knocking SQLCMD, I'm just entering into the
>spirit of pedantry. :0)

>--
>Pedantically yours,
>Obnoxio

>Informix Marketing -- bringing a knife to the Database Gunfight since
>1985!!!

>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

>Share information about yourself, create your own public profile at
>http://profiles.msn.com.

==
Maintainer of the procrastinator's FAQ.                                      Well, maybe tomorrow I will be.

_____________________________________________________________
Want a new web-based email account ? ---> http://www.firstlinux.net



Wed, 18 Jun 1902 08:00:00 GMT
 
 [ 7 post ] 

 Relevant Pages 

1. Problems loading data: LOAD vs. DTS

2. How to load a flat file load into a MS OLAP Cube

3. Loading Xml Data returned from the query loaded into recordset

4. DOMDocument.load() fails to load document from remote server

5. Saving and loading JPEG from Paradox7 table- Error on load

6. VB6: application in runtime environment with error on loading form: ado cannot load object

7. Loading a Cbo with DSN's Loaded on the system

8. SQL*Loader problem: Not loading Spaces into NULL column through direct load

9. Load indexed table via parallel direct load?

10. loading data dump from ASE 11.9 to ASE 12.0 sets it to offline after load

11. Loading Oracle load-file into Informix

12. Loading Oracle load-file into Informix


 
Powered by phpBB® Forum Software