Home >Database >Mysql Tutorial >Oracle自定义函数查询数据字典项

Oracle自定义函数查询数据字典项

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:30:011324browse

/****************************** 假设存储数据字典表名:data_dict_entry 表结构如下: create table data_dict_entry ( DI

/******************************

假设存储数据字典表名:data_dict_entry
 
表结构如下:
 
create table data_dict_entry
 (
  DICTTYPEID VARCHAR2(128) not null,
  DICTID    VARCHAR2(128) not null,
  DICTNAME  VARCHAR2(255),
  STATUS    NUMBER(10),
  SORTNO    NUMBER(10),
  RANK      NUMBER(10),
  PARENTID  VARCHAR2(255),
  SEQNO      VARCHAR2(255),
  FILTER1    VARCHAR2(255),
  FILTER2    VARCHAR2(255)
 )
 

/******************************/
 
create or replace function QUERY_DICT_SEXCODE(code_value in varchar2) return varchar2
 
  is Result varchar2(50);
 
/************开始******************/
 
  mid_vlaue  varchar2(50);
 begin
  select t.dictname into mid_vlaue  from data_dict_entry t where t.dicttypeid='type_Id' and t.dictid=code_value;
    Result:=mid_vlaue ;
    return(Result);
 end QUERY_DICT_SEXCODE;

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn