Solved

lpad & trim in external table

Posted on 2009-04-14
1
1,759 Views
Last Modified: 2012-05-06
Hi,

How to use trim & lpad fucntion in oracle external table?. I tried as below. It didn't work.

thanks
victor
CREATE TABLE diff

    (plan_ctry                      VARCHAR2(3),

    division                       VARCHAR2(2))

  ORGANIZATION EXTERNAL (

   DEFAULT DIRECTORY  DPR_DATA_DIR

    ACCESS PARAMETERS(RECORDS DELIMITED BY NEWLINE

BADFILE DPR_LOG_DIR:'diff.bad'

DISCARDFILE DPR_LOG_DIR:'diff.dsc'

LOGFILE DPR_LOG_DIR:'diff.log'

FIELDS TERMINATED BY ','

MISSING FIELD VALUES ARE NULL

REJECT ROWS WITH ALL NULL FIELDS

    (plan_ctry CHAR,                     

    division  CHAR "LPAD(TRIM(:DIVISION), 2, '0')"

  ))

   LOCATION (

    DPR_DATA_DIR:'ZISCFUOG1.CSV'

   )

  )

   REJECT LIMIT UNLIMITED

/

Open in new window

0
Comment
Question by:victory_in
1 Comment
 
LVL 47

Accepted Solution

by:
schwertner earned 500 total points
ID: 24141070
I will suggest this when you read from the table

SELECT plan_ctry , LPAD(TRIM(:DIVISION), 2, '0') FROM diff;
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now