Handling nulls when creating the function  Deleting a SQLJ function name

Chapter 5: SQLJ Functions and Stored Procedures

Handling nulls in the function call

You can use a conditional function call to handle null values for non-nullable parameters. The following example uses a case expression:

select name, 
	case when jobcode is not null 
		then job_of(jobcode) 
		else null end
from sales_emps where 
	case when jobcode is not null 
		then job_of(jobcode) 
		else null end <> "Admin"

In this example, we assume that the function job_of was created using the default clause called on null input.





Copyright © 2005. Sybase Inc. All rights reserved. Deleting a SQLJ function name

View this book as PDF