好久没写过程了,写的有点生涩!
create or replace function fun_get_reversion_remark(bms_accept_id in varchar2) return varchar2
----根据定单id获取预约备注信息
is
Result varchar2(512);
v_yyyymm varchar2(20);
v_sql varchar2(512);
begin
v_yyyymm:=Substr(bms_accept_id, 0, 6);
v_sql:='select bms_accept_detail From bms_accept_form_'||v_yyyymm||' t where sn=65 and t.bms_accept_id='''||bms_accept_id||'''';
execute immediate v_sql into Result;
return(Result);
exception
WHEN OTHERS THEN
Result:=null;
return Result;
end fun_get_reversion_remark;
分享到:
相关推荐
select into 和 insert into select 两种表复制语句 第一句(select into from)要求目标表(destTbl)不存在,因为在插入时会自动创建 第二句(insert into select from)要求目标表(destTbl)存在,由于目标表...
SQL> select instr('oracle traning','ra',1,2) instring from dual; INSTRING --------- 9 6.LENGTH 返回字符串的长度; SQL> select name,length(name),addr,length(addr),sal,length(to_char(sal)) from ....
2.SELECT INTO STATEMENT 将select查询的结果存入到变量中,可以同时将多个列存储多个变量中,必须有一条 记录,否则抛出异常(如果没有记录抛出NO_DATA_FOUND) 例子: BEGIN SELECT col1,col2 into 变量1,变量2 ...
To install Oracle SQL Developer 2.1 download the file and unzip into an empty folder. Select the "Use folder names" checkbox when unzipping the file. You can migrate your settings from Oracle SQL ...
1.INSERT INTO SELECT语句 语句形式为:Insert into Table2(field1,field2,…) select value1,value2,… from Table1 或者:Insert into Table2 select * from Table1 注意:(1)要求目标表Table2必须存在,并且...
全网最全的SQL 讲解,带实例描述 ...21. SQL SELECT INTO 语句 28 22. SQL CREATE DATABASE 语句 29 23. SQL CREATE TABLE 语句 29 24. SQL 约束 (Constraints) 30 25. SQL NOT NULL 约束 31 ……
使用SQL的常见关系数据库管理系统有:Oracle、 Sybase、 Microsoft SQL Server、 Access等等。虽然绝大多数的数据库系统使用SQL,但是它们同样有它们自立另外的专有扩展功能用于它们的系统。但是,标准的SQL命令,...
To install Oracle SQL Developer 2.1 download the file and unzip into an empty folder. Select the "Use folder names" checkbox when unzipping the file. You can migrate your settings from Oracle SQL ...
To install Oracle SQL Developer 2.1 download the file and unzip into an empty folder. Select the "Use folder names" checkbox when unzipping the file. You can migrate your settings from Oracle SQL ...
To install Oracle SQL Developer 2.1 download the file and unzip into an empty folder. Select the "Use folder names" checkbox when unzipping the file. You can migrate your settings from Oracle SQL ...
To install Oracle SQL Developer 2.1 download the file and unzip into an empty folder. Select the "Use folder names" checkbox when unzipping the file. You can migrate your settings from Oracle SQL ...
To install Oracle SQL Developer 2.1 download the file and unzip into an empty folder. Select the "Use folder names" checkbox when unzipping the file. You can migrate your settings from Oracle SQL ...
在实际生产环境下,有时需将超大规模数据(如超过2亿条)导入分区表,但因原表与目的分区表的字段不一致,且用Kettle等转换工具极易失败,而用insert into select t1,t2.. from tab的Oracle SQL方式直接执行将导致...
To install Oracle SQL Developer 2.1 download the file and unzip into an empty folder. Select the "Use folder names" checkbox when unzipping the file. You can migrate your settings from Oracle SQL ...
To install Oracle SQL Developer 2.1 download the file and unzip into an empty folder. Select the "Use folder names" checkbox when unzipping the file. You can migrate your settings from Oracle SQL ...
SQL> create table table1(xm varchar(8)); SQL> insert into table1 values('weather'); SQL> insert into table1 values('wether');...SQL> select xm from table1 where soundex(xm)=soundex('weather');
简单的介绍了一个常用的SQL 语句 3.2 例3.2_1 执行SQL语句。 SELECT sysdate FROM dual; 例3.2_2 执行PL/SQL程序。 SET SERVEROUTPUT ON BEGIN DBMS_OUTPUT.PUT_LINE('这是第一个PL/SQL程序'); END; / 3.3.2 ...
Oracle SQL Developer, v1.5.0.54.40 Release Notes 完整版下载:http://www.oracle.com/technology/global/cn/software/products/sql/index.html 1. Known Issues 1.1 General - Print prints only one page ...
介绍PL/SQL程式結構 常用資料型態及變數宣告 指定變數值與變數初始化 SELECT...INTO... 運算 常用的 Oracle Build-in Function 流程控制結構 迴圈