-- Create table
create table TAB_TEST
(
id VARCHAR2(40) not null,
fxnum VARCHAR2(40)
)

----------------------------------------------------------

create or replace function f_GetFxNum
return nvarchar2
as
FxNum nvarchar2(16);
begin
SELECT 'FX'||(NVL(MAX(SUBSTR(FxNum,3,14)),TO_CHAR(SYSDATE,'YYYYMMDD')||'000000')+1) into FxNum FROM TAB_TEST WHERE SUBSTR(FxNum,3,8)=TO_CHAR(SYSDATE,'YYYYMMDD') ;
return FxNum;
end;

 

-------------------------------------------------------------

select f_GetFxNum() from dual

相关文章:

  • 2021-09-16
  • 2022-01-21
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案