Hi all. I am writing a ksh script that runs a bunch of SQL. I have a sql command that does something like this:
v_seqno=$(sqlplus -S databaseinfo <<EOF
select seq_no from table;
EOF
)
I can echo $v_seqno and I see the result (i.e. 1916). Later on, I want to use that value in another query. So I do this:
select * from table2 where seq_no = $v_seqno;
I get this error:
1916)
*
ERROR at line 69:
ORA-00920: invalid relational operator
I have tried converting v_seqno to an integer using typeset -i and I get errors on that. I'm not sure what I'm doing wrong here. I'd appreciate any input.
v_seqno=$(sqlplus -S databaseinfo <<EOF
select seq_no from table;
EOF
)
I can echo $v_seqno and I see the result (i.e. 1916). Later on, I want to use that value in another query. So I do this:
select * from table2 where seq_no = $v_seqno;
I get this error:
1916)
*
ERROR at line 69:
ORA-00920: invalid relational operator
I have tried converting v_seqno to an integer using typeset -i and I get errors on that. I'm not sure what I'm doing wrong here. I'd appreciate any input.