Extract only the data from ksh script running netezza query
Hi
I searched this forum before posting the question, but couldnt find it, the issue
i'm facing is, i'm trying to select a column from a netezza table from a korn
shell script, but the query runs
it returns the value like below from the script
is it possible to just extract only the "45" from the output, one thing to note
here is, the output can sometimes be a 1 digit or 2 digit or a 3 digit value
i tried this command
but no luck on it, then i thought of using the cut command, but due to the
varying number of digits each time, that would be a problem,
what i'm trying to find is more of a versatile solution, like few syntax's, where the query only returns the data and no header values,
but as i'm having few library issues in the netezza unix environment, i'm not able to use the "nzsql" option, i have to live with the nzodbcsql option
i'm still trying for other ways, meanwhile if you could provide a solution
that would be a great help
thanks
MJ
Last edited by maximus_jack; 08-18-2014 at 06:26 PM..
Reason: added few more reasons
Hi
thanks for your response, i have tried that, it seems the query header, the underline and the data all seems to be considered as the first value, below is the script and the output
Output
Hello All,
Greetings !!
I have a query here to all is as follows:
Question: Let's say we are running a script in a UNIX box and we have opened an another session and then made changes in script of some statements NOT to be print some values(just an example) so when I am monitoring the... (5 Replies)
Hi
I'm trying run a netezza select query from a korn shell script, i'm getting the
data in the below format, is there any way to get only the data in a vairable,
Column_name
--------------------
2014:08:01 12:51:00
i just want the last line which is "2014:08:01 12:51:00"
the command... (2 Replies)
Using ksh, I am using SQLPlus to execute a query with a filter using a string variable.
REPO_DB=DEV1
FOLDER_NM='U_nmalencia'
FOLDER_CHECK=$(sqlplus -s /nolog <<EOF
CONNECT user/pswd_select@${REPO_DB}
set echo off heading off feedback off
select subj_name
from subject
where... (5 Replies)
Hi I was trying to fetch data from database. But the number of rows exported were huge so i got the error. Experts please advice. Thanks a lot for your supprt. #: ./script.sh ./script.sh: xmalloc: subst.c:3076: cannot allocate 1401346369 bytes (0 bytes allocated) (2 Replies)
Hello!
I'm trying to run this code to print the body of an html document (all text in between <body> and </body>) from a script but am unsure how to call it from the command line interface.
/<body>/,/<\/body>/
1s/.*<body>//
$s/<\/body>.*//p
I have tried to call it using this:
sed... (6 Replies)
Hi,
I'm trying to run database restore script with the nohup command as it will run for long hours since if I run it normally, the putty session will become inactive and the restore gets terminated. The command I use is
nohup db2 -tvf FBR_NODE0000.scr -z FBR_NODE0000.log &
But the problem is... (2 Replies)
i have a script that performes an update operation. I just wanted to know whether that update statement is successfull or not.
Below the script:
#!/bin/ksh
. $HOME/conf/systemProperties/EnvSetup.properties
sqlplus -silent sie/da@edn.world <<END
set pagesize 0 feedback off verify off... (3 Replies)
1 #!/bin/ksh
2 ################################################################
3 # Written by Johnson 12/03/2008
4 # Version 1.0
5 # This script executes some SQL to provide Spike Check Report to TNS team.
6 ... (3 Replies)
I tried to run my ksh scripts in SFU and it always says "not found" as in the example below:
$ .file
/bin/ksh: .file: not found
Did I miss something in the SFU Installation? (2 Replies)
Hi,
I have a scenario where in i have to extarct max of one column and pass it to a variable.
i have tried to export the result as .dat file and read from that file.But my database is mainframe and it is not permitting me to export in .dat file.I have tried using .ixf file but reading from... (2 Replies)