Sponsored Content
Top Forums Shell Programming and Scripting Calling DB user from separate file in Shell script Post 302524479 by sathish.tn on Monday 23rd of May 2011 12:17:22 PM
Old 05-23-2011
Calling DB user from separate file in Shell script

Hi All,

I need to execute a SQL via shell script and i am connecting to Oracle DB by this way $USERNAME1/$PASSWORD1@$STRING1 and i need to get username, password and string from someother file stored in the Unix Directory. $Username, $Password and $String is stored in File A in Path A and i want to call it in the test.sh in Path B.

Format of File A.txt

Username=test_db
Password=*****
Instance=ORACLEDB

Require your assistance!!!

Regards,
Sathish
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with Calling sql file from shell script

I have created abc.sh file which will set the environment variables (UNIX env variables as well as ORACLE required variables like ORACLE_SID,ORACLE_HOME etc) and then calls a function file which checks for starts some logs and then it will try to execute the .sql file. The .sh, function file are as... (1 Reply)
Discussion started by: sskc
1 Replies

2. Shell Programming and Scripting

calling sql file from shell script

Hello everybody I need help calling sql file from shell script. Can anyone help me creating a small shell script which calls an sql file . The .sql file should contain some select statements like select emp_no from emp_table; select emp_id from emp_table; And the results should be... (6 Replies)
Discussion started by: dummy_needhelp
6 Replies

3. Shell Programming and Scripting

calling a cgi file from shell script????

Hi.. Is it possible to call a cgi program which is used to display a pop up message in the else part...On executing the script it directly prints the source code of the pop up screen.. Please if you have any idea,share with us.Thanks. #start success250=`grep -c failure... (1 Reply)
Discussion started by: elavv
1 Replies

4. UNIX for Advanced & Expert Users

Calling sql file from shell script

Hi I have a shell script that call a sql file. The sql file will create a spool file. My requirement is, when ever i get an OS error like file not found. I have to log it in a log file. Could some who worked in a like scenario help me by giving the code sample. Many Thanks.. (1 Reply)
Discussion started by: chintapalli001
1 Replies

5. Shell Programming and Scripting

calling a sql file in my shell script

Hi, I want to call a sql file in my shell script. see the below code:- if ] then ( isql -U${S_USER} -S${S_SERV} -w100 -b -h0 <<ENDSQL | sed -e "s/Password://" ${S_PWD} set nocount on go use ${S_DB} go // need to call a file name... (16 Replies)
Discussion started by: dazdseg
16 Replies

6. Shell Programming and Scripting

Calling sql file from shell script with parameters.

Hi, I am calling a sql file script.sql from shell script and passing few parameters also as shown below: sqlplus -S id/password @script.sql $param1 $param2 Now,In sql file I have to create a extract text file after querying oracle tables based on the parameters passed(param1,param2) as... (7 Replies)
Discussion started by: anil029
7 Replies

7. Shell Programming and Scripting

shell script hangs while calling sql file

I have a master shell script which calls some 40 shell scripts. All the shell scripts calls a sql file which executes some sql statements. I run these scripts in parallel such that it saves me time. When i executed them i saw some strange behavior. Firstly, I found that some scripts among the 40... (1 Reply)
Discussion started by: sushi
1 Replies

8. UNIX for Dummies Questions & Answers

need assistance on Calling DB user from separate file in Shell script

Hi All, I need to execute a SQL via shell script and i am connecting to Oracle DB by this way $USERNAME1/$PASSWORD1@$STRING1 and i need to get username, password and string from someother file stored in the Unix Directory. $Username, $Password and $String is stored in File A in Path A and i want... (1 Reply)
Discussion started by: sathish.tn
1 Replies

9. UNIX for Advanced & Expert Users

shell script to send separate mails to different users from a text file

Hi Friends, Could you guys help me out of this problem... I need to send an email to all the users and the email has to be picked from the text file. text file contains the no. of records like: Code: giridhar 224285 847333 giridhar276@gmail.com ramana 84849 33884... (0 Replies)
Discussion started by: giridhar276
0 Replies

10. Shell Programming and Scripting

unable to pass value to user prompt from calling shell script

This is my script structure main script calls configure script which needs to be run as a different user and the configure script calls my application installation script. the application instruction script prompts the user for a directory which I need to pass from my main or configure script. ... (4 Replies)
Discussion started by: cmastays
4 Replies
MSSQL_CONNECT(3)														  MSSQL_CONNECT(3)

mssql_connect - Open MS SQL server connection

SYNOPSIS
resource mssql_connect ([string $servername], [string $username], [string $password], [bool $new_link = false]) DESCRIPTION
mssql_connect(3) establishes a connection to a MS SQL server. The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling mssql_close(3). PARAMETERS
o $servername - The MS SQL server. It can also include a port number, e.g. hostname:port (Linux), or hostname,port (Windows). o $username - The username. o $password - The password. o $new_link - If a second call is made to mssql_connect(3) with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned. This parameter modifies this behavior and makes mssql_connect(3) always open a new link, even if mssql_connect(3) was called before with the same parameters. RETURN VALUES
Returns a MS SQL link identifier on success, or FALSE on error. CHANGELOG
+--------+------------------------------------+ |Version | | | | | | | Description | | | | +--------+------------------------------------+ | 5.1.0 | | | | | | | The $new_link parameter was added | | | | +--------+------------------------------------+ EXAMPLES
Example #1 mssql_connect(3) example <?php // Server in the this format: <computer><instance name> or // <server>,<port> when using a non default port number $server = 'KALLESPCSQLEXPRESS'; // Connect to MSSQL $link = mssql_connect($server, 'sa', 'phpfi'); if (!$link) { die('Something went wrong while connecting to MSSQL'); } ?> SEE ALSO
mssql_close(3), mssql_pconnect(3). PHP Documentation Group MSSQL_CONNECT(3)
All times are GMT -4. The time now is 05:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy