首页 > 数据库 >Oracle EBS 查询用户密码

Oracle EBS 查询用户密码

时间:2024-04-07 16:58:45浏览次数:18  
标签:RETURN fnd EBS apps 查询 VARCHAR2 user pass Oracle

程序包头:

 

CREATE OR REPLACE PACKAGE cux_fnd_web_sec IS
  FUNCTION get_user_pass(p_fnd_user    IN VARCHAR2,
                         p_guest_login IN VARCHAR2 DEFAULT 'GUEST/ORACLE')
    RETURN VARCHAR2;
  FUNCTION get_apps_pass(p_guest_login IN VARCHAR2 DEFAULT 'GUEST/ORACLE')
    RETURN VARCHAR2;
  --iven.lin 2018-01-01
  FUNCTION encrypt(key IN VARCHAR2, VALUE IN VARCHAR2) RETURN VARCHAR2;
  --iven.lin 2028-01-01
  FUNCTION decrypt(key IN VARCHAR2, VALUE IN VARCHAR2) RETURN VARCHAR2;
END cux_fnd_web_sec;

 

程序包体:

CREATE OR REPLACE PACKAGE BODY cux_fnd_web_sec IS
  FUNCTION encrypt(key IN VARCHAR2, VALUE IN VARCHAR2) RETURN VARCHAR2 AS
    LANGUAGE JAVA NAME 'oracle.apps.fnd.security.WebSessionManagerProc.encrypt(java.lang.String,java.lang.String) return java.lang.String';
  FUNCTION decrypt(key IN VARCHAR2, VALUE IN VARCHAR2) RETURN VARCHAR2 AS
    LANGUAGE JAVA NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String';
  FUNCTION get_apps_pass(p_guest_login IN VARCHAR2 DEFAULT 'GUEST/ORACLE')
    RETURN VARCHAR2 IS
    l_apps_encrypted_pass VARCHAR2(200);
    l_apps_decrypted_pass VARCHAR2(200);
  BEGIN
    -- get apps encrypted pass
    SELECT encrypted_foundation_password
      INTO l_apps_encrypted_pass
      FROM apps.fnd_user
     WHERE user_name = 'GUEST';
    --decrypt apps pass
    SELECT decrypt(p_guest_login, l_apps_encrypted_pass)
      INTO l_apps_decrypted_pass
      FROM dual;
    RETURN l_apps_decrypted_pass;
  END get_apps_pass;
  FUNCTION get_user_pass(p_fnd_user    IN VARCHAR2,
                         p_guest_login IN VARCHAR2 DEFAULT 'GUEST/ORACLE')
    RETURN VARCHAR2 IS
    l_user_encrypted_pass VARCHAR2(200);
    l_user_decrypted_pass VARCHAR2(200);
  BEGIN
    -- get fnd user encrypted pass
    BEGIN
      SELECT encrypted_user_password
        INTO l_user_encrypted_pass
        FROM fnd_user
       WHERE user_name = p_fnd_user;
    EXCEPTION
      WHEN no_data_found THEN
        RETURN 'User ' || p_fnd_user || ' is not exist in FND_USER table';
    END;
    --decrypt user pass
    SELECT decrypt(get_apps_pass(p_guest_login), l_user_encrypted_pass)
      INTO l_user_decrypted_pass
      FROM dual;
    RETURN l_user_decrypted_pass;
  END get_user_pass;
END cux_fnd_web_sec;

 

--使用

   SELECT cux_fnd_web_sec.get_user_pass('用户名' ) FROM dual; 

 

标签:RETURN,fnd,EBS,apps,查询,VARCHAR2,user,pass,Oracle
From: https://www.cnblogs.com/ivenlin/p/18119385

相关文章

  • 【OracleEBS】 科目余额SQL
     selectgb.period_year会计年度,gb.period_name会计期间,gcck.concatenated_segments科目代码,gl_flexfields_pkg.get_description_sql(gcck.chart_of_accounts_id,'',......
  • 【OracleEBS】 用PL/SQL运行工作流
      declarev_itemtypevarchar2(30):='TPLEAVE';--ItemTypeInternalNamv_processvarchar2(30):='DEFAULT_PROCESS';--ProcessNamev_itemkeyvarchar2(30);beginselectrcv_transactions_s.nextvalintov_itemkeyfromd......
  • 【OracleEBS】 根据组织id得到帐套id和公司名称
      declarel_org_information3varchar2(150);--帐套idl_company_descvarchar2(150);--公司中文描述beginselecto3.org_information3,o3.attribute3intol_org_information3,l_company_descfromhr_all_organization_unitso,hr_a......
  • 【OracleEBS】 在PL/SQL中调用Oracle ERP请求
      procedureprc_do_import_request(prm_orginnumber,prm_appcodeoutnumber,prm_appmsgoutvarchar2)iscustom_exceptionexception;successboolean;v_request_......
  • 【OracleEBS】 订单暂挂问题sql解决
    ---查询请购单的状态select*frompo_requisition_headers_allporwherepor.requisition_header_id=63578;---修改请购单状态为未提交审批updatepo_requisition_headers_allporhsetporh.authorization_status='INCOMPLETE'whereporh.requisition_header_id=6......
  • 【CSP】202112-2 序列查询新解
    题目大意:给定一长度为n+1的严格单增数列A[a0,a1,a2,a3...,an],其中a0=0,an<N定义f(x)为数列A中小于等于x的最大整数的下标,r=floor(N/(n+1)),g(x)=floor(x/r)。当N<1e9,n<1e4的时候,求解|g(x)-f(x)|之和,x=0,1,2...,N-1 分析:数据规模较大,如果一项一项求和将会超时。为优化朴素方法,观......
  • vue websocket电脑端前端集成
    后端数据用websocket推送数据,前端在大屏左上角模块页面接收,用bus发送到其他模块(总共6个模块页面,从左上模块页面发送到其他5个模块页面)页面,数据用于大屏上显示,废话不多说,直接上代码。eventBus.js文件,放到根目录src->assets->js文件夹下,eventBus.js文件内容如下:importVuefr......
  • Oracle 实现当月日历
    selectmax(su)su,max(mo)mo,max(tu)tu,max(we)we,max(th)th,max(fr)fr,max(sa)safrom(selectcasewhend=1thenddendsu,casewhend=2thenddendmo,casewhend=3thenddendtu,casewhend=4thenddendwe,casewhend=5t......
  • Oracle 提取第5条到第10条的数据
    DEMO --创建表createtablecux_num_temp(namevarchar2(100),agenumber,addtimedate);---插入测试数据insertintocux_num_temp(name,age,addtime)values('123',99,sysdate);insertintocux_num_temp(name,age,addtime)values(&#......
  • MySQL分组查询实例
    DDL——学生表——成绩表CREATETABLE`student`(`id`int(11)NOTNULLAUTO_INCREMENTCOMMENT'学号',`createDate`datetimeDEFAULTNULL,`userName`varchar(20)DEFAULTNULL,`pwd`varchar(36)DEFAULTNULL,`phone`varchar(11)DEFAULTNULL,`ag......