I am trying to run a query which returns a sum value(a number).
I want to get it in a variable so that i can refer to that variable in different places.
when i am running the following command
variable=`isql -Uuser -Sserver -Ppassword
1> select sum(count(*)) from xyz..abc where clm_id in(43517830,80226100,340223200,70217600,400222400,720221500,920220600,970226100,990223800) group by clm_id
2> go`
The output of the variable comes as below
ksh[4]: 0403-057 Syntax error: `(' is not expected.
Maybe saying more about your system (OS + version and shell you use) may help us understand...
ksh standard syntax for giving values to a variable which comes from some sort of command execution is:
VAR=$( command...)
and so using "(" etc will be interpreted by the shell...