Calling a UDF with INSERT
Go Up to Calling a UDF
In INSERT
statements, a UDF can be used in the comma-delimited list in the VALUES
clause.
The following statement uses TRIM()
to remove leading blanks from firstname and trailing blanks from lastname before inserting the values of these host variables into the EMPLOYEE
table:
INSERT INTO EMPLOYEE(FIRST_NAME, LAST_NAME, EMP_NO, DEPT_NO, SALARY) VALUES (TRIM (0, ' ',:firstname), TRIM (1, ' ', :lastname), :empno, :deptno, greater(30000, :est_salary));