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所在目录) --执行前需要在目录下新 ...
随机推荐
- 泛型,动态创建List<T> (转摘)
第一种: static void Main() { object intList = MakeList(typeof(int), 1, 2, 3); ...
- linux下安装uuid库
1.linux 下安装UUID库 1.1)ubuntu下安装uuid链接库 sudo apt-get install uuid-dev 1.2)CentOS yum install libuuid-d ...
- 关于sql语句的优化问题
系统要求进行SQL优化,对效率比较低的SQL进行优化,使其运行效率更高,其中要求对SQL中的部分in/not in修改为exists/not exists 修改方法如下: in的SQL语句 SELEC ...
- openstack创建虚拟机的步骤
图片来自互联网. 虚拟机启动过程如下: 1.界面或命令行通过RESTful API向keystone获取认证信息.2.keystone通过用户请求认证信息,并生成auth-token返回给对应的认证请 ...
- Css3 - 动画旋转
旋转1: <!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="U ...
- codeacademy
codeacademy http://link.zhihu.com/?target=https%3A//www.youtube.com/playlist%3Flist%3DPLP6DbQBkn9ymG ...
- javascript 原型及继承
一般继承方式如下 function people(n){ this.name =n; } function worker(name,num){ people.call(this, name); thi ...
- 客户端显示Not yet reported
No.1: IIS, WSUS, 加域的顺序,不过貌似关系不大,按照这个顺序就行了. No.2: KB2734608, KB2720211的影响,3.2.7600.256 (KB2734608), ...
- 移动WEB 性能优化方案
最近一项 研究表明,80%的网民对移动端的浏览体验感到失望,同时,当体验提升时,他们会在智能手机上花费更多的时间. 这不奇怪,因为64%的智能手机用户希望网站可以在4秒内加载完毕,但一半的网站花费了二 ...
- 【原】Windows下Nexus搭建Maven私服
一.Maven安装 详见Java开发环境搭建 二.Nexus安装 2.1.下载 地址:http://www.sonatype.org/nexus/go/ 选择OSS(ZIP)版本 2.2.安装 将安装 ...