Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the oracle sql plus commands?

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you "what are the oracle sql plus orders?", which is easy to understand and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn this article "what are the oracle sql plus commands?"

1) how to start sqlplus:

Isqlplus start

Sqlplus [username] / [password] [@ server]

2) Connect command

Connect [username] / [password]

Disconnect

Password

Exit/quit

3) Editing commands

List: sql command that lists buffers

Append: add content to the current line of the buffer

Change character 1 character 2: change the character of the buffer

Input: add a line after the current line

N: set the nth line as the current line

Edit: edit buffer

Run /: command to run buffer

4) File operation command:

Save: save the sql buffer as a file

Get: opposite to save

Start @: run the saved sql file

@ @: if two scripts are in the same folder, you can use @ @ a2.spl to reference them.

Edit: edit sql scripts, such as Edit c:/a.spl

Spool: save the screen contents of sqlplus to the output file

For example, spool filename [append] [create] [replace]

5) format command:

Cloumn: control column display format

Column column name [heading] [formart] [justify]

Where heading refers to the column name displayed, format refers to the format in which the value is displayed, and justify refers to the display of its format (left | center | right)

Format: An: string display length

9: numeric column type column suppresses the display of leading 0

0: numeric column forces the display of leading 0

$: display the dollar sign in front of the number column

L: display the local currency symbol in front of the number column

.: specify the position of the decimal point for the numeric type column

Specify the thousand delimiter of the numeric column

Where, when the column field name indicates that the col setting for this field is displayed

Ttitle: page header

Btitle: footer

Break: if there is a duplicate row of this field on the column, the field is represented by a blank space

For example: break on field name

6) Interactive commands:

&: reference substitution variable, must replace this symbol, if the substitute scalar has been defined, then the data will be used directly, if not defined

If the substitute variable is a string or date, it must be referenced with'& name', is a number or & name

In that case, an alternative variable is temporarily defined (it works only in the current statement)

The variables defined by & &: work in the current sqlplus

DEFINE: defines an alternative variable for char

Such as: DEFINE work=CLECK

ACCEPT: defines an alternative variable of type char NUMBER DATE, where you can output prompts, set formats, and hide user input

Such as: ACCEPT work PROMPT 'clear input work information:'

ACCEPT pwd HIDE # hides user input

PROMPT 'output prompt'

PAUSE: pause the sql command. Press enter to continue execution.

VARIABLE: this command helps set variables in sqlplus, and must precede them when referencing them in a sql sentence or pl/sql quick.

Add:, when directly assigning a value to a set variable, you need to use the EXECUTE command, (similar to calling a stored procedure)

Var no NUMBER

Exec: no:=7788

Select ename from emp where empno=:no

PRINT: this is clearly used to output the result of a set variable

Print no

7) Environmental variables

Display of environment variables: show env_name

Setting of environment variables: set env_name value

Here are some common environment variables

The default value of 1:ARRAYSIZE is 15. The higher the value, the lower the network overhead, but it takes up more memory. The default is 15. For example, it transmits 50 lines, and defaults to 4. If it is changed to 25 lines, it will take 2 times.

2) AUTOCOMMIT: whether to automatically submit DML statements

3) COLSEP: separator between columns

4) FEEDBACK: displays the number of rows returned (OFF | 1)

5) HEADING: whether to display column headings

6) LINESIZE: set row width

7) LONE: sets the display length of LONE,LOB

8) PAGESIZE: lines per page

9) SERVEROUTPUT: controls the screen output of the server

10) TERMOUT: whether to output the results of screen sql

11) TIME: whether to display the system time before the sql prompt

12) TIMING: whether to display the execution time of the sql statement

13) show recyclebin: displays the current user object in the database recycle bin, in which is the table in which the current user performs drop table deletion

The above is all the contents of the article "what are the oracle sql plus commands?" Thank you for your reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report