广告
返回顶部
首页 > 资讯 > 数据库 >oracle+function
  • 894
分享到

oracle+function

摘要

create or replace function fn_assetode(i_type_code in varchar2,                                    i_src_COLM IN va


	oracle+function
[数据库教程]

create or replace function fn_assetode(i_type_code in varchar2,
                                    i_src_COLM IN varchar2,
                                    i_date in varchar2,
                                       i_src_cd in varchar2)
 return varchar2 as
   
    o_tar_code varchar2(40);
begin
 if i_type_code=‘1‘ then
  select fi_id into o_tar_code
  from t1
  where
  (case when i_scr_cd in (‘NFC‘) THEN NFC_ASSET_ID
     WHEN i_scr_cd IN (‘GLD‘) THEN GLD_ASSET_ID)=i_src_COLM
 ELSIF (i_type_code=‘2‘ OR i_type_code=‘3‘) THEN
  SELECT t2.fi_id into o_tar_code
  from (select distinct new_windcode ,asharecode , row_number() over(partition by new_windcode order by times desc) rn from win_asset_id_mapping)t1
  inner join t2
  on t1.asharecode=t2.asharecode
  where t1.asharecode is not null and t1.rn=1
  and t1.new_windcode=i_src_COLM
 elsif i_type_code=‘4‘ then
  select fi_id into o_tar_code
  from t1
  where to_date(i_date,‘YYYYMMDDHH24MISS‘)>=txdate     else
     o_tar_code=‘‘;
    end if;
    return o_tar_code;
end fn_assetode;

oracle+function

原文地址:https://www.cnblogs.com/zhanglin123/p/13409288.html

您可能感兴趣的文档:

--结束END--

本文标题: oracle+function

本文链接: https://www.lsjlt.com/news/7637.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • oracle中explain的用法
    oracle中的explain命令用于分析sql语句的执行计划,使用方法为在sql语句前添加explain关键字。explain结果包含id、操作符类型、行数估计、成本估计、输出行数估计...
    99+
    2024-05-04
    oracle access sql语句
  • oracle中tochar的用法
    oracle to_char 函数将数字、日期或时间值转换为字符串。格式化字符串指定输出格式,包括日期、时间和数字格式元素。常见日期格式元素包括“%y”(年)和“%m”(月),数字格式元...
    99+
    2024-05-04
    oracle 格式化输出
  • oracle中从右往左截取的函数是什么
    oracle 的 ltrim 函数用于从字符串右侧截取所有空白字符,包括空格、制表符、换行符和回车符。它返回修剪后的字符串,如果字符串不包含空白,则返回原始字符串。 LTRIM 函数 ...
    99+
    2024-05-04
    oracle
  • oracle中regexp_like的用法
    oracle 中的 regexp_like 函数用于比较字符串是否与正则表达式相匹配,返回布尔值:语法: regexp_like(string, regexp, [condition])...
    99+
    2024-05-04
    oracle
  • oracle中regexplike用法
    oracle regexp_like 运算符用于执行正则表达式匹配,检查字符串是否符合指定模式,返回布尔值。它支持各种元字符,如 .、*、+、、^、$、[]、{},允许复杂的匹配模式。此...
    99+
    2024-05-04
    oracle
  • oracle中null和空字符串是等价的嘛
    oracle 中,null 和空字符串不相等。null 代表未知值,与任何值都不相等;空字符串是一个长度为 0 的字符串,可以与其他空字符串相等。null 与空字符串的差异在于:null...
    99+
    2024-05-04
    oracle
  • oracle中listagg函数的用法
    listagg 函数将一组行的数据连接成一个字符串,使用指定的连接符分隔元素。用法包括:1. 连接一个列中的所有值;2. 使用连接符分隔值;3. 忽略 null 值;4. 按组分区;5....
    99+
    2024-05-04
    oracle
  • oracle中count函数与什么函数一样
    oracle 中 count 函数相当于 sql 中的 count() 函数。它用于计算指定列或表达式的非空值的个数,包括:count(*):计算表中所有非空值的个数。count(col...
    99+
    2024-05-04
    oracle
  • oracle中的rownum如何替代
    除 oracle 的 rownum 伪列外,您可以使用以下替代方案获取行的顺序号:1. 子查询(使用嵌套子查询);2. 分析函数(例如 row_number());3. 序列(对于新插入...
    99+
    2024-05-04
    oracle
  • oracle中declare用法
    oracle 中的 declare 语句声明变量、常量和游标等对象。其语法为:declare [修饰符] 标识符 数据类型 [default 默认值] [, ...], 用于存储临时数据...
    99+
    2024-05-04
    oracle
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作