Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2003
    Posts
    50

    Unanswered: sql loader problem

    Hi All,

    This has me stumped.
    I need to unload data from one table and sql load it into another table in another database.

    I unload it to a text file, but the problem i am having is that in some fields there is an end of line/newline character and when i look at the text file a record is spanning 2 lines.

    When i then sql load it, it thinks that each line is a seperate record and it fails. I need to export to a text file and i need to version control the file, so i can always go back to an older version if i need to.

    Is there a way i can tell sql loader when the end of the record is
    i.e. something like RECORD TERMINATED BY '#~#'

    or is there anyway i can get this record onto one line without stripping out the end of line/newline character

    Thanks
    Dave

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    why not export the table rows and just use the import utility?
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    I agree with Duck ... export/import if both are Oracle .. much quicker and cleaner ...

    Otherwise ... try creating a tab (or comma) delimited file from sqlplus, then you should be able to load it thru sqlloader ...

    Ex;
    set linesize 120
    set header off
    set pagesize 0
    set feedback off
    set trimspool on

    spool c:\test.txt

    select username||chr(9)||sid||chr(9)||serial#||chr(9)||pr ogram from v$session;

    spool off


    hTH
    Gregg

  4. #4
    Join Date
    Apr 2004
    Posts
    246
    If it's two oracle databases, why even bother with exp/imp - just insert it across a database link
    Give a man a fish, you feed him for a day. Club him over the head with a fish, he'll leave you alone.

Posting Permissions

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