- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- select script returns no results
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2006 09:39 AM
тАО03-09-2006 09:39 AM
#!/usr/bin/sh
>GSG.not.in.ac; >GsG.in.ac
cat GSG.class |while read i
do echo $i
var=`sqlplus -s admin/admin <
SELECT count (cct)
FROM table
WHERE CCT = '$1';
exit
EOF`
if [ $var -eq 0 ]; then
echo $i >>GSG.not.in.ac
else
echo $i>>GSG.in.ac
fi
done
Flat file looks like:
GSG44U104186000TSYS000
GSG44U105141000TSYS000
GSG44U105142000TSYS000
GSG44U105143000TSYS000
GSG44U105144000TSYS000
GSG44U105169000TSYS000
GSG44U107608000TSYS000
...
...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2006 09:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2006 09:51 AM
тАО03-09-2006 09:51 AM
Re: select script returns no results
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2006 09:56 AM
тАО03-09-2006 09:56 AM
Re: select script returns no results
cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2006 10:09 AM
тАО03-09-2006 10:09 AM
Re: select script returns no results
GSG44U104186000TSYS000 lets me assume to be very much a sting. So single quoutes seem to me a proper solution, which might interfere with the reverse quotes.
May be they need to be escaped.
What did you try when you included a record directly ? Just the sqlplus or the entire assignment to "var" ?
so may be either
WHERE CCT = '$i';
or
WHERE CCT = \'$1\';
could be of help ?!!?
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2006 11:46 AM
тАО03-09-2006 11:46 AM
Re: select script returns no results
Your script is fine whether single or double quotes.
Only change is WHERE CCT = '$1'; the comparing vaue is in $i and not $1.
And also make sure that your text on the flat file does not have any special chanracters towards the end. In whcih case you will have to use the 'like' instead of '='
Like '%$i%' instead of = '$i'.
I tested with the same flat file that you gave and it works fine with the = '$i'
Indira A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2006 01:26 PM
тАО03-09-2006 01:26 PM
Re: select script returns no results
$i instead of $1
I cant believe I did that!
Thanks!