Sqlplus tip spool files in specified format

Source: Internet
Author: User
Welcome to the Oracle community forum. There are a lot of skills to interact with 2 million technicians and enter sqlplus. I will summarize it later. SQLcolumnFnew_valFSQLselectto_char (sysdate, yyyymmddhh24miss) | .txtffromdual=f--------------200501241700006.txt SQLspoolFC

Welcome to the Oracle community forum and interact with 2 million technical staff> there are many tips for entering sqlplus. I will summarize them later. SQL column F new_val f SQL select to_char (sysdate, 'yyyymmddhh24mis') | '.txt 'F from dual; F ---------------- 20050124174924926.txt SQL spool F C

Welcome to the Oracle community forum and interact with 2 million technical staff> enter

Sqlplus has many techniques and will be summarized later.

SQL> column F new_val F
SQL> select to_char (sysdate, 'yyyymmddhh24mis') | '.txt 'f from dual;

F
------------------
20050124174926. txt

SQL> spool & F

Connected:
Oracle8i Enterprise Edition Release 8.1.7.0.0-Production
With the Partitioning option
JServer Release 8.1.7.0.0-Production

SQL> column F new_val F
SQL> select to_char (sysdate, 'yyyymmddhh24mis') | '.txt 'f from dual;

F
------------------
20050124174926. txt

SQL> spool & F
SQL> select * from tab;

TNAME TABTYPE CLUSTERID
-----------------------------------------------
EMP TABLE
FK1 TABLE
HASHTAB TABLE
HASHTAB5 TABLE
HASHTABLE TABLE
HASHTABT TABLE
MLOG $ _ T TABLE
MLOG $ _ T_MASTER TABLE
OB TABLE
PK1 TABLE
PLAN_TABLE TABLE

TNAME TABTYPE CLUSTERID
-----------------------------------------------
RUPD $ _ T TABLE
RUPD $ _ T_MASTER TABLE
T TABLE
TCAAA TABLE
TESTLONG TABLE
TESTLONG2 TABLE
TRAN TABLE
TTTT TABLE
T_MASTER TABLE
VVV TABLE

21 rows selected.

SQL> spool off
SQL> host type & F
SQL> select * from tab;

TNAME TABTYPE CLUSTERID

-----------------------------------------------

EMP TABLE

FK1 TABLE

HASHTAB TABLE

HASHTAB5 TABLE

HASHTABLE TABLE

HASHTABT TABLE

MLOG $ _ T TABLE

MLOG $ _ T_MASTER TABLE

OB TABLE

PK1 TABLE

PLAN_TABLE TABLE


TNAME TABTYPE CLUSTERID

-----------------------------------------------

RUPD $ _ T TABLE

RUPD $ _ T_MASTER TABLE

T TABLE

TCAAA TABLE

TESTLONG TABLE

TESTLONG2 TABLE

TRAN TABLE

TTTT TABLE

T_MASTER TABLE

VVV TABLE

21 rows selected.

SQL> spool off

SQL>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.