In my shell script, I am connecting to database and querying multiple columns in a table.
MESSAGE_TEXT=`sqlplus -s /nolog <<end_log_stmt
set heading off
set feedback off
set verify off
set termout off
set pages 0
CONNECT APPS/$USER_PWD
Select order_number, id, error_message from table some condition to get 1 row;
end_log_stmt`
While printing the MESSAGE_TEXT, I am getting the value as
"Connected. 1000301, 23343, Sample Error message. some time with full stop"
I have tried using cut command to cut the "Connected" string keeping full stop as delimiter. This is working if there is no full stop in error message.
Can anyone help me giving the script to cut the first word in message text.
Is there any way, I can format the results (HTML Table Format)
To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags
```text
and
```
by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
Thank You.
The UNIX and Linux Forums
Back to your question: just change the code like this:
MESSAGE_TEXT=`sqlplus -s <<end_log_stmt
APPS/$USER_PWD
set heading off
set feedback off
set verify off
set termout off
set pages 0
Select order_number, id, error_message from table some condition to get 1 row;
end_log_stmt`
In a loop where? In the database via PL/SQL or outside via shell script?
I would suggest using one database connection to get and format all data/output.