Search code examples
oracle-databaseplsqluser-defined-types

IF EXISTS Statement in a PLSQL Procedure


im very new at plsql and try to implement my procedure.

My procedure signature looks like

PROCEDURE signal_merge(s1 IN SIGNAL_STRUCT, s2 IN SIGNAL_STRUCT, rs OUT SIGNAL_STRUCT)

SIGNAL_STRUCT has an (I call it field?) "updated" that is of a type UPDATED_STRUCT

Now I want to do something like

if s2.updated exists
   do something

Even with Google I cant find a solution, can somebody explain me how I can achieve this?

Thank you all


Solution

  • I need to know its null or not

    Then test for that:

    if s2.updated is not null then
      -- do something
    end if;
    

    Read more.