Name

sprintf_or_null — returns a formatted string or null if any of the arguments except the first is null.

Synopsis

sprintf_or_null ( format string ,
arg_1 any ,
... ,
arg_x any );

Description

sprintf_or_null is similar to sprintf and returns a new string formed by "printing" a variable number of arguments arg_1 - arg_x according to the format string format. The difference is that the function can return null if any of the arguments except the first one is null.

Examples

Example24.392.Simple Use

create function job_history(
  in EMPLOYEE_ID integer,
  in START_DATE date) returns varchar
{
return sprintf_or_null
('http://demo.openlinksw.com:8890/hr/job_history#%d_%s',
EMPLOYEE_ID, cast (START_DATE as varchar) );
};