引用 :
http://awads.net/wp/2005/08/04/oracle-sqlplus/
http://www.blogjava.net/gddg/admin/EditPosts.aspx?opt=1
SELECT HTTPURITYPE('http://feeds.qzone.qq.com/cgi-bin/cgi_rss_out?uin=847915658').getxml() orana_feed
FROM dual;
也挺好的加个东西
Related to your search for: oracle sqlplus var
Welcome! You came here from www.google.cn searching for oracle sqlplus var. In addition to the post below these posts might be of interest:
sqlplus 修改 设置命令行提示符
set sqlprompt 'command >'
但前 连接的实例名称 , ----但前
column user_sid new_value sql_prompt
select
lower(user) || '@' ||
substr(global_name, 1, --
decode(instr(global_name, '.'), ---但前系统名
0, length(global_name),
instr(global_name, '.') - 1)
) user_sid
from global_name
/
But you want to set the sql prompt to be something like “current user @ database name”, so you may do something like this:
select
lower(user) || '@' ||
substr(global_name, 1,
decode(instr(global_name, '.'),
0, length(global_name),
instr(global_name, '.') - 1)
) user_sid
from global_name
/
USER_SID
--------------------------------------
GLOBAL_NAME
--------------------------------------
idmp@IDMP
IDMP.REGRESS.RDBMS.DEV.US.ORACLE.COM
但前列 赋值给 变量sql_prompt
column user_sid new_value sql_prompt
set sqlprompt 'command >'
column user_sid new_value sql_prompt
select lower(user) || '@' ||
'&_CONNECT_IDENTIFIER' || '-'|| utl_inaddr.get_host_address user_sid from dual;
创造 自己的 sqlplus 登陆文件 login.sql
--查服务器ip
SQL>
select utl_inaddr.get_host_address from dual;
GET_HOST_ADDRESS
-------------------------------------------------------------
192.168.1.108
存放 脚本 的地方
C:\oracle\product\10.2.0\client_2\sqlplus\admin
idmp@idmp-192.168.2.101> @C:\oracle\product\10.2.0\db_2\sqlplus\admin\login
SQL> define &sql_prompt
输入 sql_prompt 的值: ^X
检测到用户请求中断或 EOF。
connect.sql
--set term off
connect &1
@login
glogin.sql
set term off
set serveroutput on size 1000000 format wrapped
set long 5000
set linesize 131
set trimspool on
set pagesize 9999
define sql_prompt=idle
column user_sid new_value sql_prompt
select lower(user) || '@' ||
'&_CONNECT_IDENTIFIER' || '-'|| utl_inaddr.get_host_address user_sid from dual;
set sqlprompt '&sql_prompt> '
set timing on
set term on
set term off
connect &1
@login
set term off
disconnect
@login
H:\SQLplus>sqlplus /nolog
idle> @connect scott/tiger
scott@eddev> @disconnect
idle>
1、 USERENV(OPTION)
返回当前的会话信息.
OPTION='ISDBA'若当前是DBA角色,则为TRUE,否则FALSE.
OPTION='LANGUAGE'返回数据库的字符集.
OPTION='SESSIONID'为当前会话标识符.
OPTION='ENTRYID'返回可审计的会话标识符.
OPTION='LANG'返回会话语言名称的ISO简记.
OPTION='INSTANCE'返回当前的实例.
OPTION='terminal'返回当前计算机名
SELECT USERENV('LANGUAGE') FROM DUAL;
SQL> show show
showmode OFF
SQL> set show on
新值: showmode BOTH
SQL> show show