yalda sana
yalda sana

Reputation: 65

How to add date_column when reading from a file in Oracle ODI

I want to read data from a .txt file in ODI and when mapping the source table to the target, add a date column representing the current date. Do you have any suggestion how I can do that?

Upvotes: 0

Views: 67

Answers (1)

Littlefoot
Littlefoot

Reputation: 142710

I don't use ODI so this might be complete nonsense; however, see if it helps.

I presume that target table is the final destination of data loaded from the TXT file. If that's so, then - if you create date column whose default value is sysdate, then this might suite your needs. Here's an example:

SQL> create table target
  2    (id         number generated always as identity,
  3     name       varchar2(10),
  4     salary     number,
  5     load_date  date default sysdate          --> this
  6    );

Table created.

Let's simulate loading process; I'm inserting only columns that don't have pre-defined value:

SQL> insert into target (name, salary) values ('Little', 100);

1 row created.

What is table contents?

SQL> select * from target;

        ID NAME           SALARY LOAD_DATE
---------- ---------- ---------- -------------------
         1 Little            100 05.05.2024 11:20:29
                                 -------------------
                                 value you're interested in 

Upvotes: 1

Related Questions