Sponsored Content
Top Forums Shell Programming and Scripting How to handle NULL value output from ISQL command? Post 302908611 by Sharma331 on Wednesday 9th of July 2014 06:43:58 AM
Old 07-09-2014
Quote:
Originally Posted by SriniShoo
Since you are writing the output to a file, If the file contains only that value, you can check the file size and email if it is 0 byte
But if the file contains the output as :
Code:
-----------
        NULL

(1 row affected)

How can it be 0 bytes?

---------- Post updated at 05:43 AM ---------- Previous update was at 04:36 AM ----------

I found a solution for this thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh + isql => output cut at 2 GB

Using a ksh script, I'm dumping the data from our sybase database into an output file. This output file is for what ever reason cut at 2GB. There is enough space on the unix machine and as there is no error message is received I have no clue to start looking for a solution. #!... (1 Reply)
Discussion started by: bereman
1 Replies

2. Shell Programming and Scripting

isql output file not created while running it through cron

#!/bin/ksh file="/pkgs/roots/scripts/ISQL_op.txt" isql -H 11.11.11.111:1111 -U myUser -P myPwd -o $file << eof go select * from Table1 go eof my cron entry 00 08 03 11 * /pkgs/roots/scripts/testc.ksh file permission of the script is correct, i have used absolute path everywhere. ... (2 Replies)
Discussion started by: vikram3.r
2 Replies

3. Shell Programming and Scripting

isql output

hi all i m running following code # set up environment . /u/pimms/pimms_global.ksh echo "Get record from database" #echo ${PIMMS_ID} #echo ${PIMMS_PWD} #echo "1" isql -U${PIMMD_ID} -P${PIMMS_PWD} -S$SRV << eof > /sybase/applications/pimms/bin/automate1.txt use pimms ... (6 Replies)
Discussion started by: d_swapneel14
6 Replies

4. Shell Programming and Scripting

Formatting isql output to horizontal format

Hi I am formatting informix isql output(vertical) to horizontal format. Suppose I have the following content in the flat file from isql output - item_nbr 0 usfn_label Subscriber Class usfn_name SBCLASS usfn_value bl5 item_nbr 1 usfn_label Switch Name usfn_name switchName... (2 Replies)
Discussion started by: nsinha
2 Replies

5. Shell Programming and Scripting

Extract resultset numeric value from isql output ?

isql output comes as below, (0 rows affected) (1 row affected) (7 rows affected) How to extract the resultset number alone from the particular line ?? such as 0 1 7 (3 Replies)
Discussion started by: vikram3.r
3 Replies

6. Shell Programming and Scripting

How to assign record count output of isql to a shell variable ?

isql select count(*) from Table eof How to assign record count output of isql query to a shell variable ? (4 Replies)
Discussion started by: vikram3.r
4 Replies

7. Shell Programming and Scripting

Issue with redirecting a ISQL output to a file

Hi all, I have wrote a script to redirect the output of Sybase query to a file. Its a single XML message i am fetching with sybase query. The problem i faced here is the XML message line crosses the normal line limit in unix. Could some please help me how to get complete xml message... (1 Reply)
Discussion started by: ravin
1 Replies

8. Shell Programming and Scripting

Handle null values-awk

I am using below code to validate the source file,code working fine but if any column contains null value then below code throwing error actually it should not.how to customize the below code to handle null null values also. When I run the script with below source data getting “date error”, as... (2 Replies)
Discussion started by: srivalli
2 Replies

9. Shell Programming and Scripting

How to get the output of a ISQL command in a variable?

I am trying to run a query which returns a sum value(a number). I want to get it in a variable so that i can refer to that variable in different places. when i am running the following command variable=`isql -Uuser -Sserver -Ppassword 1> select sum(count(*)) from xyz..abc where clm_id... (2 Replies)
Discussion started by: Sharma331
2 Replies

10. UNIX for Beginners Questions & Answers

Accessing Isql command via VI editor

Hi Guru's, I'm new at Unix. I am tasked to monitor the filesystem utilization on OS level (Unix) and DB (Sybase) for multiple systems. I am thinking to use vi editor and make a file, execute that file and all the file systems I need to monitor will be be shown. My script inside vi goes in... (8 Replies)
Discussion started by: Xworks
8 Replies
OD(1)                                                              User Commands                                                             OD(1)

NAME
od - dump files in octal and other formats SYNOPSIS
od [OPTION]... [FILE]... od [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]] od --traditional [OPTION]... [FILE] [[+]OFFSET[.][b] [+][LABEL][.][b]] DESCRIPTION
Write an unambiguous representation, octal bytes by default, of FILE to standard output. With more than one FILE argument, concatenate them in the listed order to form the input. With no FILE, or when FILE is -, read standard input. If first and second call formats both apply, the second format is assumed if the last operand begins with + or (if there are 2 operands) a digit. An OFFSET operand means -j OFFSET. LABEL is the pseudo-address at first byte printed, incremented when dump is progressing. For OFFSET and LABEL, a 0x or 0X prefix indicates hexadecimal; suffixes may be . for octal and b for multiply by 512. Mandatory arguments to long options are mandatory for short options too. -A, --address-radix=RADIX output format for file offsets; RADIX is one of [doxn], for Decimal, Octal, Hex or None --endian={big|little} swap input bytes according the specified order -j, --skip-bytes=BYTES skip BYTES input bytes first -N, --read-bytes=BYTES limit dump to BYTES input bytes -S BYTES, --strings[=BYTES] output strings of at least BYTES graphic chars; 3 is implied when BYTES is not specified -t, --format=TYPE select output format or formats -v, --output-duplicates do not use * to mark line suppression -w[BYTES], --width[=BYTES] output BYTES bytes per output line; 32 is implied when BYTES is not specified --traditional accept arguments in third form above --help display this help and exit --version output version information and exit Traditional format specifications may be intermixed; they accumulate: -a same as -t a, select named characters, ignoring high-order bit -b same as -t o1, select octal bytes -c same as -t c, select printable characters or backslash escapes -d same as -t u2, select unsigned decimal 2-byte units -f same as -t fF, select floats -i same as -t dI, select decimal ints -l same as -t dL, select decimal longs -o same as -t o2, select octal 2-byte units -s same as -t d2, select decimal 2-byte units -x same as -t x2, select hexadecimal 2-byte units TYPE is made up of one or more of these specifications: a named character, ignoring high-order bit c printable character or backslash escape d[SIZE] signed decimal, SIZE bytes per integer f[SIZE] floating point, SIZE bytes per float o[SIZE] octal, SIZE bytes per integer u[SIZE] unsigned decimal, SIZE bytes per integer x[SIZE] hexadecimal, SIZE bytes per integer SIZE is a number. For TYPE in [doux], SIZE may also be C for sizeof(char), S for sizeof(short), I for sizeof(int) or L for sizeof(long). If TYPE is f, SIZE may also be F for sizeof(float), D for sizeof(double) or L for sizeof(long double). Adding a z suffix to any type displays printable characters at the end of each output line. BYTES is hex with 0x or 0X prefix, and may have a multiplier suffix: b 512 KB 1000 K 1024 MB 1000*1000 M 1024*1024 and so on for G, T, P, E, Z, Y. EXAMPLES
od -A x -t x1z -v Display hexdump format output od -A o -t oS -w16 The default output format used by od AUTHOR
Written by Jim Meyering. REPORTING BUGS
GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report od translation bugs to <http://translationproject.org/team/> COPYRIGHT
Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
Full documentation at: <http://www.gnu.org/software/coreutils/od> or available locally via: info '(coreutils) od invocation' GNU coreutils 8.28 January 2018 OD(1)
All times are GMT -4. The time now is 08:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy