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所在目录) --执行前需要在目录下新 ...
随机推荐
- 实例讲解Linux下的makefile
1.程序代码结构如下 makefile/ |-- Makefile |-- haha.c `-- hehe.c 1.1.需要被编译的源代码如下 $ cat haha.c #include " ...
- 斯坦福大学 iOS 开发公开课总结
斯坦福大学 iOS 开发公开课总结 前言 iPhone 开发相关的教程中最有名的,当数斯坦福大学发布的 "iPhone 开发公开课 " 了.此公开课在以前叫做<iPho ...
- QMessageBox 使用方法
在Qt中经常需要弹出窗口,QMessageBox可以实现此功能,一共有三种窗口,information, question, 和 warning,critical, about分别对应感叹号,问号和叉 ...
- swift -- 学习记录
先把疯狂的swift这本书大致看了一遍 2016.7.13 因为实在是太闲,所以决定把公司的应用用swift写一遍 然后顺便看看swift的官方文档 这里有一个官文的中文翻译,感动啊 http://w ...
- workerman是一个高性能的PHP socket服务器框架
workerman-chatorkerman是一款纯PHP开发的开源高性能的PHP socket服务器框架.被广泛的用于手机app.手游服务端.网络游戏服务器.聊天室服务器.硬件通讯服务器.智能家居. ...
- [转]Efficiently Paging Through Large Amounts of Data
本文转自:http://msdn.microsoft.com/en-us/library/bb445504.aspx Scott Mitchell April 2007 Summary: This i ...
- 《GK101任意波发生器》升级固件发布(版本:1.0.2build851)
一.固件说明: 硬件版本:0,logic.3 固件版本:1.0.2.build851 编译日期:2015-06-26 ====================================== 二. ...
- 反汇编一个dos软盘的启动扇区
来源:http://www.ata-atapi.com/hiwdos.htm,自己乱译了一通. Disassembly of a DOS Floppy Boot Sector 反汇编一个dos软盘的启 ...
- 《Ant权威指南》笔记(一)
Ant的由来(序) James Duncan Davidson当年用纯Java开发Tomcat的时候,不仅想让它跨平台运行,还想要在不同的操作系统上都能够进行开发和构建.这种较大的项目的编译构建过程是 ...
- C#winform使用+=和-=订阅事件和移除事件订阅
1.C#winform中使用+=和-=订阅事件和移除事件订阅 2.可以使用+=给一个控件订阅多个事件,触发事件时按顺序执行,直到使用-=移除事件订阅为止.