Hi my UNIX Friends,
Im calling some SQL scripts through Unix Shell scripting.
How do I export the value of PL/SQL variable value into a Unix shell script variable?
Also could any one inform me about the 'search' and 'cut' utility of PL/SQL
(like 'grep' and 'cut' in Shell scripting).
... (10 Replies)
Hi Folks,
This is a small chunk of the bigger problem which i am facing and some help here will help me resolve the rest of the issue.
Problem is that i need to pass the value of a variable from a shell script to a SQL query (infact a lot of SQL's)
i have the following solution but somehow... (4 Replies)
hi I all ,
I have sql statment in my shell script , I pass two argument to the script I need to pass the this two arguments to the sql statment
example :
runsql.sh "1" "2"
sql :
updat tables_x set y=0
where
A=:x should subsituted by "1"
and
B=:y shuold subsituted bt "2"... (1 Reply)
Hi Gurus,
i have one requirement in unix script, i have a file called abc.txt in that few lines are there with the empid, i need to read each line and pass to .sql script.
ex:
abc.txt
2345
2346
1243
1234
i need to pass these arguments to .sql script rom unix
ex:
select * from... (1 Reply)
Hi Everyone,
Can anyone help me how do i call hash variable in to sql query in perl. Please see the script below
i have defined two Hash %lc and %tab as below
$lc{'REFF'}='V_RES_CLASS';
$lc{'CALE'}='V_CAP_CLASS';
$lc{'XRPD'}='V_XFMR_CLASS';
$tab{'V_RES_CLASS'}='V_MFR_SERS';... (6 Replies)
I have a requirement where i have a sql file (filetext.sql). This file contains a variable ss_code.
Now in a shell script im trying to replace the variable ss_code with a value contained in the shell script variable MTK_DC..tried the below in the script
MTK_DC="mit,cit,bit"
OUT=`awk -v... (4 Replies)
Here is the requirement, When I run the "run file KSH (sql)", it should substitute
'${pCW_Bgn_DT}' with 201120
and
'${pCW_End_DT}' with 201124
Input File
----------
$ cat prevwk.dat
201124 20110711
run file KSH (sql)
------------------
In this file, I want to use the variables... (1 Reply)
Hi Guys,
I am trying to pass a string variable from Unix shell script to sqlplus as a parameter.
I have tried using single quotes with the variable name but it does not work. Please help me with it.
I am using BASH.
My code:
Your help is much appreciated.
Thanks,
shil (2 Replies)
How to pass variable to sql file.
Im tryin in two ways,
Method 1:
my.sql
select * from table where col1 = '$1' and col2 = 'text';
Method 1execute: dbaccess database my.sql $var
Method2:
select * from table col1 in (`cat inputfile`) and col2 = 'text';
method... (2 Replies)
OS Solaris 10,
DB oracle 10g
Hello,
We currently have a BASH script that runs and moves image files from a remote server to the local db server. A snippet of the code shows that we are picking up all Images that are 'mtime -1'
some code...
for file in `ssh user@10.200.200.10 'find... (3 Replies)
Discussion started by: JonP
3 Replies
LEARN ABOUT CENTOS
dblink_exec
DBLINK_EXEC(3) PostgreSQL 9.2.7 Documentation DBLINK_EXEC(3)NAME
dblink_exec - executes a command in a remote database
SYNOPSIS
dblink_exec(text connname, text sql [, bool fail_on_error]) returns text
dblink_exec(text connstr, text sql [, bool fail_on_error]) returns text
dblink_exec(text sql [, bool fail_on_error]) returns text
DESCRIPTION
dblink_exec executes a command (that is, any SQL statement that doesn't return rows) in a remote database.
When two text arguments are given, the first one is first looked up as a persistent connection's name; if found, the command is executed on
that connection. If not found, the first argument is treated as a connection info string as for dblink_connect, and the indicated
connection is made just for the duration of this command.
ARGUMENTS
conname
Name of the connection to use; omit this parameter to use the unnamed connection.
connstr
A connection info string, as previously described for dblink_connect.
sql
The SQL command that you wish to execute in the remote database, for example insert into foo values(0,'a','{"a0","b0","c0"}').
fail_on_error
If true (the default when omitted) then an error thrown on the remote side of the connection causes an error to also be thrown locally.
If false, the remote error is locally reported as a NOTICE, and the function's return value is set to ERROR.
RETURN VALUE
Returns status, either the command's status string or ERROR.
EXAMPLES
SELECT dblink_connect('dbname=dblink_test_standby');
dblink_connect
----------------
OK
(1 row)
SELECT dblink_exec('insert into foo values(21,''z'',''{"a0","b0","c0"}'');');
dblink_exec
-----------------
INSERT 943366 1
(1 row)
SELECT dblink_connect('myconn', 'dbname=regression');
dblink_connect
----------------
OK
(1 row)
SELECT dblink_exec('myconn', 'insert into foo values(21,''z'',''{"a0","b0","c0"}'');');
dblink_exec
------------------
INSERT 6432584 1
(1 row)
SELECT dblink_exec('myconn', 'insert into pg_class values (''foo'')',false);
NOTICE: sql error
DETAIL: ERROR: null value in column "relnamespace" violates not-null constraint
dblink_exec
-------------
ERROR
(1 row)
PostgreSQL 9.2.7 2014-02-17 DBLINK_EXEC(3)