使用替换变量检验插入值-SQL语言基础

时间:2024-05-15 13:25:05
【文件属性】:

文件名称:使用替换变量检验插入值-SQL语言基础

文件大小:5.26MB

文件格式:PPT

更新时间:2024-05-15 13:25:05

SQL 基础

使用替换变量检验插入值 * SQL> INSERT INTO dept (deptno, dname, loc) 2 VALUES (&department_id, 3 '&department_name', '&location'); Enter value for department_id: 80 Enter value for department_name: EDUCATION Enter value for location: ATLANTA 1 row created. 在SQL 语句中用&替换变量提示用户输入值 &是一个用于变量值的占位符 * Inserting Values by Using Substitution Variables You can produce an INSERT statement that allows the user to add values interactively by using SQL*Plus substitution variables. The slide example records information for a department in the DEPT table. It prompts the user for the department number, department name, and location. For date and character values, the ampersand and the variable name are enclosed in single quotation marks. Instructor Note Be sure to mention the following points about the example: The names of the SQL*Plus substitution parameters do not have to match the corresponding column names. Substitution parameters are lexical variables. Whatever characters the user enters are substituted as text for the variable name. The SQL*Plus SET VERIFY command lists the substitution before executing the statement.


网友评论