CREATE OR REPLACE FUNCTION SF_YF_GETPZBSM ( PZSM000 in varchar2 --追溯码 ) -- modification history -- Person Date Comments -- linshu 2025.05.30 获取标识码; for YF9-20250523-005 return varchar2 is LS_PZBSM0 varchar2(30); begin if length(PZSM000) >= 46 then --进口药 select substr(PZSM000,1,16) into LS_PZBSM0 from dual; else select substr(PZSM000,1,7) into LS_PZBSM0 from dual; end if; return LS_PZBSM0; end;