harsh5348
harsh5348

Reputation: 31

cursor in forms 6i

I am working on Forms 6i. I want to use a case expression in a cursor. But the code does not compile.

Does Forms 6i not support the case expression in cursor? Is there any other method to write case expression in Forms?

Upvotes: 0

Views: 1545

Answers (2)

Erich Kitzmueller
Erich Kitzmueller

Reputation: 36987

In almost all cases I can think of, you can use nested decodes instead of case.

Instead of

 select case when a=1 then 'foo'
             when b>2 then 'bar'
             else 'foobar' end
   from xyz;

you can write

 select decode(a,1,        'foo',
        decode(sign(b-2),1,'bar',
                           'foobar')) from xyz;

The other, probably more elegant possibility, is to create a database view and use it in forms, so forms 6i never sees the case.

Upvotes: 3

Ian Carpenter
Ian Carpenter

Reputation: 8626

It's because the pl/sql engine used in Forms 6i is "old" and wasn't aware of CASE statements when it was developed. (As I recall, server side pl/sql only introduced CASE statements at Oracle 9i)

I don't have a copy of form builder 9i so can't comment on that version but CASE statements are available in Forms 10g and above.

Upvotes: 2

Related Questions