`
huangzhir
  • 浏览: 125099 次
  • 性别: Icon_minigender_1
  • 来自: 福州
文章分类
社区版块
存档分类
最新评论

oracle 动态sql select into

阅读更多
好久没写过程了,写的有点生涩!
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;
0
0
分享到:
评论

相关推荐

    select into和insert into select使用方法

    select into 和 insert into select 两种表复制语句 第一句(select into from)要求目标表(destTbl)不存在,因为在插入时会自动创建 第二句(insert into select from)要求目标表(destTbl)存在,由于目标表...

    MYSQL,SQLSERVER,ORACLE常用的函数

    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 ....

    oracle存储过程

    2.SELECT INTO STATEMENT 将select查询的结果存入到变量中,可以同时将多个列存储多个变量中,必须有一条 记录,否则抛出异常(如果没有记录抛出NO_DATA_FOUND) 例子: BEGIN SELECT col1,col2 into 变量1,变量2 ...

    Oracle SQL Developer 1.5.5.59.69-with-jdk6.part1

    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 ...

    SELECT INTO 和 INSERT INTO SELECT 两种表复制语句详解(SQL数据库和Oracle数据库的区别)

    1.INSERT INTO SELECT语句 语句形式为:Insert into Table2(field1,field2,…) select value1,value2,… from Table1 或者:Insert into Table2 select * from Table1 注意:(1)要求目标表Table2必须存在,并且...

    Sql 语句详解

    全网最全的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.rar_SQL INSERT_drop_insert into_oracle_sybase

    使用SQL的常见关系数据库管理系统有:Oracle、 Sybase、 Microsoft SQL Server、 Access等等。虽然绝大多数的数据库系统使用SQL,但是它们同样有它们自立另外的专有扩展功能用于它们的系统。但是,标准的SQL命令,...

    Oracle SQL Developer 2.1.0.63.73 for linux-noarch.part1

    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 ...

    Oracle SQL Developer 2.1.0.63.73 for linux-noarch.part2

    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 ...

    Oracle SQL Developer 2.1.0.63.73 for mac-osx-no-jre.part2

    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 ...

    Oracle SQL Developer 2.1.0.63.73 for 64bit-windows-no-jre.part2

    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 ...

    Oracle SQL Developer 2.1.0.63.73 for other-platform-no-jre.part1

    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 ...

    Oracle中如何对超大规模数据(如超过2亿条)直接用SQL语句入库?

    在实际生产环境下,有时需将超大规模数据(如超过2亿条)导入分区表,但因原表与目的分区表的字段不一致,且用Kettle等转换工具极易失败,而用insert into select t1,t2.. from tab的Oracle SQL方式直接执行将导致...

    Oracle SQL Developer 1.5.5.59.69-with-jdk6.part2

    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 ...

    Oracle SQL Developer 2.1.0.63.73 for 32bit-windows-no-jre.part2

    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 ...

    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');

    Oracle 10g SQL操作.zip

    简单的介绍了一个常用的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 sqldeveloper without jdk (win+linux)

    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 ...

    oracle pl/sql

    介绍PL/SQL程式結構 常用資料型態及變數宣告 指定變數值與變數初始化 SELECT...INTO... 運算 常用的 Oracle Build-in Function 流程控制結構 迴圈

Global site tag (gtag.js) - Google Analytics