易截截图软件、单文件、免安装、纯绿色、仅160KB

Oracle中常用的函数

  ---sql的函数的使用(Oracle)      
      ---dual的使用:哑元表:没有表需要查询的时候 可以用它
               ---select 'Hello World' from dual;     ---结果:Hello World
    ---单行函数:单行
     1.日期函数:系统时间:sysdate---select sysdate from dual;                       ---当前的系统时间---结果:2010-05-14
           sysdate+(-)整数的含义---select sysdate+1 from dual;        ---当前系统日期的后一天---结果:2010-05-15
                    ---select sysdate-7 from dual;        ---当前系统日期的上一周---结果:2010-05-07          
        日期间间隔的天数:日期1+(-)日期2---select (sysdate-hiredate) as 天数 from emp;     
        日期间间隔的月份:months_between(day1,day2):返回day1日期和day2日期之间相差的月份
               ---select months_between(sysdate,hiredate) as 月份 from emp;   
           to_char(day,'格式'):将一个数字或日期转换为字符串
                  ---select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual; ---结果:2010-05-14 18:49:07
                    ---格式变化:---select to_char(sysdate,'d') from dual;---今天是这一周的第几天---结


相关文档:

Oracle复制表结构

 如下,表a是数据库中已经存在的表,b是准备根据表a进行复制创建的表:
  1、只复制表结构的sql
  create table b as select * from a where 1<>1

  2、即复制表结构又复制表中数据的sql
  create table b as select * from a
  3、复制表的制定字段的sql
  create table b as select row_id ......

oracle 存储过程

1.创建过程
   与其它的数据库系统一样,Oracle的存储过程是用PL/SQL语言编写的能完成一定处理功能的存储在数据库字典中的程序。
  语法:
  create [or replace] procedure procedure_name
  [ (argment [ { in| in out }] type,
  argment [ { in | out | in out } ] type
  { is | as }
  <类型 ......

ORA 00054错误 Oracle数据库的锁参考资料

解决方案:
    select session_id from v$locked_object;  --首先得到被锁对象的session_id
    SELECT sid, serial#, username, osuser from v$session where sid = session_id;   --通过上面得到的session_id去取得v$session的sid和serial#,然后对该进程进行终止。
&n ......

ARCSDE for Oracle 数据存储形式为st_geometry

SELECT sde.st_area(zone) from sde.test1 ORDER BY name;//
SELECT shape from schools ORDER BY name;
SELECT objectid, sde.st_astext(SDE.ST_POINTfromSHAPE(shape,0)) AS points from schools;
SELECT name, sde.st_x (zone) "The X coordinate" from test ; //正确执行
SELECT name, sde.st_x (shape)  "The ......

AIX Oracle RAC 升级到10.2.0.4.0要特别注意的问题

AIX Oracle RAC 升级到10.2.0.4.0过程有如下报错(直接升级到10.2.0.4不需要应用Patch:6160398):
 root@bwgl_db2:/u01/app/oracle/crs_1/bin# /u01/app/oracle/crs_1/install/root102.sh
Error : Please change the CRS_ORACLE_USER id <oracle> to have the following OS capabilities :
  <CAP_BYP ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号