Hi All,
In the below script, I am calling one sql file test.sql If this file returns any data then I have to generate this file test_$RUN_DATE.FCNA If the sql files returns no data then I dont want to generate this file test_$RUN_DATE.FCNA.
I tried one approach like: check the size of FCNA files and based on this I am deleting the FCNA file. But, client are not okay with deletion of file.
IS there any to handle this requirement.
Moderator's Comments:
Please wrap all code, files, input & output/errors in CODE tags.
It makes them far easier to read and preserves multiple spaces for indenting or fixed width data.
Last edited by rbatte1; 10-20-2015 at 07:02 AM..
Reason: Wrapped in CODE tags
i have the following perl script.but it searches for a given filename.
i want to run the same script in my directoy which has subdirectories too and it has to display the file if sreach satisfies along with directory name.
can anyone help me:
perl script:
my $FILE = $ARGV;
for zf in... (4 Replies)
Hi All
I have files contains rows which look like this:
2 20090721_16:58:47.173 JSUD2 JD1M1 20 IAM 966591835270 249918113182 b 3610 ACM b 3614 ACM b 3713 CPG b 3717 CPG f 5799 REL b 5815 RLC b 5817 RLC :COMMA: NCI=00,FCI=6101,CPC=0A,TMR=00,OFI=00,USI: :COMMB: BCI=1234: :RELCAUSE:10:
... (1 Reply)
Hi all
Iam very new to Shell Scripting, I have to modify a shell script looking at an existing one except that it will query against some table X in A database.
Befor Spooling check if there are any reload files if there archive the files.
The above scipt executes some abc.sql which will b a new... (2 Replies)
Hi
I have a rsync that runs from a remote location to our central data store.
The sync generates a log locally not in the central location.
I would like to modify the rsync to add the following
The log, instead of filing locally it gets sent to a area on the central data store
once the syncs... (0 Replies)
I want the below script to omit every chunk of data that contains a specific hostname.
here's the scenario. i have a configuration file that contains the configuration of several hosts. a sample of this configuration file is this:
define host {
address ... (12 Replies)
hi guys,
i have a script that basically just sums up the values of 2 particular columns in a file, grouped by the columns specified as well
The script is quite long, but it's basically just repetitive.. just for each condition.
This script only accepts one type of input file.
... (22 Replies)
Hi
I have some list of files in a .dat
i need to read them line by line and assing them to variables.
For ex: list of files are some,some1
i need two variables g1 as some and g2 as some1.
and then need to perform some operations on g1 and g2
for which i can get some o/p, i need to capture... (2 Replies)
Hi,
I have below script, i want to monitor that that ntp server listed in setting is under sync or not. I wrote below script but it is not working properly.
Here are problems, first it should server under sync if "*" shows and rest if shows "+" it means it is next server in waiting list.... (4 Replies)
can someone help me identify what i'm doing wrong here:
awk -F'|' 'BEGIN{c=0} /./ && /./ {
if ($3 < 2) { print ; c++ } END { print c":OK" }
else if (($3 >= 2) && ($3 < 4)) { print ; c++ } END { print c":WARNING" }
else if ($3 >= 4) { print ; c++ } END { print c":CRITICAL" }
}'... (4 Replies)
Discussion started by: SkySmart
4 Replies
LEARN ABOUT CENTOS
dblink_open
DBLINK_OPEN(3) PostgreSQL 9.2.7 Documentation DBLINK_OPEN(3)NAME
dblink_open - opens a cursor in a remote database
SYNOPSIS
dblink_open(text cursorname, text sql [, bool fail_on_error]) returns text
dblink_open(text connname, text cursorname, text sql [, bool fail_on_error]) returns text
DESCRIPTION
dblink_open() opens a cursor in a remote database. The cursor can subsequently be manipulated with dblink_fetch() and dblink_close().
ARGUMENTS
conname
Name of the connection to use; omit this parameter to use the unnamed connection.
cursorname
The name to assign to this cursor.
sql
The SELECT statement that you wish to execute in the remote database, for example select * from pg_class.
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 OK or ERROR.
NOTES
Since a cursor can only persist within a transaction, dblink_open starts an explicit transaction block (BEGIN) on the remote side, if the
remote side was not already within a transaction. This transaction will be closed again when the matching dblink_close is executed. Note
that if you use dblink_exec to change data between dblink_open and dblink_close, and then an error occurs or you use dblink_disconnect
before dblink_close, your change will be lost because the transaction will be aborted.
EXAMPLES
SELECT dblink_connect('dbname=postgres');
dblink_connect
----------------
OK
(1 row)
SELECT dblink_open('foo', 'select proname, prosrc from pg_proc');
dblink_open
-------------
OK
(1 row)
PostgreSQL 9.2.7 2014-02-17 DBLINK_OPEN(3)