Forming a query in unix level


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Forming a query in unix level
# 1  
Old 11-06-2011
Forming a query in unix level

Hi,

I will execute a query in sqlplus and redirect to a file.
The file will contains the date value such as 2011-04-12 02:00:00.
i want to make the content of the file such as,
Code:
select * from table where col1>to_date('2011-04-12 02:00:00','yyyy-mm-dd HH24:MI:SS').

Apar from the bold one(which we got the result from query), the remaining text are always constant.
How i can do this in unix script?

Thanks

Last edited by vbe; 11-06-2011 at 05:43 AM.. Reason: code tags
# 2  
Old 11-06-2011
In order to do that you would have to have access to you RDBMS that normally understand what you are talking about but of that you say nothing and the shell script will only be a call to connect and giving in input the SQL request till e.g. EOF
There are plenty samples on the forum for you to search
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Query about Block Level Migration

Hi We are planning to migrate to a new SAN storage environment. Our RHEL5.5 servers boot over SAN. 1. I was wondering if using "lvm mirroring" or "pvmove" would be a solution. 2. Do they do block level transfer? Thanks (1 Reply)
Discussion started by: ikn3
1 Replies

2. Red Hat

SSL certificate generation on OS level or application level

We have a RHEL 5.8 server at the production level and we have a Java application on this server. I know of the SSL certificate generation at the OS (RHEL) level but it is implemented on the Java application by our development team using the Java keytool. My doubt is that is the SSL generation can... (3 Replies)
Discussion started by: RHCE
3 Replies

3. UNIX for Dummies Questions & Answers

Online UNIX intermediate level documentation

Hi, Can maybe some of the UNIX-guys recommend an online UNIX intermediate level documentation with examples (not too dry :-). More the post-beginner level, for someone who has to play around with files and directories, with chmod, grep, sed, a little awk maybe... bw, Omar KN (once tasted... (2 Replies)
Discussion started by: OmarKN
2 Replies

4. Shell Programming and Scripting

forming group script from a text file

I am trying to make group of number of ID's. I have prepared following perl script but it does not provide any output. INPUT File 0174 0175 0176 0177 CODE: #!/usr/bin/perl -w $memlst = "/tmp/test.txt"; $membercnt = `wc -l $memlst`; $memhd = `head -1 $memlst`; $memcnt1 = 1; $class... (1 Reply)
Discussion started by: dynamax
1 Replies

5. Shell Programming and Scripting

Forming an insert query using awk

Hi, I'm trying to form an insert sql query using shell programming. I have table named company with four columns 'company name', 'company id', 'company code' and 'last change id' I have to read the company name, company code and last change id from a file delimited by | which has around 10... (4 Replies)
Discussion started by: rakesh_s
4 Replies

6. UNIX for Dummies Questions & Answers

forming duplicate rows based on value of a key

if the key (A or B or ...others) has 4 in its 3rd column the 1st A row has to form 4 dupicates along with the all the values of A in 4th column (2.9, 3.8, 4.2) . Hope I explain the question clearly. Cheers Ruby input "A" 1 4 2.9 "A" 2 5 ... (7 Replies)
Discussion started by: ruby_sgp
7 Replies

7. Solaris

Difference between run level & init level

what are the major Difference Between run level & init level (2 Replies)
Discussion started by: rajaramrnb
2 Replies

8. UNIX for Dummies Questions & Answers

How to determine the level of OS in HP-UNIX

How can you determine the level ot the operating system on an HP UNIX System? (2 Replies)
Discussion started by: aschmid
2 Replies

9. UNIX for Advanced & Expert Users

How to disable application level logs in Unix?

Hi, I'm working in an application and the related Java code and the envrionment is in Unix server. We are generating the log messages using loggers of Java.util.log . But, the logs are not getting generated in the log files. We feel that the people who developed the system might have done some... (6 Replies)
Discussion started by: kelangovan
6 Replies

10. UNIX for Dummies Questions & Answers

Oot: Level 2 Unix Support? meaning

Hi all, I am sorry, I know this is not correct forum/silly question (usually this is requirement in some vacancies), but i hope someone can explain to me, what is the meaning of : SUN Tier 3 Support Tier 3 Application Installation Level 2 Solaris Level 2 AD MOM + DBA Thank you. (0 Replies)
Discussion started by: blesets
0 Replies
Login or Register to Ask a Question