Re: Developer 2000: Why use Object ID instead of Object Name?

From: Pieter Steenhuis <pieter.steenhuis_at_worldonline.nl>
Date: Fri, 18 Dec 1998 21:54:15 +0100
Message-ID: <367AC0F7.2B25120B_at_worldonline.nl>


If you first use find_<objectname>, you can test if the object really exists and handle non-existence in a nice way, instead of the errormessage 'cannot find item, invalid id'.

I don't have any documentation here, but my guess is, that find_item doesn't raise an error if the specified item can't be found, but simply returns null.

If this is true, you can write code like this:

v_item_id := find_item('MY_ITEM');
if v_item_id is null
then

    show_message('Can not find item MY_ITEM.');     raise form_trigger_failure;
end if;
copy('my_value',v_item_id);

I hope this helps..

Pieter.

John Haskins wrote:

> I'm working with Developer's built-ins and noticing that many of them accept
> either an object name or an object ID as input. Why go to the extra trouble
> to create a variable to store the object ID, extract the object's ID with
> FIND_objectname, and then use it? Since you have to know the object's name
> to get the ID anyway, it seems it's easier to just use the name and be done
> with it.
>
> Opinions on this are welcome...I'm sure there's some reason Oracle went to
> the trouble to make this feature available.
Received on Fri Dec 18 1998 - 21:54:15 CET

Original text of this message