Script returning null results


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script returning null results
# 1  
Old 04-20-2009
Script returning null results

Hi,

The following shell script returning null results could you please tell me whats the problem in script,

*********************************
#!/bin/ksh
. $HOME/conf/systemProperties/EnvSetup.properties
a=`date +"%y%m%d"`
set -x
for i in `cat /ednpdtu7/u01/pipe/Outgoing/TNS/Configuration/test.txt`
do
echo $i
report=`sqlplus -silent siebel/da!!a5s@ednamip.world <<END
set pagesize 0 feedback off verify off heading off echo on
select meter.x_electronic_id from
siebel.s_asset meter,
siebel.s_asset cm,
siebel.s_asset_rel armcm
where
armcm.par_asset_id = cm.row_id and
armcm.asset_id = meter.row_id and
armcm.relation_type_cd = 'COMMUNICATION-METER' and
armcm.x_rel_status = 'Active'
and cm.serial_num = ('$i');
exit;
END`
echo $report
done
********************************
# 2  
Old 04-20-2009
Does "echo $i" in the 'for loop' show the value of i before the sql is executed? Does the sql itself also returns any value if run outside of the script?
# 3  
Old 04-20-2009
Try with set spool on as by default it will be off.

Cheers gehlnar
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Ls returning differing results

Hi there. I have several raspberries, Im currently logged (ssh) into 2 of them, both identical os, same user, both up to date. Both mounted to a Nas, but when I ls the same dir on the Nas one lists all the 1498 files, one lists a random subset of files, about 30. I had a problem yesterday... (2 Replies)
Discussion started by: MuntyScrunt
2 Replies

2. UNIX for Beginners Questions & Answers

Ldapsearch returning base64 encoded results

So my ldapsearch works great, except for some results I found today. My search is: /usr/lib64/mozldap/ldapsearch -T -h 10.1.1.1 -p 3891 -D "uid=datapower,ou=People,dc=blah,dc=com" -w xxxxxx -b "ou=Certs,dc=blah,dc=com"... (0 Replies)
Discussion started by: primerib
0 Replies

3. Programming

Malloc function returning NULL

Hi All, I am using malloc function for allocating dynamic memory. When I am using below code on Linux server its working fine, but When I am trying the same code on HP UNIX server its returning NULL. below is a fragment of code in which it is giving problem. tmp = (format_tree... (4 Replies)
Discussion started by: Taher Saifuddin
4 Replies

4. Programming

Getpwnam_r returning null with errno 25

I am calling getpwnam_r with all proper argument as below:- rv = getpwnam_r(name, result, buffer, buflen); This program runs fine on sol 8/9/10. But on sol 11 it returns NULL with errno set to 25 (#define ENOTTY 25 /* Inappropriate ioctl for device */) All boxes are... (2 Replies)
Discussion started by: Ranajit
2 Replies

5. UNIX for Advanced & Expert Users

getservbyname returning NULL

OS : Solaris 10 When I try to get the "echo" service port, getservbyname is returning null. I checked - /etc/services having an entry for echo - echo 7/tcp (But still getservbyname returning null) Any other config required to consider? (1 Reply)
Discussion started by: satish@123
1 Replies

6. UNIX for Dummies Questions & Answers

cp output /dev/null results in not a directory

Hello, I am working on a script to measure the read performance of a busybox environment. The logical choice is to use a command line like: (time cp * /dev/null) 2> /tmp/howlong.txt Ah, the rub is cp or /dev/null will only accept a single file at a time. The result in the txt file is and... (1 Reply)
Discussion started by: stevesmo
1 Replies

7. Programming

getservbyport - Always returning NULL servent

Hi, I am having an issue using getservbyport. Here is a little program to demonstrate the problem (removed the includes): int main(void) { struct servent *service; int memsize = sizeof(struct servent); service = (struct servent *)malloc(memsize); ... (2 Replies)
Discussion started by: goon12
2 Replies

8. UNIX for Dummies Questions & Answers

malloc returning NULL if freemem high & swapmem low (MPRAS version 3.03 )

Hi All,:) In my application malloc is returning NULL even though there is sufficient amount of free memory available but the swap memory is low. Is this possible that, if free memory is high & swap memory is low, malloc will not be able to allocate memory & return NULL ? Few details: ... (4 Replies)
Discussion started by: Ritesh Kumar
4 Replies

9. Solaris

malloc returning NULL if freemem high & swapmem low

Hi All, In my application malloc is returning NULL even though there is sufficient amount of free memory is available but swap memory is low. Is this possible that, if free memory is high & swap memory is low, malloc will not be able to allocate memory & return NULL ?:) Kindly look into... (5 Replies)
Discussion started by: Ritesh Kumar
5 Replies

10. Shell Programming and Scripting

returning to the parent shell after invoking a script within a script

Hi everybody, I have a script in which I'm invoking another script which runs in a subshell. after the script is executed I want to return to the parent shell as some variables are set. However i'm unable to return to my original shell as the script which i'm calling inside is invoked in... (5 Replies)
Discussion started by: gurukottur
5 Replies
Login or Register to Ask a Question