Chinaunix首页 | 论坛 | 博客
  • 博客访问: 99866
  • 博文数量: 26
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 295
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-06 01:47
文章分类

全部博文(26)

文章存档

2009年(7)

2008年(19)

我的朋友

分类: Oracle

2009-03-21 15:35:04

RMAN中修改session的时间格式
 

RMAN> sql "alter session set nls_date_format=''yyyy-mm-dd hh24:mi:ss''";

 
 
为什么是这种格式呢,因为你想得到一个
 

nls_date_format='yyyy-mm-dd hh24:mi:ss'

这样的串,因为''是特殊字符,而且是在" "中,所以要用两个''表示一个'

再举个例子,假如你想往一个表中添加一行数据,其中的数据包含''

 

 

SQL> create table test(aa varchar2(10));
 

Table created.

SQL> SQL> insert into test values('''aa''');

1 row created.

SQL> select * from test;

AA
----------

'aa'

阅读(732) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~