Home » SQL & PL/SQL » SQL & PL/SQL » Sql Query (oracle 10g)
Sql Query [message #444042] Thu, 18 February 2010 08:01 Go to next message
ravi214u
Messages: 153
Registered: February 2008
Location: CANADA
Senior Member

Hi,

i have two columns in a flat file (col1 and col2) and i need to populate the New two columns(newcol1 and newcol2) from col1 and col2 during load process. below is the logic of population of new columns e.g
col1 col2  newcol1 newcol2
1      10     2      12
2      11     3      13
3      12     4      14
4      13     5
5      14



thanks
Re: Sql Query [message #444044 is a reply to message #444042] Thu, 18 February 2010 08:07 Go to previous messageGo to next message
BlackSwan
Messages: 24912
Registered: January 2009
Senior Member
>below is the logic of population of new columns e.g
Really?

Where?

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: Sql Query [message #444049 is a reply to message #444042] Thu, 18 February 2010 08:42 Go to previous messageGo to next message
Michel Cadot
Messages: 63812
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Easy:
newcol1=col1+1 or null if > 5
newcol2=col2+2 or null if > 14

Regards
Michel
Re: Sql Query [message #444051 is a reply to message #444042] Thu, 18 February 2010 08:53 Go to previous messageGo to next message
ravi214u
Messages: 153
Registered: February 2008
Location: CANADA
Senior Member
Thanks michel,

But the value given by me are in order to understand but actually it will vary. it will not be in sequence.
Re: Sql Query [message #444052 is a reply to message #444051] Thu, 18 February 2010 08:56 Go to previous messageGo to next message
BlackSwan
Messages: 24912
Registered: January 2009
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
It would be helpful if you provided DDL (CREATE TABLE ...) for tables involved.
It would be helpful if you provided DML (INSERT INTO ...) for test data.
It would be helpful if you provided expected/desired results & a detailed explanation how & why the test data gets transformed or organized.
Re: Sql Query [message #444053 is a reply to message #444051] Thu, 18 February 2010 08:57 Go to previous messageGo to next message
ThomasG
Messages: 3186
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
So by now we know:

- There are 2 columns in a flat file.
- The logic will vary.

Hmmmmmmm......

Take two aspirin and call us in the morning?
Re: Sql Query [message #444054 is a reply to message #444051] Thu, 18 February 2010 08:57 Go to previous message
Michel Cadot
Messages: 63812
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
ravi214u wrote on Thu, 18 February 2010 15:53
Thanks michel,

But the value given by me are in order to understand but actually it will vary. it will not be in sequence.

But you didn't say what are the requirements.

Regards
Michel
Previous Topic: SAVEPOINT (merged 3)
Next Topic: ORA-01003: no statement parsed on CREATE TABLE
Goto Forum:
  


Current Time: Fri Sep 30 10:45:34 CDT 2016

Total time taken to generate the page: 0.14446 seconds