Compare excel value with DB


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Compare excel value with DB
# 1  
Old 01-17-2011
Compare excel value with DB

Hi All ,

Please find my query below

I have to compare excel column value with column value in oracle table .
So can you please tell me how to store the value of an excel column in variable and check whether this value exist in particular table or not

Thanks for your kind help
# 2  
Old 01-17-2011
I think this query would be better suited to a windows/excel/odbc forum.

But in the event you are saving the excel file as a CSV or tab separated file, can you give us a sample of the input file and what have you done thus far to query the oracle database -- please remember to obscure the username and password you used in your connection string.
# 3  
Old 01-17-2011
Hi ,
Actually i tried to take the file column value with awk in a array variable and then try to compare with these values with the rows in table in oracle

Please check my input excel file
Code:
Id                       Value
1                         ABC
2                         DEF
3                         XYZ
4                         PQR

Now I have to check whether ID column values are present in certain oracle table column or not

Is it possible to go by my approach
Can we pass unix variable value in sql query

Any suggestion will help me a lot ...Thnx

Moderator's Comments:
Mod Comment
Please use code tags when posting data and code samples!

Last edited by vgersh99; 01-17-2011 at 01:15 PM.. Reason: code tags, PLEASE!
# 4  
Old 01-17-2011
If you were hand-coding the query ... what would it look like?
# 5  
Old 01-18-2011
Hi Ludwig,

So far I have not tried yet ,I just want to make sure from you gurus whether it is at all possible to take the column values in a unix variable and check this values whether they exist in some table or not
# 6  
Old 01-18-2011
You can use the SQL Loader utility to load the data in a the database and compare the data with SQL.
You may have a read of:

SQL*Loader FAQ - Oracle FAQ
# 7  
Old 01-18-2011
Hi Franklin

thnx for your suggestion , I had consider that earlier .
but isnt there any way to pass unix variable to sql query if thats possible then I can easily search whether the details exist in the table or not
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Compare data - Match first column and compare second

Hi guys, looking for some help with a way to compare data in two files but with some conditions. example, File 1 consists of site1,10.1.1.1 site2,20.2.2.2 site3,30.3.3.3 File 2 contains site1,l0.1.1.1 site2,50.1.1.1 site3,30.3.3.3 site4,40.1.1.1 I want to be able to match the... (1 Reply)
Discussion started by: mutley2202
1 Replies

2. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

3. Shell Programming and Scripting

Summing up the data from different excel sheet into one excel sheet

Hi Folks, Can you please advise for any script in unix such that for example , i have 3 different excel sheet at the location /ppt/gfr/exc so the name s of the excel sheet are 1excel.xslx 2excel.xslx 3excel.xslx now in these 3 different excel sheet there is lot of data for example each... (3 Replies)
Discussion started by: punpun66
3 Replies

4. UNIX for Dummies Questions & Answers

Search for string in a file then compare it with excel files entry

All, i have a file text.log: cover6 cover3 cover2 cover4 other file is abc.log as : 0 0 1 0 Then I have a excel file result.xls that contains: Name Path Pass cover2 cover3 cover6 cover4 (1 Reply)
Discussion started by: Anamika08
1 Replies

5. Shell Programming and Scripting

Perl script to Merge contents of 2 different excel files in a single excel file

All, I have an excel sheet Excel1.xls that has some entries. I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls These may be in different workbooks. They are totally independent made by 2 different users. I have placed them in a... (1 Reply)
Discussion started by: Anamika08
1 Replies

6. Shell Programming and Scripting

Writing excel file using perl : Excel file formatting changed

I am trying to create a program where user can input data in certain excel cells using user interface on internet....the programming is on perl and server is unix But when i parse data into excel the formatting of sheets is turned to default and all macro coding removed. What to do...Please... (7 Replies)
Discussion started by: mud_born
7 Replies

7. UNIX for Dummies Questions & Answers

To compare first two columns in an excel file

Hi All, i have a excel sheet with two columns as below. column1 column2 100 100 200 300 300 400 400 400 500 600 i need to compare the values these two columns and the output should be printed in the third column...if these values are equal the output should be green and if these... (2 Replies)
Discussion started by: arunmanas
2 Replies

8. Shell Programming and Scripting

Require compare command to compare 4 files

I have four files, I need to compare these files together. As such i know "sdiff and comm" commands but these commands compare 2 files together. If I use sdiff command then i have to compare each file with other which will increase the codes. Please suggest if you know some commands whcih can... (6 Replies)
Discussion started by: nehashine
6 Replies

9. Shell Programming and Scripting

PERL: Split Excel Workbook to Indiv Excel files

Hi, I am trying to find a way to read an excel work book with multiple worksheets. And write each worksheet into a new excel file using perl. My environment is Unix. For example: I have an excel workbook TEST.xls and it has Sheet1, Sheet2, Sheet3 worksheets. I would like to create... (2 Replies)
Discussion started by: sandeep78
2 Replies

10. Shell Programming and Scripting

Compare two arrays in sh or compare two fields

I want a soultion to compare two arrays in sh with an easy way.I want a solution to synchrose users between different AIX servers where no NIS is available. All users are meant to be same on all 10 servers. So the approach is to consider first server as master user repository and whatever the users... (0 Replies)
Discussion started by: rijeshpp
0 Replies
Login or Register to Ask a Question