Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8735

Problems loading data into IQ

$
0
0

Hey,

 

Doing some testing with IQ and struggling to load some simple data.

 

CREATE TABLE "TRANSACTION" (

           "CUSTOMER_ID" INTEGER,

           "MERCHANT_ID" INTEGER,

           "TXTIMESTAMP" TIMESTAMP,

           "TXAMOUNT" DECIMAL(17,2),

           "TXCURR" CHAR(3));

 

LOAD TABLE transaction

( customer_id, merchant_id, txtimestamp datetime('yyyy-mm-dd hh:nn:ss,'), txamount, txcurr)

FROM '/iq/demo/1.csv'

ESCAPES OFF

DELIMITED BY ','

ROW DELIMITED BY '\n';

 

host:/iq/demo # cat 1.csv

1945178,2058615,2001-01-08 16:52:53, 8.75,GBP

1180243,3118407,2001-01-02 01:25:25,14.22,GBP

 

Now I read you have to have a row delimiter to enable load parallelism which is why I included it. But, it returns an error.

 

host:/iq/iq/IQ-16_0/demo # dbisql -c "uid=DBA;pwd=sql" load3.sql

Could not execute statement.

  Missing row delimiter detected during a row delimited insert.

 

I found that if I changed the format to this (note the trailing commas):

 

host:/iq/demo # cat 1.csv

1945178,2058615,2001-01-08 16:52:53, 8.75,GBP,

1180243,3118407,2001-01-02 01:25:25,14.22,GBP,

 

And then I run a simpler load statement:

 

LOAD TABLE transaction

( customer_id, merchant_id, txtimestamp datetime('yyyy-mm-dd hh:nn:ss,'), txamount, txcurr)

FROM '/iq/demo/1.csv'

ESCAPES OFF;

 

Then it works just fine. Not sure why though...

 

Ideas much appreciated!

 

John


Viewing all articles
Browse latest Browse all 8735

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>