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

PL/SQL语言简介

一、    PL/SQL语言简介
(本讲义之所有程序均调式通过)
首先我们看一个简单之例子,下面这个例子是统计从1至100的总和.
declare
i number:=0;          /*声明变量井给初值*/
t number:=1;
error_message exception;  /*声明一个出错处理*/
begin
  for t in 1..100 loop
    i:=i+t;
  end loop;
  if i>=5050 then
    raise error_message;  /*引发错误处理*/
  else
    insert into c_nt(c_t) values(i);
  end if;
exception
  when error_message then
  insert into c_nt(c_t) values(0);
end;
²      从上例中可以看出PL/SQL语法的一般规则.
­              PL/SQL中语句以分号(;)结尾.
­              开始程序块的PL/SQL语句(如IF…或BEGIN语句)没有分句.
­              文本值括在单引号(‘ ‘)内,而不是(“ “).
­              过程只允许最后有一个出口..
²      PL/SQL程序可以分为三个部分
­             DECLARE部分用于变量、常量、函数、过程、Cursor.
­             BEGIN部分包含PL/SQL块中要执行的代码 用于程序处理,其中可以调用函数、过程.
­             Exception 部分用于出错处理.
下面我们再看一个例子:
declare
i number :=1;
t number :=1;
p number :=1;
/*create table c_ny(c_t number,cou_t number);*/
function aa(xx number)return number is     /* define function*/
   tt number;
   ct number:=1;
    j number:=1;
begin
   while


相关文档:

SQL插入语句(INSERT INTO )

INSERT INTO
 tableName ( columnName1, columnName2, columnName3, columnName4)
VALUES      (  '45', '西藏办',  TO_Date( '2010-03-10 12:00:00', 'YYYY-MM-DD HH24:MI:SS'), NULL,);
commit; ......

SQL跨用户取进行数据库操作(这里用到了left join)

select ks.login_name,ks.exam_name,ks.start_time,ks.end_time,cj.score
from (
     select u.user_id,u.login_name,e.* from  cphrms.EXAM_USER eu, cphrms.users u, cphrms.exam_info e
     where eu.user_id = u.user_id and eu.exam_id = e.exam_id
) ks
left ......

执行缓存以优化SQL Server的内存占用

作者:superhasty
  2007-11-29
在论坛上常见有朋友抱怨,说SQL Server太吃内存了。这里笔者根据经验简单介绍一下内存相关的调优知识。首先说明一下SQL
Server内存占用由哪几部分组成。SQL Server占用的内存主要由三部分组成:数据缓存(Data
Buffer)、执行缓存(Procedure Cache)、以及SQL Server引擎程序。S ......

1.什么叫SQL注入?如何防止?请举例说明

1.什么叫SQL注入?如何防止?请举例说明
答:SQL注入是常见的利用程序漏洞进行攻击的方法。导致sql注入攻击并非系统造成的,主要是程序中忽略了安全因素,利用sql语言漏洞获得合法身份登陆系统 
例如:
"Select * from users where name='"+uName+"' and pwd='"+uPwd+"' " ......

SQL Server 2005无法启动~!!!!

2010-05-05 13:35:52.06 Server Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 3)
2010-05-05 13:35:52.06 Server (c) 2005 Microsoft Corporation.
201 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号