format mismatches


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users format mismatches
# 1  
Old 12-20-2009
format mismatches

Hi

I am spooling the table values in file in unix ,but the problem is date format in table 'dd/mm/yyyy' ,when strong into file 'dd-mon-yyyy'.I want the same format to loaded into files also.Any idea.

Code:
$ORACLE_HOME/bin/sqlplus -S "$db"<<! | tee -a >$INFA_HOME/server/infa_shared/CTRL.log

select * from TAB WHERE LOAD_TYPE='D';




from database

 select * from TAB WHERE LOAD_TYPE='D';
XX	11/30/2009	12/1/2009	



CTRL.log


Source                                            PREVIOUS_ CURRENT_B 
-------------------------------------------------- --------- --------- 
XX                                               30-NOV-09   01-DEC-09

Regards,
Akil
# 2  
Old 12-21-2009
SYDATE is a psuedo-column that Oracle provides. It is the current date/time.
You can use it to learn how to format a date.
Code:
select to_char(SYSDATE, 'DD-MON-YYYY') from dual;
select to_char(SYSDATE, 'DD-MM-YYYY') from dual;
select to_char(SYSDATE, 'DD/MM/YYYY') from dual;

in sqlplus try "help to_char"
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To get the exact mismatches from two csv files

Hello Guys, I am pretty new to unix shell scripting where in i need to compare two files which are comma separated files. So here i go with the file contents cty_id,grade_val,g_val_2,g_val_3 001,10,20,30 002,,,40 003,100,,10 grade_val,g_val_2,cty_id 10,20,001 41,,002 100,1,003... (4 Replies)
Discussion started by: Master_Mind
4 Replies

2. Shell Programming and Scripting

Using awk to output matches and mismatches between two files to one file

In the tab-delimited files, I am trying to match $1,$2,$3,$4,$5 in fiel1 with $1,$2,$3,$4,$5 in fiel2 and create and output file that lists what matches and what was not found (or doesn't match). However the awk below seems to skip the first line and does not produce the desired output. I think... (2 Replies)
Discussion started by: cmccabe
2 Replies

3. Shell Programming and Scripting

Using awk to output matches between two files to one file and mismatches to two others

I am trying to output the matches between $1 of file1 to $3 of file2 into a new file match. I am also wanting to output the mismatches between those same 2 files and fields to two separate new files called missing from file1 and missing from file2. The input files are tab-delimited, but the... (9 Replies)
Discussion started by: cmccabe
9 Replies

4. Shell Programming and Scripting

Need script for transferring bulk files from one format to text format

"Help Me" Need script for transferring bulk files from one format to text format in a unix server. Please suggest (2 Replies)
Discussion started by: Kranthi Kumar
2 Replies

5. Shell Programming and Scripting

perl module to convert xlsx format to xls format

Hi Folks, I have written a perl script that reads data from excel sheet(.xls) using Spreadsheet::ParseExcel module. But the problem is this module doesn't work for excel sheets with extension .xlsx. I have gone through Spreadsheet::XLSX module with which we can read from .xlsx file directly.... (1 Reply)
Discussion started by: giridhar276
1 Replies

6. Shell Programming and Scripting

Converting windows format file to unix format using script

Hi, I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix. My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies

7. Shell Programming and Scripting

Retaining the Unix CSV format in Excel format while exporting

Hi All, I have created a Unix Shell script whch creates a *.csv file and export it to Excel. The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example : if the Amount has the value as 3000000 User wants to be in 3,000,000 format. This Amount format... (2 Replies)
Discussion started by: rawat_me01
2 Replies

8. Shell Programming and Scripting

Compare two strings, and print lines containing mismatches

pls help me on this... and im really sorry because i really don't know where to start here... FILE1 ABC DEF 10 2 DEF GHI 11 3 GHI JKL 12 5 JKL MNO 13 7 MNO PQR 14 5 requirements: 1. The third string should only be 10 or 12 2. The fourth string should only be 2 or 3 3. Prinnt... (1 Reply)
Discussion started by: kingpeejay
1 Replies

9. UNIX for Dummies Questions & Answers

To convert multi format file to a readable ascii format

Hi I have a file which has ascii , binary, binary decimal coded,decimal & hexadecimal data with lot of special characters (like öƒ.ƒ.„İİ¡Š·œƒ.„İİ¡Š· ) in it. I want to standardize the file into ASCII format & later use that as source . Can any one suggest a way a logic to convert such... (5 Replies)
Discussion started by: gaur.deepti
5 Replies

10. Shell Programming and Scripting

Matches and mismatches in perl

When we give an input sequence , the program should match with the pattern and give the matches and mismatches in the output. i will give you 2 small examples. if you cant get it pls let me know. i will try to give a clear idea. example 1: $a=APPLE; # let it be a pattern... (0 Replies)
Discussion started by: srisha
0 Replies
Login or Register to Ask a Question