The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Delimiters missing Indalecio Shell Programming and Scripting 2 02-23-2007 01:28 AM
Missing functions HELP! sha1024 High Level Programming 1 02-05-2007 12:06 PM
missing CDE frankkahle SUN Solaris 5 05-25-2006 02:35 PM
/tmp is missing ???? BAM UNIX for Dummies Questions & Answers 1 11-05-2002 11:50 AM
/dev/fb* missing heinb UNIX for Dummies Questions & Answers 5 02-12-2002 02:22 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-13-2005
Registered User
 

Join Date: Jun 2005
Location: Champaign, IL
Posts: 19
Unhappy what am I missing?

I have the following portion of a script

Code:
Check()
{
echo "\n\nChecking that all constraints are Enabled"
echo "..."
sleep 2
CHECK_COUNT='sqlplus -s $1 <<-EOSQL4
set feed off pause off pages 0 head off;
set linesize 150 echo off;
select count(*) from user_constraints where status='DISABLED';"
quit;
EOSQL4'

if [ $CHECK_COUNT -eq 0 ]
then
    echo "\nThe following $CHECK_COUNT constraint(s) could not be enabled!"
    #sqlplus -s $1 <<-EOSQL
    #set feed off pause off pages 0 head off;
    #spool ref_con_errors.log;
    #select constraint_name,table_name from user_constraints where status='DISABLED';
    #spool off;
    #quit;
    #EOSQL
    #echo "\nPlease view 'ref_con_errors.log' for details on which constraints"
    echo ""
else
    echo "\nAll Constraints are enabled"
    echo ""
fi
}
this is the output I get from it:

Checking that all constraints are Enabled
...
Check[12]: -s: unknown test operator

All Constraints are enabled


How do I get rid of this error?

Thanks,
Zelp
Reply With Quote
Forum Sponsor
  #2  
Old 06-13-2005
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
Code:
CHECK_COUNT='sqlplus -s $1 <<-EOSQL4
set feed off pause off pages 0 head off;
set linesize 150 echo off;
select count(*) from user_constraints where status='DISABLED';"
quit;
EOSQL4'
See the two red tick marks - they need to be backtick characters.
Remove the red dash
Reply With Quote
  #3  
Old 06-13-2005
Registered User
 

Join Date: Jun 2005
Location: Champaign, IL
Posts: 19
i tried that and now I get

Checking that all constraints are Enabled
...
Check[12]: ORA-01740:: unknown test operator

All Constraints are enabled


anymore help?
Reply With Quote
  #4  
Old 06-13-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,029
Code:
if [ "$CHECK_COUNT" -eq 0 ]
also it seems like your sql does not return a NUMBER.... debug it stand-alone first.

select count(*) from user_constraints where status='DISABLED';"
Reply With Quote
  #5  
Old 06-13-2005
Registered User
 

Join Date: Jun 2005
Location: Champaign, IL
Posts: 19
yeah, it was that darn quote after 'DISABLED';

and BTW, you can leave the (minus) in the <<-EOSQL4

by adding the minus it removes any un-wanted TAB characters in the SQL.

Thanks so much guys!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:13 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0