Lacking more specifications from you, here is code that does what you seem to want:
set feedback off
set echo off
set linesize 2000
set trimspool on
set pagesize 0
select 'Emp No | Emp Name | ...' from dual
/
select rpad(id,7)||'| '||rpad(first_name,9)||'| ...' from s_emp;
Be sure to copy, paste, and save this code to a script file (example "EmpText.sql", then from the SQL*Plus prompt, execute with "@EmpText".
Let us know if this is what you wanted.
Dave
Sandy, Utah, USA @ 17:45 GMT, 10:45 Mountain Time
I have another question. As I am very new to SQL Plus, I would like to know from where can I refer to the explaination on the coding eg, set feedback off = ? , ....etc...
In my example, above, the first 5 statements (all beginning with the word "set" are Oracle-proprietary SQL*Plus commands (not SQL commands). A link to a SQL*Plus command Quick Reference is "csis.gvsu.edu/GeneralInfo/Oracle/server.920/a90842/ch13.htm". An explanation of each SQL*Plus command (including each of the 5 "set" commands, above) appears alphabetically at that link.
Let us know if you have more questions after referring to that link.
Dave
Sandy, Utah, USA @ 06:29 GMT, 23:29 Mountain Time
Thanks for the help. It helps me a lot.
Now I am thinking how to def system year like if the system date = 17Nov2003 or 17/11/2003, it will pick only the year for me, that is 2003, any clues on this?
Look at TRUNC function. For your specific case TRUNC(SYSDATE, 'Y') returns only YEAR part of current date.
You may also use TO_CHAR to format date: TO_CHAR(sysdate, 'YYYY') returns character string '2003'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.