判斷任務過期時間
create or replace function GetUrgentState(m_TaskID varchar
m_SendTime date
m_flag varchar
return varchar
myDate date;
ExpireTime date;
strsql varchar
begin
myDate := m_SendTime;
strsql :=
m_TaskID ||
execute immediate strsql
into ExpireTime;
if ExpireTime is null then
if m_flag =
return
end if;
if m_flag =
return
end if;
end if;
if m_SendTime is null then
myDate := sysdate;
end if;
if ExpireTime < myDate then
if m_flag =
return
end if;
if m_flag =
return
end if;
end if;
if ExpireTime
if m_flag =
return
end if;
if m_flag =
return
end if;
else
if m_flag =
return
end if;
if m_flag =
return
end if;
end if;
end;
查詢其它表數據
create or replace function GetPreNode(m_PreTaskID varchar
nodename varchar
strsql varchar
begin
if m_PreTaskID is null then
return
end if;
strsql :=
m_PreTaskID||
execute immediate strsql
into nodename;
return nodename;
end;
格式化標題輸出
create or replace function FormatTitle(m_title varchar
m_length number
m_FillChar varchar
begin
if lengthb(m_title) > m_length*
return substr(m_title
else
return m_title;
end if;
end;
From:http://tw.wingwit.com/Article/program/Oracle/201311/18645.html