Forum Stats

  • 3,781,297 Users
  • 2,254,499 Discussions
  • 7,879,635 Comments

Discussions

form 6i error - error 103 encountered the symbol case

SANPAT
SANPAT Member Posts: 1,086 Silver Badge
edited Dec 17, 2015 9:12AM in Forms

Hi

I am using Form 6i , in the Program I had given the following query where I am getting a error message . kindly see below query and screenshot

cursor c3 is select canworkorder.workorderno , sum (case when canptn.fgstat is null then canptn.ptnqty end) intqty

    , sum (case when canptn.fgstat is not null then canptn.ptnqty end) ptnqty

     , min (canptn.ons) ons    from canworkorder, canptn  where canworkorder.pendingqty > 0 

   and (canworkorder.workorderno = canptn.workorderno)  and canworkorder.pendingqty > 0 

group by canworkorder.workorderno;

form6i.jpg

sandy

Tagged:

Best Answer

  • Manu.
    Manu. Member Posts: 3,949 Bronze Crown
    edited Dec 17, 2015 9:12AM Accepted Answer

    Dear,

    Case is not supported by forms. You have 2 options,

    1) Use DECODE instead of CASE.

    2) Create record group using the same query(either design time or by using CREATE_GROUP_FROM_QUERY) and loop through the record group.

    Manu.

Answers

  • Matej D.
    Matej D. Member Posts: 1,030 Gold Trophy
    edited Dec 17, 2015 8:02AM

    The CASE statement is not supported in Forms 6i.

    Use decode or nvl.

    Regards

  • InoL
    InoL Member Posts: 9,447 Gold Crown
    edited Dec 17, 2015 8:58AM

    You are using DML in Forms. That is not a good idea. Move the code to the database. Here you can use CASE and many other features of SQL and PL/SQL that are not available in Forms.

    Be very careful with COMMIT! The way you are using it here will commit all pending Forms transactions, not just your database actions in the procedure.

  • Manu.
    Manu. Member Posts: 3,949 Bronze Crown
    edited Dec 17, 2015 9:12AM Accepted Answer

    Dear,

    Case is not supported by forms. You have 2 options,

    1) Use DECODE instead of CASE.

    2) Create record group using the same query(either design time or by using CREATE_GROUP_FROM_QUERY) and loop through the record group.

    Manu.

This discussion has been closed.