Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013
    Posts
    1

    Question Unanswered: IQ LOAD TABLE doesn't work as shown in docs

    Sybase IQ "LOAD TABLE" option should make it fairly simple to bulk load
    a table from an ASCII delimited file, yet it doesn't seem as straightforward
    as the documentation indicates.

    Step 1: Create the table in IQ

    CREATE TABLE sa_galel.Book2 (
    BookNum integer NULL IQ UNIQUE (255) ,
    Description varchar(25) NULL IQ UNIQUE (255) ,
    Cost decimal(15,5) NULL IQ UNIQUE (255)
    )
    GO

    Step 2: create an ascii text file, comma delimited, newline terminated lines

    $ cat Book2.csv
    100,truck monkey,325.44
    120,turkey duck soup,126.41
    250,bobble gobble,76.3
    $

    Step 3: Use isql to run the "load table" command


    isql -Uuser -Ppasswd -Sserver
    1>
    2> load table sa_galel.Book2 (
    3> BookNum,
    4> Description,
    5> Cost
    6> )
    7> from '/opt/backup1/lbg3/Book2.csv'
    8> quotes off
    9> escapes off
    10> format ascii
    11> check constraints off
    12> ignore constraint unique 0, null 0
    13> delimited by ','
    14> row delimited by '\n'
    15> message log '/opt/backup1/lbg3/load_message.log'
    16> row log '/opt/backup1/lbg3/row_message.log'
    17> go
    (0 rows affected)
    1> quit

    Result: No rows loaded.

    Message log contains:
    2013-05-24 14:46:23 Load Table Book2: Integrity Constraint Violations
    2013-05-24 14:46:23 Load Table Book2: Completed

    Row log contains:
    2013-05-24 14:46:23 Load Table Book2: Integrity Constraint Violations
    Date Format: YYYY-MM-DD
    Time Format: HH:NNS.SSS
    Datetime Format: YYYY-MM-DD HH:NNS.SSS
    2013-05-24 14:46:23 Load Table Book2: Completed

    Why "Integrity Constraint Violations"? I've created no Constraints on the target table, and I've told IQ to not check constraints, just to be safe. But no data loads.

  2. #2
    Join Date
    Nov 2012
    Posts
    6
    hi ..
    this is because there is no delimiter at the end of the line ..
    add a , at the end of every line and try your load command

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •