Sponsored Content
Top Forums Shell Programming and Scripting how to use data in unix text file as input to an sql query from shell Post 302330405 by jayan_jay on Wednesday 1st of July 2009 06:44:32 AM
Old 07-01-2009
Make the changes to this line as
$ORACLE_HOME/bin/sqlplus -s username/Password >> TmpOutputFile <<!

then it will append the output of all the lines... Finally make use of this name to send mails.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sql query results in unix shell script

Hi I want to get the a field from a SQL query into unix shell script variable. the whole situation is like this. 1. Opened a cursor to a table in DB2 databse. 2. Fetching individual rows with the help of cursor. 3. Each row has 4 fields. I want each of the field in individual shell... (1 Reply)
Discussion started by: skyineyes
1 Replies

2. UNIX for Dummies Questions & Answers

How do I use SQL to query based off file data?

This is basically what I want to do: I have a file that contains single lines of IDs. I want to query the oracle database using these IDs to get a count of which ones match a certain condition. the basic idea is: cat myfile | while read id do $id in select count(PC.ptcpnt_id) from... (4 Replies)
Discussion started by: whoknows
4 Replies

3. Shell Programming and Scripting

How to use sql data file in unix csv file as input to an sql query from shell

Hi , I used the below script to get the sql data into csv file using unix scripting. I m getting the output into an output file but the output file is not displayed in a separe columns . #!/bin/ksh export FILE_PATH=/maav/home/xyz/abc/ rm $FILE_PATH/sample.csv sqlplus -s... (2 Replies)
Discussion started by: Nareshp
2 Replies

4. Shell Programming and Scripting

Need help to run sql query from a script..which takes input from a file

I need to run sql script from shell script which takes the input from a file and contents of file will be like : 12345 34567 78657 and query will be like : select seq_nbr from bus_event where event_nbr='12345'; select seq_nbr from bus_event where event_nbr='34567'; select seq_nbr... (1 Reply)
Discussion started by: rkrish
1 Replies

5. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

6. Shell Programming and Scripting

How can i run sql queries from UNIX shell script and retrieve data into text docs of UNIX?

Please share the doc asap as very urgently required. (1 Reply)
Discussion started by: 24ajay
1 Replies

7. Shell Programming and Scripting

Shell scripting unable to send the sql query data in table in body of email

I have written a shell script that calls below sql file. It is not sending the query data in table in the body of email. spool table_update.html; SELECT * FROM PROCESS_LOG_STATS where process = 'ActivateSubscription'; spool off; exit; Please use code tags next time for your code and data.... (9 Replies)
Discussion started by: Sharanakumar
9 Replies

8. Shell Programming and Scripting

Read input file and used it to SQL query

Hi All, Seeking for your assistance to read each line $1 and $2 of input file and used it to query. Ex. file1.txt(number range) 9064500000 9064599999 9064600000 9064699999 9064700000 9064799999 Database name: ranges_log a_no message 9064500001 test 9064700000 ... (7 Replies)
Discussion started by: znesotomayor
7 Replies

9. UNIX for Dummies Questions & Answers

Inserting shell script input data automatically from a text file

Dear experts, I am new to linux programming. I have a shell script which i should run it on all my samples. I only define input and out put for this script. The inputs are 3 numbers(coordination numbers) which are available in a series of text file. Since i have a lots of samples, it takes a... (5 Replies)
Discussion started by: mohamadreza
5 Replies

10. Shell Programming and Scripting

Run sql query in shell script and output data save as delimited text

I want to run sql query in shell script and output data save as delimited text (delimited text would be comma) Code: SPOOL_FILE=/pgedw/dan.txt SQL=/pgedw/dan.sql sqlplus -s username/password@myhost:port/servicename <<EOF set head on set COLSEP , set linesize 32767 SET TRIMSPOOL ON SET... (8 Replies)
Discussion started by: Jaganjag
8 Replies
rexecd(8c)																rexecd(8c)

Name
       rexecd - remote execution server

Syntax
       /etc/rexecd

Description
       The  command  is  the  server  for the routine.	The server provides remote execution facilities with authentication based on usernames and
       encrypted passwords.

       The command is invoked by when it receives a connection on the port indicated in the ``exec'' service specification.  For further  informa-
       tion, see When a service request is received the following protocol is initiated:

       1) The server reads characters from the socket up to a null (`') byte.  The resultant string is interpreted as an ASCII number, base 10.

       2) If  the  number received in step 1 is non-zero, it is interpreted as the port number of a secondary stream to be used for the stderr.  A
	  second connection is then created to the specified port on the client's machine.

       3) A null terminated username of at most 16 characters is retrieved on the initial socket.

       4) A null terminated password of at most 16 characters is retrieved on the initial socket.

       5) A null terminated command to be passed to a shell is retrieved on the initial socket.  The length of the command is limited by the upper
	  bound on the size of the system's argument list.

       6) The  command	then  validates  the  user  as is done at login time and, if the authentication was successful, changes to the user's home
	  directory, and establishes the user and group protections of the user.  If any of these steps fail the  connection  is  aborted  with  a
	  diagnostic message returned.

       7) A  null  byte  is  returned on the connection associated with the stderr and the command line is passed to the normal login shell of the
	  user.  The shell inherits the network connections established by

Diagnostics
       All diagnostic messages are returned on the connection associated with the stderr, after which any  network  connections  are  closed.	An
       error  is indicated by a leading byte with a value of 1 (0 is returned in step 7 above upon successful completion of all the steps prior to
       the command execution).

       username too long
       The name is longer than 16 characters.

       password too long
       The password is longer than 16 characters.

       command too long
       The command line passed exceeds the size of the argument list (as configured into the system).

       Login incorrect
       No password file entry for the username existed.

       Password incorrect
       The wrong was password supplied.

       No remote directory
       The command to the home directory failed.

       Try again
       A fork by the server failed.

       /bin/sh: ...
       The user's login shell could not be started.

Restrictions
       Indicating ``Login incorrect'' as opposed to ``Password incorrect'' is a security breach which allows people to probe a	system	for  users
       with null passwords.

See Also
       inetd(8c)

																	rexecd(8c)
All times are GMT -4. The time now is 08:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy