Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Shell script error: integer expression expected

2718056Oct 28 2014 — edited Oct 29 2014

Hi,

I have a shell script:

if test $# -ne 3  

then

       echo "Error : Incorrect number of parameters"

     echo "Usage : install.sh fist_day_of_the_month user pass"

     echo ""

       exit 1

fi

#pas 1

sqlplus -s $2/$3 @pas1.sql $1 >> $0.log;

#verificare date nule

user=$2

passdb=$3

get_count () {

    sqlplus -s ${user}/${passdb} <<!

    set heading off

    set feedback off

    set pages 0

   

    SELECT   COUNT(TI.CUSTOMERID) 

  FROM   MBTIBUSER.TEMP_IB TI, MBTIBUSER.TEMP_MB TM

WHERE      TI.CUSTOMERID = TM.CUSTOMERID

        AND TI.REGULARFEEFORIB_AC IS NULL

         OR TI.INITIALFEEFORIB_AC IS NULL

         OR TM.INITIALFEEFORMOBILE_AC IS NULL

         OR TM.REGULARFEEFORMOBILE_AC IS NULL

         group by 1;

!

}

count=$(get_count)

echo $count

if [ "$count" -gt 0 ]; then

    echo "STOP! Nu exista curs valutar pentru ultima zi a lunii de facturat"

    sqlplus -s $2/$3 @STOP.sql >> $0.log;

else

    echo "OK"

fi

I have the error "integer expression expected" on the line :  if [ "$count" -gt 0 ]; then

Do you have any ideeas?

Thank you,

Claudiu

This post has been answered by SKP on Oct 29 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2014
Added on Oct 28 2014
4 comments
2,023 views