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

ORACLE to_char(),to_date()用法

to_date() function
1.日期格式参数 含义说明 
D 一周中的星期几 
DAY 天的名字,使用空格填充到9个字符 
DD 月中的第几天 
DDD 年中的第几天 
DY 天的简写名 
IW ISO标准的年中的第几周 
IYYY ISO标准的四位年份 
YYYY 四位年份 
YYY,YY,Y 年份的最后三位,两位,一位 
HH 小时,按12小时计 
HH24 小时,按24小时计 
MI 分 
SS 秒 
MM 月 
Mon 月份的简写 
Month 月份的全名 
W 该月的第几个星期 
WW 年中的第几个星期    
 
2.日期时间间隔操作
当前时间减去7分钟的时间
select sysdate,sysdate - interval '7' MINUTE from dual
当前时间减去7小时的时间
select sysdate - interval '7' hour from dual
当前时间减去7天的时间
select sysdate - interval '7' day from dual
当前时间减去7月的时间
select sysdate,sysdate - interval '7' month from dual
当前时间减去7年的时间
select sysdate,sysdate - interval '7' year from dual
时间间隔乘以一个数字
select sysdate,sysdate - 8 *interval '2' hour from dual
 
to_char() function
The following are number examples for the to_char function.
to_char(1210.73, '9999.9')
would return '1210.7'
to_char(1210.73, '9,999.99')
would return '1,210.73'
to_char(1210.73, '$9,999.00')
would return '$1,210.73'
to_char(21, '000099')
would return '000021'
 
The following is a list of valid parameters when the to_char function is used to convert a date to a string. These parameters can be used in many combinations.
 
Parameter
Explanation
YEAR
Year, spelled out
YYYY
4-digit year
YYY
YY
Y
Last 3, 2, or 1 digit(s) of year.
IYY
IY
I
Last 3, 2, or 1 digit(s) of ISO year.
IYYY
4-digit year based on the ISO standard
Q
Quarter of year (1, 2, 3, 4; JAN-MAR = 1).
MM
Month (01-12; JAN = 01).
MON
Abbreviated name of month.
MONTH
Name of month, padded with blanks to length of 9 characters.
RM
Roman numeral month (I-XII; JAN = I).
WW
Week of year (1-53) where week 1 starts on


相关文档:

oracle数据导入导出


单表数据迁移:支持clob,blob
      exp estarcom/estarcom@ORACLE  tables=AA direct=y file=C:/AAA1.dmp
   imp estarcom/estarcom@ORACLE  tables=AA  file=C:/AAA1.dmp fromuser=estarcom touser=estarcom
全库数据迁移
exp userid=zhongxin/zhongxin@ORACLE own ......

Oracle未提供相应驱动

  本机电脑上有安装ORACLE10G的客户端,后来由于需要玩了一下ODAC,后来又卸载掉了。结果,使用C#进行连接的时候报:
        未在本地计算机注册“OraOLEDB.Oracle.1”提供程序
  然后,新建一个UDL进行测试,发现Oracle   Provider & ......

ORACLE 10G创建表空间和创建用户

 1、创建表空间
CREATE TABLESPACE mytablespace DATAFILE   
  'F:\oracle\product\10.2.0\oradata\myoracle\MYTABLESPACE01.DBF' SIZE 500M AUTOEXTEND ON NEXT
100M MAXSIZE UNLIMITED  
LOGGING  
PERMANENT  
EXTENT MANAGEMENT LOCAL AUTOALLOCAT ......

ORACLE WITH AS 用法

记得以前在论坛里看到inthirties用到过WITH AS这个字眼,当时没特别在意。今天在一个帖子里又看到有人用这个,所以就去网上搜了搜相关内容,自己小试了一把,写下来,方便以后忘了的话学习。
===================================================================================
先举个例子吧:
有两张表,分别为A、B ......

配置weblogic连接oracle的数据源

 Name:JDBC-DEV1
JNDI Name:jdbc.datasource.DS1  
AdminServer
Row Prefetch Size:  48
Stream Chunk Size:256
URL:jdbc:oracle:thin:@192.168.0.118:1521:AAT
Driver Class Name:oracle.jdbc.OracleDriver
连接oracle及postgresql的连接字符串
package com.lwf.eus.util;
import java.sql.Conn ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号