2 t2val=$(cat /home/trnid | tr '\n' ',' | sed 's/,$//')
3 sqlplus -s <username>/<passwd>@dbname > /home/file << EOF
4 set echo on
5 set pagesize 0
6 set verify off
7 set lines 32000
8 set trimspool on
9 set feedback off
10 SELECT *
FROM <dbname>.<tablename1> tr
LEFT JOIN <tablename2> t2 ON t2.id2 = tr.id1
LEFT JOIN <tablename3> t3 ON t3.id2 = tr.id1
LEFT JOIN <tablename4> t4 ON t4.id2 = tr.id1
WHERE tr.TIMESTAMP > SYSDATE - 75 / 1440
AND tr.TIMESTAMP <= SYSDATE - 15 / 1440
and t2.value in ( "t2val")
order by timestamp;
26 exit;
27 EOF
trnid file has total of 32000 lines (each number on separate line). The length of each number is 11 digits.
:
7499
SP2-0027: ( > 2499 ) -
7499
SP2-0027: ( > 2499 ) - .
In a previous error, I got bcoz i by inserting numbers into the trnid file, separated by commas and on another line. In this case, I used only the command:
t2val=$(cat /home/trnid )
source
share