Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: NEED HELP ON SQL LOADER

Re: NEED HELP ON SQL LOADER

From: David Jordan <david.t.jordan_at_dallastx.ncr.com>
Date: 1997/10/26
Message-ID: <01bce22f$1a8e3980$4e335299@txdalljordad.DallasTX.NCR.com>#1/1

Try something like this if your trying to load a tabular report to a table, for example:

(Statements in control file)

OPTIONS (SILENT=FEEDBACK)
LOAD DATA
INTO TABLE STAR_BAL
APPEND
FIELDS TERMINATED BY '/' OPTIONALLY ENCLOSED BY '"'

        (BANK   POSITION(6:8) INTEGER EXTERNAL,
        DP      POSITION(12) CHAR TERMINATED BY WHITESPACE
                "TO_NUMBER(:DP,'999,999,999,999.99')",
        LN      POSITION(33) CHAR TERMINATED BY WHITESPACE
                "TO_NUMBER(:LN,'999,999,999,999.99')",
        ESCROW  POSITION(56) CHAR TERMINATED BY WHITESPACE
                "TO_NUMBER(:ESCROW,'9,999,999,999.99')"
        )

Try this if every field of your data is delimited by a comma, for example:

(Statements in control file)

OPTIONS (SILENT=FEEDBACK)
LOAD DATA
INTO TABLE EOM_DEP
APPEND
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'

        (BANK,
        BR,
        TYPE,
        ACCT_NBR,
        EXTRACT_DATE DATE "MMDDYY",
        CUR_BAL,
        SOC_SECURITY_CD,
        DT_ACCT_OPENED DATE "YYYYMMDD" nullif  DT_ACCT_OPENED='00000000',
        STATUS_CD
        )

Lastly, try this when your input data contains multiple types of data and you goal is to only load one type, and your fields are fixed in length rather than delimited.

(Statements in control file)

options (silent=feedback)
load data
into table DEP_ACCT
append
when ((1:2) = 'DI')

   (

     BANK                   position ( 11: 13) char     (   3),
     BR                        position ( 14: 15) decimal  (   2),
     TYPE                    position ( 16: 17) decimal  (   2),
     ACCT_NBR            position ( 18: 23) decimal  (  10),
     DEPT_SYS_TYPE  position ( 24: 25) decimal  (   2),
     BR_ASSIGNED      position ( 26: 27) decimal  (   2)
  )

I use Unix cron to schedule automated tasks. Sign on to your Unix system as the user who will execute the task and enter 'crontab -e' to edit the crontab file.

Hope this helps!

FIREWALL <ubsram_at_pacific.net.sg> wrote in article <344cc1ff.3358308_at_news.pacific.net.sg>...
> Dear Friends,
>
> I need help on SQL Loader. How do I load ASCII files from UNIX to
> Oracle Database 7 using SQL Loader.
>
> Please help me with the syntax.
>
> In addition, how do I schedule a job to be run on a weekly basis in
> UNIX AIX ??
>
>
> Please e-mail
>
> ubsram_at_pacific.net.sg
>
>
> Thank you
>
Received on Sun Oct 26 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US