SQL * PLUS common command and decode () function use skills

xiaoxiao2021-03-06  106

Function: ????? decode (condition, value 1, translation value 1, value 2, translation value 2, ... value n, translation value n, default)

FUNCTION ????????????????????????? Result

Concat ('good', 'string') ??????????????????? 'good string'

Substr ('string', 1, 3) ???????????????????? Str '

Length ('string') ????????????????????????? 6

INSTR ('string', 'r') ???????????????????????? 3

Lower ('sql course') ????????????????? 'SQL Course'

Upper ('sql course') ?????????????????? 'sql course'

INITCAP ('sql course') ??????????????? 'sql? Course'

Round (45.926, 2) ??????????????????????????? 45.93

Trunc (45.926, 2) ???????????????????????????? 45.92

MOD

(1000, 300) ???????????????????????????????? 100

?

SQL * Plus common command: SQL> Edit S

If the current directory does not exist, the S.sql file is automatically generated.

SQL> @S

The system will automatically query all tables, views, synonyms under the current user.

The @@ file name is called to make a .sql file in the .sql file.

The Save file name uses the command of the buffer to file a file mode, the default file extension is. SQL

Get file name to transfer the SQL file of the storage

START file name runs the SQL file that is transferred to the memory

SPOOL file name The "spoolery" of the various operations and execution results after this, the default file extension is .lst

Spool displays the current "spool" state

Spool OFF stop output

example:

SQL> Spool A

SQL> SPOOL

Positive leave offline to a.lst

SQL> Spool off

SQL> SPOOL

Current no fake offline

EXIT exits SQL * Plus

DESC table name display table structure

Show user displays the current connection user

Show Error Shows Error

Show all shows all 68 system variables

Edit Open the default editor, the default is notepad.exe in the Windows system, and transfer the last SQL statement in the buffer to the Afiedt.buf file for editing.

Edit file name edits the .sql files specified in the current directory.

Clear Screen Clear Current Screen Display

转载请注明原文地址:https://www.9cbs.com/read-126348.html

New Post(0)