Re: Forms4.5 Question about CURSOR and DECODE

From: Dragan Pavljuk <dpavljuk_at_beotel.yu>
Date: Fri, 13 Nov 1998 01:25:31 +0100
Message-ID: <364B7C7B.C7F9B9CB_at_beotel.yu>


Hi

Yuo can try something like this :

In order you can put :

     ORDER BY DECODE (sorting_p , 'JN', d.v51_nr,999),
                          DECODE (sorting_p ,'NJ', d.v52_nr,999),
                          DECODE (sorting_p , 'JJ',d.nr,999)

Regards
Dragan

Buergi Josef wrote:

> Hello
>
> I have a big problem about the following cursor in a Forms Procedure:
>
> CURSOR par_cur (kkey_p NUMBER, sorting_p CHAR) IS
> SELECT d.indx, capdesc, p.support, p.rinfo,
> d.constat, d.status, d.ref, p.note
> FROM pics_param_def d, pics_cust_par p, pics_source s
> WHERE d.indx = p.indx AND
> kkey = kkey_p AND
> d.source = s.source AND
> p.id = id_p AND
> p.release = release_p AND
> (s.v51_flag = v51_p OR s.v52_flag = v52_p)
> ORDER BY DECODE (sorting_p , 'JN', d.v51_nr, 'NJ', d.v52_nr, 'JJ',
> d.nr);
>
> The sort order should be driven from sorting_p !
>
> I try to open it with OPEN par_cur(1,'JN'). And it does not work !!
>
> But - If I do the follwoing line in the Cursor (for example)
>
> ORDER BY DECODE ('JN' , 'JN', d.v51_nr, 'NJ', d.v52_nr, 'JJ', d.nr);
>
> it works fine.
>
> Why can I not pass a variable to the cursor ????
>
> Any help is welcome .......
>
> Regards
>
> Joseph
>
> josef.buergi_at_ascom.ch
Received on Fri Nov 13 1998 - 01:25:31 CET

Original text of this message