Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
Flat File Scenarios in a

Flat File Scenarios in a

Ratings: (0)|Views: 180 |Likes:
Published by aben2606

More info:

Published by: aben2606 on Apr 22, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

10/25/2011

pdf

text

original

 
How does one eliminate duplicates rows from a table?
Choose one of the following queries to identify or remove duplicate rows from a table leaving only uniquerecords in the table:
Method 1:
Delete all rowids that is BIGGER than the SMALLEST rowid value (for a given key):
SQL> DELETE FROM table_name A2 WHERE ROWID > ( SELECT min(rowid)3 FROM table_name B4 WHERE A.key_values = B.key_values );
Method 2:
This method is usually faster. However, remember to recreate all indexes, constraints, triggers, etc. onthe table when done.
SQL> create table table_name2 as select distinct * from table_name1;SQL> drop table table_name1;SQL> rename table_name2 to table_name1;
Method 3:
SQL> DELETE FROM my_table t12 WHERE EXISTS ( SELECT 'x' FROM my_table t23 WHERE t2.key_value1 = t1.key_value14 AND t2.key_value2 = t1.key_value24 AND t2.rowid > t1.rowid );
Note: One can eliminate N^2 unnecessary operations by creating an index on the joined fields in the inner loop (no need to loop through the entire table on each pass by a record). This will speed-up the deletionprocess.Note 2: If you are comparing NULL columns, use the NVL function. Remember that NULL is not equal toNULL. This should not be a problem as all key columns should be NOT NULL by definition.
Method 4:
This method collects the first row (order by rowid) for each key values and delete the rows that are not inthis set:
 
SQL> DELETE FROM my_table t11 WHERE rowid NOT IN ( SELECT min(rowid)2 FROM my_table t23 GROUP BY key_value1, key_value2 );
Note: IF key_value1 is null or key_value2 is null, this still works correctly.
1)Dyanamically creating flat files inInformatica
Asked by purushotham N | posted Jun 29 | Replies (10)
Hi I just have requirement where in, I need to generate the target files dyanamically with the departmentnames.For example , If I have 3 departments with the names Comupers, Accounts and Finance, then We needto generate the target files as Computers.txt, Accounts.txt and Finance.txt respecivey using Informaticatool.Can any please provide the solution for this.
 
ANSWER:Source is FILE :---empno deptno100 10100 20100 30200 10200 20200 20200 10300 10300 10300 10step 1drag and drop the columns form the source qualifier to sorter set the sort key on DEPTNO (Ascending)step 2Drag and drop the ports to expressioncreate ports likePORTNAME TYPE EXPRESSION
 
PREVDEPTNO V VALEMPNO I/ODEPTNO I/OVAL V DEPTNOCHECK_FILE V decode(DEPTNO,PREVDEPTNO,1,0)OUTPUT_FILE O/P CHECK_FILESTEP3DROP empno,DEPTNO, OUTPUT_FILE TO TRANSACTION CONTROL TRANSFORMER WRITEDECODE (OUTPUT_FILE,1,TC_CONTINUE_TRANSACTION,0,TC_COMMIT_ Before).step 4connect to file target with the file name as deptno in target filename port.2)Ex.1st fileAAAAAAAAAAAAAAAAAAAAAAAAAA2nd fileBBBBBBBBBBBBBBBBBBBBBBBBBBOut put is third fileAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBB BBBBBBBBBBBNow for achieving this i am using session properties with file sequential merge but i am not getting it inthe third file. Even my third file is not created also after the successful Run of session. Please help me inthis and pls mention the procedure that in which file i have to give merge. and do i use command ininformatica session level properties.I would like to tell all of you i can not Shell Script or even any command task. as the client does't want tobe done in unix.ANSWER:Why don,t you take both the files as source and merge them using union trans,and then load it to another flat file(Third file).just create another pipeline in same mapping to do that.
 join of two Flat files through Informatica
Asked by bhabesh palhar | posted Dec 7, 2009 | Replies (5)
Dear All,Please suggest how to join 2 flat Files through Informatica if both have no common columns.Flat file 1- The 2 columns are Employee name & Employee Number Flt File2-The 2 columns are Department name & Department Number Regards,Bhabesh

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->