Seen in the wild

jdavidb on 2003-06-05T18:22:29

I just found the following in someone else's PL/SQL program:

   SELECT p_item_segment1||'.'||p_item_segment3
     INTO lv_item_number
     FROm dual;

First of many, I'm sure. I'll try to remember to report here the first time I do it.

For those of you who may not be fluent in PL/SQL, the above is functionally equivalent to:

lv_item_number := p_item_segment1 || '.' ||
                  p_item_segment3;

A rough Perl translation of the latter would be:

$lv_item_number = join('.',
                       $p_item_segment1,
                       $p_item_segment3);

A rough Perl translation of the former would require loading DBI and sending your two values to the database to be joined in SQL.