Tuesday, May 14, 2019

How to write and call PL/SQL function in SQL script using WITH clause?

Example# 1:



WITH
FUNCTION voter(age NUMBER) Return VARCHAR2
IS
BEGIN
If(age > 18) THEN
RETURN 'Eligible for voting.';
ELSE
RETURN 'Not eligible for voting.';
END if;
END;
--

SELECT voter(19) FROM dual;
--

Output:

Eligible for voting. 

Note:

In this case PL/SQL function object not saved or created. We must write the function where we want to use. (See above example# 1.)

2 comments:

  1. Hey Guys, If you want to use this converter then you can easily convert your one file to other file;

    File to File Convertor

    ReplyDelete

Steps to get ZPL code output using Zebra viewer - Online

Introduction ZPL is a print language used by many label printers. A print language is a set of commands that can be used to draw elements li...