I have written a code that will give me the required output after executing it.
Below is the code:
#!/bin/ksh
sqlplus / << !EOF!
set verify off
set heading off
set pagesize 0
set feedback off;
select * from account where account_name='23553558101';
exit;
!EOF!`
The problem is that I'm getting all the non-required stuffs too, but I need the output only not other things along with that.
Below is the output I'm getting:
$ ./sqltest
SQL*Plus: Release 10.2.0.1.0 - Production on Mon May 29 17:32:52 2017
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining Scoring Engine and Real Application Testing options
17:32:52 OPS$SP1ITA1B@SVITPRD1 > 17:32:52 OPS$SP1ITA1B@SVITPRD1 > 17:32:52 OPS$SP1ITA1B@SVITPRD1 > 17:32:52 OPS$SP1ITA1B@SVITPRD1 > 17:32:52 OPS$SP1ITA1B@SVITPRD1 > 17:32:52 OPS$SP1ITA1B@SVITPRD1 > 56566309 23553558101 20-05-2017 05:41:00 57194135 20000184 64,56
20-05-2017 00:00:00 340393871 338845845 500 0
0
17:32:52 OPS$SP1ITA1B@SVITPRD1 > 17:32:52 OPS$SP1ITA1B@SVITPRD1 > Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining Scoring Engine and Real Application Testing options