wzglovejava的博客
wzglovejava · 共 4 篇文章
10年读pl/sql编程指南敲下了上面大部分例子二(备用)
--(4)在forall子句中使用bulk子句 declare type ename_table_type is table of emp.ename%type; type sal_table_type is table of emp.sal%type; ename_table ename_table_type; sal_table sal_table_type; sql_stat varchar2(100); begin ename_table:=ename_table_type('SCOTT','ins','SMITH'); sql_stat:='update emp set sal=s…
2011-02-25 16:14 · 评论(0)
10年读pl/sql编程指南敲下了上面大部分例子(备用)
declare cursor emp_cursor is select empname,salary from employee for update; emp_record emp_cursor%rowtype; begin open emp_cursor; loop fetch emp_cursor into emp_record; exit when emp_cursor%notfound; if emp_record.salary<2000 then update employee set salary=salary*1.1 where current of emp_cursor; …
2011-02-25 16:10 · 评论(0)
在使用oracle10g时常用到的简单的sql语句(整理下希望大家能有用)
--创建表空间SJYD,DATAFILE 指定数据库文件存放路径。(这里SJYD使用小写时可能会不能正确执行,建议最好用大写。) CREATE TABLESPACE SJYD DATAFILE 'C:\SJYD_data.dbf' SIZE 5M AUTOEXTEND ON NEXT 5M DEFAULT STORAGE (INITIAL 50K NEXT 50K MAXEXTENTS UNLIMITED PCTINCREASE 1 ); --创建用户SJYD,密码SJYD123,默认表空间为SJYD CREATE USER SJYD IDENTIFIED BY SJYD123 DEFAUL…
2011-02-25 16:06 · 评论(0)
在sqlserver中自定义一个split方法(通过下标获取截取的数组中数据)
在使用sqlserver数据库开发时遇到了这个问题,查询资料发现没有这样的方法,在一个朋友的帮忙下写的,跟大家分享下,希望大家能提宝贵意见,进行改进和优化 if object_id('f_split') is not null drop function f_split create function [dbo].[f_split](@SourceSql varchar(8000),@StrSeprate varchar(10),@indexof int) returns nvarchar(50) as begin declare @i as int declare @temp_str as…
2011-02-25 15:10 · 评论(0)