摘要:
--命令窗口查询 exec 存储名、包名、视图; select 函数名 from dual; create or replace procedure PR_test is begin --存储过程的代码 Dbms_Output.put_line('这是输出的一句话'); --serveroutput 系统设置项 是否在命令窗口打开 默认是 off, --set serveroutput on... 阅读全文
posted @ 2016-10-19 13:39
熊猫卡洛斯
阅读(370)
评论(0)
推荐(0)
摘要:
一。为什么要使用动态执行语句? 由于在PL/SQL 块或者存储过程中只支持DML语句及控制流语句,并不支持DDL语句,所以Oracle动态执行语句便应允而生了。关于DDL与DML的区别,请参见:DDL语句与DML语句及DCL和TCL。 二。动态执行语句怎么用? 动态执行语句代替了Oracle 8i中 阅读全文
posted @ 2016-10-19 09:31
熊猫卡洛斯
阅读(3063)
评论(0)
推荐(0)
摘要:
--内置函数 --聚合函数 返回单个值 select count(*) from student where sclass='95031'; --count()记录条数 select sum(degree) from score t; --sum(degree)求成绩总和 select avg(degree) from score t; ... 阅读全文
posted @ 2016-10-19 08:51
熊猫卡洛斯
阅读(240)
评论(0)
推荐(0)
摘要:
--insert into添加数据 insert into student(sno,sname,ssex) values('110','王军','男'); --提交事物 commit; --回滚事物 --rollback; insert into teacher1 select * from teacher; insert into teacher1(ton,tname,prof) se... 阅读全文
posted @ 2016-10-19 08:50
熊猫卡洛斯
阅读(361)
评论(0)
推荐(0)
摘要:
--查询列 Select t.sname,t.ssex,t.class from student t --t 别名; Select *from student t; --* 代表查询表内所有数据 Select *from student t where t.sclass='95031'; --规定判断条件t.sclass='95031',用where连接 Select t.sn... 阅读全文
posted @ 2016-10-19 08:50
熊猫卡洛斯
阅读(175)
评论(0)
推荐(0)
摘要:
--删除 drop table dianfei; --创建表 create table dianfei ( uon varchar2(10) not null, mmonth varchar2(6) not null, ddf number(6,2) not null, djftime date not null, djfzt varchar2(3) not null, dsyjf date ... 阅读全文
posted @ 2016-10-19 08:48
熊猫卡洛斯
阅读(658)
评论(0)
推荐(0)