plsql(1)

 

 

1.pl/sql 分为三个部分:声明部分、执行部分、异常处理部分 

    DECLARE   

         …这里定义PL/SQL变量、自定义类型、游标和局部子程序(可选部分)

       BEGIN   --  begin和end中间添加响应的操作

          …这里可以放置可执行的SQL或者PL/SQL语句,这里必须至少包含一条可执行语句

        EXCEPTION

         …异常处理部分(可选)

       END;

/

每个plsql块可以有以上三部分,但是执行部分是必需的,声明和异常是可选的;如果有异常处理的话,执行部分是以exception结尾,如果不包含exception部分,就要以end;来结尾

  每条语句后面和每个块(block)后面都要有一个";"结尾

 

2.plsql字符集

字母,数字,空白,tab space 回车,其它符号: + - * / = ; :

plsql对大小写不敏感

plsql中的标识符(indentifier)

命名规则:字母开头,后可以跟任意字母,数字,货币符号,下划线,或#,不能有空格,最大长度为30个字母

plsql如何声明变量:

name type [constant] [not null ] [:=value]; //变量名 类型 [常量可选][非空可选][初始值可选];

plsql中要给一个声明的变量赋值要用 := 值

constant 声明变量为常量,初始化后之后不能再修改值,类似于java中的final

not null 非空,plsql中的 null 表示未定义,声明变量时不给他赋值它的默认值就为null

 

3.数据类型:

     a. record   类似于 struct

   type emp is record(

id varchar2(32),

firstname emp_xb.firstname%TYPE,

lastname varchar2(20) :='xiaoxiao'

  );

 

   b.table :  

(类似于java中的map用法key value键值对形式来存)表中的元素的类型可以是复合类型

定义:TYPE 类型名 IS TABLE OF type(value的类型或元素的类型) INDEX BY BINARY INTEGER;

 

   c.varray   类似于 array包含同一种类型的数组

   d. 参考类型:

       ref cursor 类似于指针

        lob (large object)大对象如音频,图片等

   e. 标量类型:

        binary_integer 只能指定整型

        dec 指定复点型

        float

        number(n,m)   n代表整个复点数整个有效位数,m小数点后面的位数

        varchar       

        varchar2

        boolean

        date

        %type 使一个变量具有数据库当中的某个表的某个字段的相同的数据类型

        %rowtype  

4.结构:

  A.条件:

if 条件 then

      elsif 条件 then

        end if;

   B.循环:

  a.loop if 条件 then exit; end if; end loop;

  b. while 条件 loop ... end loop;

      declare

  type t_indtab is table of varchar2(10)

          index by binary_integer;

  v_indtab t_indtab;

  v_index binary_integer;

begin

  v_indtab(100) :='a';

  v_indtab(80) := 'b';

  v_indtab(200) := 'c';

  dbms_output.put_line(v_indtab(200));

  dbms_output.put_line(v_indtab.first);

  dbms_output.put_line(v_indtab.last);

  v_index := v_indtab.first;

  while v_index <= v_indtab.last loop

    dbms_output.put_line(v_indtab(v_index));

    v_index := v_indtab.next(v_index);

  end loop;

  /*for i in v_indtab.first .. v_indtab.last loop

       dbms_output.put_line(v_indtab(i)));

   end loop;*/

end;

C.for循环

        for i in 0..9 loop ..  end loop;(上限  值结束条件为 <=9 )

(默认为自加想实现为自减可改为 for i in

reverse 9..0 loop ... end loop;)

 

 

 

 

 

 

PLSQL Developer 7.0.1 中文版一站式Oracle开发环境 PLSQL Developer 7.0.1 是专为 Oracle 数据库开发打造的轻量级集成开发环境(IDE),以其高效稳定、功能专注和低资源占用在数据库开发者中广受青睐。该版本提供【PLSQL Developer 7.0.1 中文版.rar】压缩包,支持解压即用的便携部署模式,无需复杂安装流程,显著降低使用门槛,尤其适用于旧版 Oracle 环境(如 9i/10g)下的开发与维护任务。其核心价值体现在三大方面:一是深度集成 PL/SQL 编辑、调试、优化与对象管理功能,提升开发效率; 阅读详情

相关推荐

PLSQL常用方法汇总

详细介绍ORACLE sqlplus命令

PLSQL简单介绍(转)

 1. 块结构 PL/SQL是一种块结构的语言,组成PL/SQL程序的单元是逻辑块,一个PL/SQL 程序包含了 一个或多个逻辑块,每个块都可以划分为三个部分。 (1)块的三个部分 ①声明部分(Declaration section) 声明部分包含了变量和常量的数据类型和初始值。这个部分是由关键字DECLARE开始,如果 不需要声明变量或常量,那么可以忽略这一部分。 ②执行部分(Ex...

weixin_34025151的博客 197

医疗AI新思路:为什么Graph Neural Network能改善气道分割的漏检问题?

本文探讨了Graph Neural Network(GNN)在医疗AI领域改善气道分割漏检问题的创新应用。通过分析3D UNet等传统方法的局限性,揭示了GNN在图结构建模中的独特优势,特别是在捕捉细小末梢支气管方面的突破性表现。文章详细介绍了UNet-GNN混合架构的设计原理、实验性能对比及优化方向,为CT影像分析提供了新思路。

weixin_30379531的博客 224

PL/SQL 面向对象

PL/SQL

weixin_42051619的博客 635

文章详细介绍了进行DoIP(DiagnosticoverInternetProtocol)测试的完整过程,包括样件的正确接线、CANoe软件的环境配置、端口设置、VLAN配置、IP和MAC地址的设定

关于Tester和DUT的地址,其实最主要的就是DUT的IP、MAC和逻辑地址,如果不知道Tester的IP、MAC和逻辑地址,可以配置为与DUT同一网段的就可以。ps:最重的是知道DUT的IP、逻辑、MAC地址,如果有VLAN也需要知道,Tester的地址可以根据DUT地址进行设定,其余的值可根据DoIP的报文查到相关参数。ps:如果在通信中没有建立VLAN,但是源地址和目的地址都填写正确,此时就要考虑是否是遗漏了VLAN,建立一个VLAN,在重新试试是否可通信。此处与硬件连接是相对应的,要注意!

qq_40965861的博客 1128

NAT反向代理技术的实现(外网访问内网)

NAT反向代理技术的实现(外网访问内网)(版权所有,引用 请联系作者,注明出处) NAT技术是网络中的重要应用之一。当有一个场景:内网搭建了服务器,需要外网访问时,可以借助NAT映射来实现。如:单位建立了一个Web服务器,我们希望在员工回家之后,依然可以访问到它,那怎么实现呢? 下面的拓扑图,就用来示范这个应用反面场景的实现过程。 一、题目要求: 地址配置如图。使用静态路由: 1、配置右侧交换机2950T,实现单臂路由; 2、配置路由使网络连通; 3、配置NAT访问,实现外网对风网服务器的

joyousmime的博客 8487

oracle 实现map,PLSQL实现的map功能,以及一些疑惑

--建立序列create sequence seq_map_param_id ;--建立参数表create table map_param(id number primary key , tname varchar2(30)) ;--初始化insert into map_param values (seq_map_param_id.nextval , 'EMP') ;insert into m...

weixin_39702714的博客 968

PointNetLK实战:5步搞定点云配准(附ModelNet40数据集训练技巧)

本文提供了一份详细的PointNetLK实战指南,帮助读者在5步内掌握点云配准技术。文章以ModelNet40数据集为例,深入讲解了环境搭建、数据预处理、模型训练与调试等核心步骤,并分享了关键的训练技巧和调参策略,旨在让开发者快速实现并应用这一高效的深度学习配准方法。

wind6的博客 462

PL/SQL 集合 -- 关联数组

-- Start 关联数组(Associative Array)其实就是一个 MAP,键的类型可以是 VARCHAR2, VARCHAR, STRING, LONG 或 PLS_INTEGER。 DECLARE -- 定义一个关联数组类型 MY_MAP TYPE MY_MAP IS TABLE OF STRING(10) INDEX BY PLS_INTEGER; -- 定义一个类型为

千里之行始于足下 2689

Codex 100个真实案例 - 全系列总结与Codex最佳实践全解析

历经100个案例的淬炼,我们终于来到了终点!本篇是整个系列的压轴之作——全面回顾100个案例的分类统计、提炼Codex使用的核心技巧和最佳实践、总结Prompt工程的精华要点、剖析常见错误及解决方案、展望AI编程的未来趋势,并为不同水平的读者规划学习路径。这不仅是一篇总结,更是一本Codex实战手册!

yueyeguzhuo的专栏 135

电子设计(1)二极管防电源反接电路

二极管经常用来作电源防反接保护,所需器件少,电路简单。

记得诚 1万+

为什么SQl语句里面要用where 1 = 1

SQL查询时通常会使用一下语句: select * from finance.finance_records l where l.status= 1 limit 20; 如果我们关联表的时候,有时候不能定位到时什么错误,其实,1=1 是永恒成立的,意思无条件的,也就是说在SQL语句中有没有这个1=1都可以。 select * from finance.finance_records l ...

Duyf的博客 601

YOLOv8多传感器融合技术——摄像头阵列融合技术详解

本文详细介绍了基于YOLOv8的摄像头阵列融合技术,该技术通过多摄像头协同工作实现360度无死角环境感知。文章阐述了系统原理,包括全方位视野覆盖、冗余设计和深度感知等优势,并提供了完整的Python实现代码。关键技术涵盖多摄像头检测、立体匹配、3D投影和目标融合等模块,支持时间域融合提升稳定性。该系统可显著提高自动驾驶的环境感知能力,减少检测盲区,增强系统可靠性,是L4-L5级自动驾驶的关键技术之一。文章还展示了城市驾驶场景的实际应用,验证了该技术对复杂交通环境的适应能力。

u010117029的博客 213

64位win8.1系统 安装plsql

64位win8.1系统 安装plsql 参考:http://www.cnblogs.com/chuyuhuashi/archive/2012/03/22/2411481.html 1.下载32位Oracle客户端 http://download.oracle.com/otn/nt/instantclient/112030/instantclient-basic-nt-11.2.0

Edward_qing_Lee的专栏 7067

Golang内存管理:GC调优实战案例

在Golang编程中,内存管理是一个非常重要的方面。良好的内存管理可以提高程序的性能和稳定性,而GC(垃圾回收)调优则是优化内存管理的关键手段。本文的目的就是通过实际案例,深入讲解Golang中GC调优的方法和技巧,让读者能够在实际项目中更好地进行内存管理和性能优化。范围涵盖了从核心概念的解释到具体代码实现和调优过程的详细分析。本文首先会介绍一些相关的术语和核心概念,让读者对Golang内存管理和GC有一个基本的认识。然后通过故事引入的方式,更加形象地解释核心概念及其相互关系。

AI Agent Harness Engineering 1118

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

PLSQL12.07安装使用教程(1)

1、下载安装PLSQL,一路默认选择就好,可以根据自己的喜好选择一下安装位置。 2、下载Oracle轻量级客户端instanceclient_12_1 instanceclient下载 下载之后放到一个指定的文件夹,我是放到了PLSQL的安装目录 3、配置环境 (1)在instanceclient_12_1下新建network文件夹,在network下新建ADMIN文件夹,在ADMIN下创建tns...

qq_1969183619的博客 1504

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

64位win8.1系统 安装plsql (转)

原文出处:http://blog.youkuaiyun.com/edward_qing_lee/article/details/25970185 64位win8.1系统 安装plsql 参考:http://www.cnblogs.com/chuyuhuashi/archive/2012/03/22/2411481.html 1.下载32位Oracle客户端 http://downloa...

aq9618154的博客 146

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

用PLSQL语句打印出1-100之间的素数

PLSQL语句可以用来打印出1-100之间的素数:FOR i IN 1..100 LOOP IF MOD(i,2) <> 0 THEN DBMS_OUTPUT.PUT_LINE(i); END IF; END LOOP;

weixin_42612804的博客 795

谁有plsql developer7.1 3的注册码?

谁有plsql developer7.1 的注册码? ...

crafty1986的博客 139

Win10 打开PLSql,其他软件卡到爆,原因CnPlugin_1.5.4插件的问题

原因就是因为plsql的 插件Cnplugin1.5.4问题, 换成1.5.1就好了,plsql不用换。 方法 解压后, 将plugin目录下的文件, 复制到plsql安装目录plugin下, 覆盖即可。 下载地址:提取码:licw 转自:https://www.cnblogs.com/ZJ0065/p/8808958.html ...

Lawrence_121 1597

PLSQL:[1]plsql中文乱码,显示问号

QL执行sql语句,不识别中文,输出的中文标题显示成问号???? 工具/原料 PLSQL Developer 9 方法/步骤 1  登陆plsql,执行sql语句,输出的中文标题显示成问号????;条件包含中文,则无数据输出   2  输入sql语句s

tfy1332的专栏 1258

plsql 下载|oracle plsql 下载|plsql 7.1.3下载

plsql 下载 PL/SQL Developer Version 7.1.0.1337 PL/SQL Developer是一种集成的开发环境,专门用于开发、测试、调试和优化Oracle PL/SQL存储程序单元, 比如触发器等。PL/SQL Developer功能十分全面,大大缩短了程序员的开发周期。 强大的PL/SQL编辑器,完善的Debugger调试器(需要Oracle 7.3.4...

weixin_30472035的博客 120

PLSQL编程1:PLSQL块的基本格式

plsql是过程化语言,能通过if,while,loop等实现流程控制,完成复杂的业务逻辑,plsql是对标准的sql语句的扩展。plsql块的标准结构如下: *deaclare 申明变量 begin 代码 exception 异常处理 end* 执行这个plsql块的结果如下: plsql块中的标识符有以下几个要求: 1.每行只能定义一个。 2.必须以英文字符开头,最

一直在梦想路上的博客 1368
上一篇: 查询一个数据库中所具有的表
下一篇: plsql(2)--游标
afunti
博客等级 码龄17年 25粉丝 39原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值