随笔 - 79  文章 - 11  trackbacks - 0
<2009年5月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

不再堕落。
Oracle documents: 
http://tahiti.oracle.com/

常用链接

留言簿

随笔分类(66)

随笔档案(79)

相册

收藏夹(11)

搜索

  •  

积分与排名

  • 积分 - 51984
  • 排名 - 952

最新随笔

最新评论

阅读排行榜

mld@ORCL> create table dept
  
2  ( deptno     number(2),
  
3    dname      varchar2(14),
  
4    loc        varchar2(13),
  
5    last_mod   timestamp with time zone
  
6               default systimestamp
  
7               not null,
  
8    constraint dept_pk primary key(deptno)
  
9  )
 
10  /

表已创建。
mld
@ORCL> insert into dept( deptno, dname, loc )
  
2  select deptno, dname, loc
  
3    from scott.dept;

已创建4行。

mld
@ORCL> commit;

提交完成。

mld
@ORCL> variable deptno   number
mld
@ORCL> variable dname    varchar2(14)
mld
@ORCL> variable loc      varchar2(13)
mld
@ORCL> variable last_mod varchar2(50)
mld
@ORCL> begin
  
2      :deptno := 10;
  
3      select dname, loc, last_mod
  
4        into :dname,:loc,:last_mod
  
5        from dept
  
6       where deptno = :deptno;
  
7  end;
  
8  /

PL
/SQL 过程已成功完成。

mld
@ORCL> select :deptno dno, :dname dname, :loc loc, :last_mod lm
  
2    from dual;

       DNO DNAME                            LOC
---------- -------------------------------- --------------------------------
LM
--------------------------------------------------------------------------------
--
------------------
        10 ACCOUNTING                       NEW YORK
05-5月 -09 09.48.21.625000 下午 +08:00


mld
@ORCL> update dept
  
2     set dname = initcap(:dname),
  
3         last_mod = systimestamp
  
4   where deptno = :deptno
  
5     and last_mod = to_timestamp_tz(:last_mod);

已更新 
1 行。

mld
@ORCL> /

已更新0行。
posted on 2009-05-05 22:23 donnie 阅读(136) 评论(0)  编辑  收藏 所属分类: database

只有注册用户登录后才能发表评论。


网站导航: