The command 'new_value' for SQLPlus
Format:
column column_name new_value var_name
Meaning:
use the column_name of a select statment to construct a variable, later we can use &var_name to refer its value.
If the Select statement returned more that one row, the last row value will be assigned to the variable.
Example 1:
-- create directory and varchar2 array
col value new_value user_dump_directory;
select value from v$parameter where name = 'user_dump_dest';
create or replace directory user_dump_dir as '&user_dump_directory';
Example 2
set feedback off
set verify off create table new_value_test_from (
some_field_name Varchar2(20)
); create table new_value_test_to (
another_field Varchar2(20)
);
insert into new_value_test_from values ('Maegerli Mucki');
column some_field_name new_value some_var_name
select some_field_name from new_value_test_from;
insert into new_value_test_to values ('&some_var_name');
select * from new_value_test_to;
drop table new_value_test_from;
drop table new_value_test_to;
set feedback off
set verify off create table new_value_test (
some_field_name Varchar2(20)
); Example 3
insert into new_value_test values ('Maegerli Mucki');
insert into new_value_test values ('Globi');
column some_field_name new_value some_var_name
select some_field_name from new_value_test;
drop table new_value_test;
The command 'new_value' for SQLPlus的更多相关文章
- pl/sql command window 初步接触
pl/sql command window基本操作 PL/SQL Developer应用两年了,今天第一次应用command window. command window类似于sqlplus窗口: 1 ...
- 【翻译自mos文章】在10g中,当发生ORA-00020时,sqlplus登陆会报“connected to an idle instance”
在10g中.当发生ORA-00020时,sqlplus登陆会报"connected to an idle instance" 来源于: Sqlplus Logon Reports ...
- P6 EPPM Manual Installation Guide (Oracle Database)
P6 EPPM Manual Installation Guide (Oracle Database) P6 EPPM Manual Installation Guide (Oracle Databa ...
- P6 EPPM Installation and Configuration Guide 16 R1 April 2016
P6 EPPM Installation and Configuration Guide 16 R1 April 2016 Contents About Installing and ...
- Developing RIA Web Applications with Oracle ADF
Developing RIA Web Applications with Oracle ADF Purpose This tutorial shows you how to build a ric ...
- Globalization Guide for Oracle Applications Release 12
Section 1: Overview Section 2: Installing Section 3: Configuring Section 4: Maintaining Section 5: U ...
- oracle group by placement可能导致错误结果的bug
Last week I’ve mentioned on Twitter that we ran into wrong result bug. We found workaround quickly b ...
- Oracle 11g 异机恢复参考文档
原库 目标库 操作系统 CentOS 6.4 CentOS 6.4 主机名 sht-sgmhadoopnn-01 sht-sgmhadoopnn-02 IP 172.16.101.55 172.1 ...
- 批量导入oracle 的sql脚本
以下为脚本样例:execute.sql,在PL/sql的command窗口或sqlplus中执行:@目录/execute.sql (以下“目录”需要替换为实际sql所在目录) --执行前需要在目录下新 ...
随机推荐
- jsp页面中的代码执行加载顺序介绍
1. java是在服务器端运行的代码,jsp在服务器的servlet里运行,而javascript和html都是在浏览器端运行的代码.所以加载执行顺序是是java>jsp>js. 2. j ...
- 【C语言】03-第一个C程序代码分析
前面我们已经创建了一个C程序,接下来分析一下里面的代码. 项目结构如下: 一.代码分析 打开项目中的main.c文件(C程序的源文件拓展名为.c),可以发现它是第一个C程序中的唯一一个源文件,代码如下 ...
- virt-manage图形界面键盘错位问题
键盘错乱问题: 启动引导问题:
- Html - 图片
千图网 http://www.58pic.com/ 图标宝 http://ico.58pic.com/ 瓢城Web俱乐部 http://www.ycku.com/demo/
- 服务器文件系统一定要用NTFS格式。
网络中心通过ADSL接入Internet(固定的IP地址), 网站服务通过端口映射放到了内网的两台计算机上,一台IP地址为122.9.6.1,提供Web.FTP.POP3与SMTP服务:另一台IP地址 ...
- ajax的同步和异步问题 (转)
async默认的设置值为true,这种情况为异步方式,当ajax发送请求后,在等待server端返回的数据的过程中,程序会继续执行ajax块后面的代码,直到服务器返回正确的结果才会去执行success ...
- 【转】asp.net c# 网上搜集面试题目大全(附答案)
asp.net c# 网上搜集面试题目大全(附答案) http://www.cnblogs.com/hndy/articles/2234188.html
- 内存调试工具Electric Fence
源码下载地址 注:官方地址下载不了,可能不再维护了,此是一个老项目 efence中相关环境变量控制: 302 /* 303 * See if the user wants to allow mallo ...
- 2016.07.14,英语,《Vocabulary Builder》Unit 25
verb: comes from the Latin verbum, meaning 'word'. verbally: ['vɜːbəli] adv. 口头地,词句地, 逐字地 verbalize: ...
- jQuery 判断表单中多个 input text 中至少有一个不为空
html: 名称1:<input class="seasoning_name" type="text" name="seasoning_name ...