01 2013 档案

摘要:今天比较生气 连SQL 语句都写不利索了遇到了一个错误 这位朋友写的很清楚,特此记录下来http://blog.csdn.net/lwei_998/article/details/6062881-- insert 具体的值时,必须指定values 阅读全文
posted @ 2013-01-31 21:33 王超_cc 编辑
摘要:123 45 选定指定表6 点击编辑映射 编辑目标数据类型 做一些必要的调整6.1 源类型 目标类型sql server 2008 oracletimestamp datevarchar varchar2(长度尽量长) number number (精度要设置合理)char varchar2(长度设置合理)还要把 可以设置为NULL都勾选上7 阅读全文
posted @ 2013-01-30 16:37 王超_cc 编辑
摘要:for (int k =currentCell.getRowIndex();k>=2 ;k--){ if (xSheet.getRow(k).getCell(parentCellList).getStringCellValue()!=null && !xSheet.getRow(k).getCell(parentCellList).getStringCellValue().equals("") ... 阅读全文
posted @ 2013-01-30 13:07 王超_cc 编辑
摘要:ORA-01403未找到数据的错误。其中jkcode,serialid是varchar2(64)。语句是这样的:select jk_code,serial_id into jkcode,serialidfrom contract_account,customer,mp,meterwhere contract_account.customer_id=customer.customer_id and contract_account.contrac_id=mp.contrac_id and mp.mp_jd=meter.mp_id and meter.meter_id=meter_cursor.n 阅读全文
posted @ 2013-01-29 21:07 王超_cc 编辑
摘要:import java.io.InputStream;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.Statement;import java.util.Properties;public class JdbcUtil { private static Properties env=new Properties(); static{ try{ InputStream is=JdbcUtil.class... 阅读全文
posted @ 2013-01-29 13:55 王超_cc 编辑
摘要:思想读取excel 文件中的内容 ,拼接字符串,将数据插入oracle数据库临时表中,再对临时表中的数据进行操作package com.cici.testExcel;import java.io.FileInputStream;import java.io.IOException;import java.util.ArrayList;import java.util.List; import org.apache.poi.xssf.usermodel.XSSFRow;import org.apache.poi.xssf.usermodel.XSSFSheet;import org.apache 阅读全文
posted @ 2013-01-27 14:22 王超_cc 编辑
摘要:表结构create table U ( NAME CHAR(64) not null, ID INTEGER not null PRIMARY KEY)tablespace CICI;comment on table U is '用户表'; create table GROU ( NAME CHAR(64) not null, ID INTEGER not null PRIMARY KEY)tablespace CICI;comment on table GROU is '权限组表'; CREATE TABLE U_GROU( G_ID INTEGER not 阅读全文
posted @ 2013-01-26 21:35 王超_cc 编辑
摘要:前言极端无奈使用该数据库,客户公司的极为低级技术导致本人需要安装SQL SERVER 2008数据库(多么的白痴啊,还用这种数据库,小白小白的客户). 下面记录下,本人安装连接SQL SERVER 数据库的全过程.1 安装软件1.1 SQLEXPR32_x86_CHS -- SQL SERVER 2008 安装文件E:\F\开发工具\DB\SQL2008\SQLEXPR32_x86_CHS.exe1.2 SQLManagementStudio_x86_ENU -- 这个事用来管理SQL Server 2008数据库的工具,最重要的是包含图形界面,哦耶~~2 SQL SERVER 2008 安装 阅读全文
posted @ 2013-01-26 19:07 王超_cc 编辑
摘要:查询用户表空间对应关系select username, default_tablespace from dba_users;查询表空间使用情况 select a.file_id "FileNo",a.tablespace_name "Tablespace_name", a.bytes "Bytes",a.bytes-sum(nvl(b.bytes,0)) "Used", sum(nvl(b.bytes,0)) "Free", sum(nvl(b.bytes,0))/a.bytes*100 &qu 阅读全文
posted @ 2013-01-25 13:37 王超_cc 编辑
摘要:错误信息description The server encountered an internal error () that prevented it from fulfilling this request.exceptionorg.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncatego 阅读全文
posted @ 2013-01-25 13:03 王超_cc 编辑
摘要:1 表太多,显示太乱.如何规整化表?1.1 全选Physical Diagram 范围内的表.右键 Auto-Layout.选择一种视图.1.2 统计表的整体信息以及表的个数.pdm 图右键 List of -->tables 阅读全文
posted @ 2013-01-25 09:52 王超_cc 编辑
摘要:表A表 B (AID是外键 指向A表的ID主键)查子表外键与主表主键不重合部分 (包含子表外键为NULL值的情况)select * from B where not exists ( select ID from A where a.id = b.aid );查看子表主键主表主键不重合的部分 (不包含子表外键为NULL值的情况)select * from B where b.aid not in ( select ID from A );普通查询不包含NULLselect * from B where aid !=1;包含NULL的查询 (需要特殊指定)select * from B wher 阅读全文
posted @ 2013-01-23 12:17 王超_cc 编辑
摘要:用记事本打开cvs文件然后另存为 ansi 编码 阅读全文
posted @ 2013-01-21 17:24 王超_cc 编辑
摘要:总结一下自己写的 工具类之一1 jar包位置E:\F\UtilJars\ExcelWrite_fat.jarhttp://www.cnblogs.com/cici-new/admin/Files.aspx/ExcelWrite_fat.jar2 使用先编辑excel 文件 写入信息在运行如下命令C:\Users\Administrator.cici-THINK>java -jar E:\F\UtilJars\ExcelWrite_fat.jarPlease insert the Source File :F:\\AIT\\Lottes\\DB\\初始化数据库语句\\TABLE NAMES 阅读全文
posted @ 2013-01-19 16:46 王超_cc 编辑
摘要:1打开输出set serveroutput on;2 设置输出缓存set serveroutput on size 100000; 阅读全文
posted @ 2013-01-13 23:13 王超_cc 编辑
摘要:create or replace package PAGEQUERY_PACK is -- Author : ADMINISTRATOR -- Created : 2013/1/13 15:47:30 -- Purpose : FEN YE CHA XUN -- Public type declarations TYPE CUR IS REF CURSOR; -- Public function and procedure declarations PROCEDURE PAGINATING_all_objects_P( P_CURSOR OUT CUR... 阅读全文
posted @ 2013-01-13 17:28 王超_cc 编辑
摘要:问题场景运行包体时候 出现上述错误错误原因将包体的 声明游标的语句注释掉(Line3)运行成功 阅读全文
posted @ 2013-01-13 16:17 王超_cc 编辑
摘要:要用dbms_output.put_line来输出语句,遇到以下错误:ERROR 位于第 1 行:ORA-20000: ORU-10027: buffer overflow, limit of 10000 bytesORA-06512: 在"SYS.DBMS_OUTPUT", line 32ORA-06512: 在"SYS.DBMS_OUTPUT", line 97ORA-06512: 在"SYS.DBMS_OUTPUT", line 112ORA-06512: at line 12View program sources of er 阅读全文
posted @ 2013-01-13 02:45 王超_cc 编辑
摘要:create or replace procedure BATCH_CHECK_DDL_P(in_username in varchar2 ) is /*************************************************************** *NAME : BATCH_INSERT_TABLEA_P *PURPOSE : --批量查询数据库内某个用户的建表语句 *IMPUT : -- 表名子 *OUTPUT : -- N/A *Author : -- CICI *CreateDate : -- 2012、12、24 *UpdateDate... 阅读全文
posted @ 2013-01-13 02:41 王超_cc 编辑
摘要:http://blog.csdn.net/yywzgh/article/details/7636299 阅读全文
posted @ 2013-01-13 02:36 王超_cc 编辑
摘要:1 select * from A where A.name like 'TEST';上面的SQL 不能查出任何结果===>select * from A where A.name = 'TEST';2 SELECT * FROM BWHERE B.NAME not like 'b2';===========>无效限定符 应该修改为SELECT * FROM BWHERE B.NAME != 'b2'; 阅读全文
posted @ 2013-01-10 22:48 王超_cc 编辑
摘要:1 截取字符串//lastIndexOf();http://www.w3school.com.cn/js/jsref_lastIndexOf.asp//substring();http://www.w3school.com.cn/js/jsref_substring.asp2 字符串中查找指定字符串search() http://www.w3school.com.cn/js/jsref_search.asp 阅读全文
posted @ 2013-01-08 03:30 王超_cc 编辑
摘要:1 截取字符串//lastIndexOf();http://www.w3school.com.cn/js/jsref_lastIndexOf.asp//substring();http://www.w3school.com.cn/js/jsref_substring.asp 2 查询指定字符串var str="Hello world!"document.write(str.search("H") + "<br />")document.write(str.search("World") + " 阅读全文
posted @ 2013-01-08 03:15 王超_cc 编辑
摘要:<html><head><script type="text/javascript" src="/jquery/jquery.js"></script><script type="text/javascript"> $(document).ready(function(){$("#selectTest").change(function(){//alert("Hello");//alert($("#selectTest&quo 阅读全文
posted @ 2013-01-06 02:14 王超_cc 编辑
摘要:TABLE CPROCEDUREcreate or replace procedure P_TEST_LOOP_CUR(in_test in varchar2) is /*************************************************************** *NAME : [Name] *PURPOSE : --更新表C的数据 添加bid外键数据 *IMPUT : --输入参数没意义 *UpdateDate : --函数更改信息(包括作者、时间、更改内容等) *************************************... 阅读全文
posted @ 2013-01-05 09:19 王超_cc 编辑
摘要:重点关注9:用EXISTS替代IN.重点关注案例 :查找DEPT_1部门的人员姓名9.1 SQL语句--子查询select pname from t_person where deptid in ( select deptid from t_department where deptname like 'DEPT_1');--exsistselect pname from t_person where exists ( select * from t_department where t_department.deptid = t_person.deptid ... 阅读全文
posted @ 2013-01-04 01:15 王超_cc 编辑
摘要:影响ORACLE效率的关键点 原文 http://hi.baidu.com/odbcconnection/item/f4a56cbf1c8bea422bebe32f 1:选择最有效率的表名顺序(只在基于规则的优化器中有效) ORACLE的解析器按照从右到左的顺序处理FROM子句中的表名,因此FROM子句中写在最后的表(基础表drivingtable)将被最先处理.在FROM子句中包含多个表的情况下,必须选择记录条数最少的表作为基础表.当ORACLE处理多个表时,会运用排序及合并的方式连接它们.首先,扫描第一个表(FROM子句中最后的那个表)并对记录进行派序,然后扫描第二个表(FROM子句中最. 阅读全文
posted @ 2013-01-04 01:15 王超_cc 编辑
摘要:exists (sql 返回结果集为真) notexists (sql 不返回结果集为真) 如下: 表A 表B 表A和表B是1对多的关系 A.ID => B.AID select a.id from A where exists (select a.id from b where a.id = b.aid);select a.id from Awhere not exists ( select a.id from b where a.id = b.aid );条件查询 select * from A where exists (select a.id ... 阅读全文
posted @ 2013-01-03 19:13 王超_cc 编辑
摘要:create or replace procedure P_CHANGE_FK_STATUS(IN_TABLE in varchar2,IN_TYPE IN VARCHAR2,IN_ACTION IN VARCHAR2) is--失效或者生效指定表的外键-- IN_table :表名-- IN_TYPE :必须为 R 代表外键-- IN_ACTION :DISABLE 或者 ENABLEV_TABLE VARCHAR2(30);V_ACTION VARCHAR2(10);V_SQL VARCHAR2(200) ;V_FK VARCHAR2(60); begin V_TABLE:... 阅读全文
posted @ 2013-01-03 17:00 王超_cc 编辑
摘要:执行如下SQL 出现以下ERROR 1 create or replace procedure P_DISTABLE_FK(IN_TABLE in varchar2) is 2 --失效 输入表名称的外键 3 V_SQL VARCHAR2(200) ; 4 V_FK VARCHAR2(60); 5 begin 6 --查询外键名称 7 V_SQL :='SELECT * FROM USER_CONSTRAINTS WHERE CONSTRAINT_TYPE='|| 'R'|| ' and table_name='||IN_TABLE; 8 dbm 阅读全文
posted @ 2013-01-03 16:31 王超_cc 编辑
摘要:建表语句CREATE TABLE `a` ( `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', `id` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ;分页查询的包声明和包体create or replace package PAGINATING_A_Pack is -- Author : ADMINISTRATOR -- Created : 2013/1/13 17:02:46 -- Purpose : 分页查询 表A 的数据 -- Publ 阅读全文
posted @ 2013-01-03 05:56 王超_cc 编辑
摘要:执行如下语句 遇到了 ORA-06502错误.call BATCH_INSERT_A(10);问题分析A表中没有数据,运行存储过程执行到Line14的时候,n_id变量值为NULL,故 Line15会出现类型错误.问题根本点 select max(id) into n_id from A; for i in n_id+1 ..n_id+insertNo loop问题解决在line14 Line15 之间添加 如下 if n_id is null then n_id :=0; end if;表信息 CREATE TABLE "SS_HR"."A" ( &q 阅读全文
posted @ 2013-01-03 00:06 王超_cc 编辑
摘要:总结在删除有父子表关系的表的数据时,我们都知道要先删除子表 再删除父表数据。昨天采用先删子表 ,再删父表,删除时使用truncate,结果在删除父表的时候,给出了这个提示:ORA-02266这个错误提示。当采用delete 语句删除父表的数据时候,则成功。根本问题是 :ddl与dml 的区别(because truncate isn't going to verify the constraint, truncate is ddl.)这里需要如下操作 先取消子表外键的外键约束,之后删除父表数据,最后再次启用外键约束.准备工作 父子表建立过程-- 创建person表create tabl 阅读全文
posted @ 2013-01-01 21:00 王超_cc 编辑
摘要:如何在PLSQL 的存储过程中执行SQL 语句呢?用到动态执行SQL:EXECUTE IMMEDIATE表信息 select * from emp_temp; 存储过程CREATE OR REPLACE PROCEDURE F_DELETE_ROWS(table_name IN VARCHAR2,condition IN VARCHAR2 DEFAULT NULL) AS where_clause VARCHAR2(100) := ' WHERE ' || condition; v_table VARCHAR2(30); V_SQL VARCHAR2(10... 阅读全文
posted @ 2013-01-01 17:55 王超_cc 编辑
摘要:完全新建一张表1 create table emp(id integer)tablespace CICI;在原有表的基础上新建一张表2 CREATE TABLE EMP_TEMP TABLESPACE CICI AS( SELECT * FROM EMP) ; 阅读全文
posted @ 2013-01-01 06:09 王超_cc 编辑

点击右上角即可分享
微信分享提示