Case statement problems in oracle forms 6i

Hello,
Any one can help me that how to use case statment in Oracle forms 6i.
i have read one thread and there was no proper solution so could any one please let me know to use case statement.
Please also let me know which category i should search for FORMS 6i.
when i'm using below code with cursor then i'm getting error 103
database:=11g
application := forms 6i
operating system:= win Xp
code is given below :-
cursor c1 is
select nc.nomenclature_id,
nvl(nc.category_value, 0) master,
nvl(nc2.category_value, 0) case,
nvl(nc3.category_value, 0) bundle,
case
when nvl(nc.category_value, 0) > 0 and
nvl(nc2.category_value, 0) > 0 and
nvl(nc3.category_value, 0) > 0 then
'A' --All packouts Master, Case, Bundle
when nvl(nc.category_value, 0) > 0 and
nvl(nc2.category_value, 0) > 0 and
nvl(nc3.category_value, 0) = 0 then
'B' --Both Master and Case
when nvl(nc2.category_value, 0) = 0 and
nvl(nc3.category_value, 0) = 0 then
'C' --Master Case Only
else
'N'
end code
from nomn_category nc, --master case
(select nc2.nomenclature_id,
nc2.category_value
from nomn_category nc2
where nc2.category_id = '230732') nc2,
(select nc3.nomenclature_id,
nc3.category_value
from nomn_category nc3
where nc3.category_id = '236566') nc3
Edited by: Rahul on Feb 3, 2012 7:18 PM
Edited by: Rahul on Feb 3, 2012 7:20 PM

hello Andreas,
It is ok but i dont have to use view there.
i need to use without view, because this code has to be use in FORMS6i.
But Forms6i doesn't support to case function. i'm newbie in Forms.
If you can convert to below bold one portion(case) into decode then please help me or
if you have any idea about Forms6i then please send me any link where is given explanation about excel report that how to make excel report through Forms6i step by step and that excel report should be generate on any dynamic path which is given by user:-
cursor c1 is
select nc.nomenclature_id,
nvl(nc.category_value, 0) master,
nvl(nc2.category_value, 0) case,
nvl(nc3.category_value, 0) bundle,
case
when nvl(nc.category_value, 0) > 0 and
nvl(nc2.category_value, 0) > 0 and
nvl(nc3.category_value, 0) > 0 then
*'A'*
when nvl(nc.category_value, 0) > 0 and
nvl(nc2.category_value, 0) > 0 and
nvl(nc3.category_value, 0) = 0 then
*'B' --Both Master and Case*
when nvl(nc2.category_value, 0) = 0 and
nvl(nc3.category_value, 0) = 0 then
*'C'*
else
*'N'*
end "code"
from nomn_category nc,
(select nc2.nomenclature_id,
nc2.category_value
from nomn_category nc2
where nc2.category_id = '230732') nc2,
(select nc3.nomenclature_id,
nc3.category_value
from nomn_category nc3
where nc3.category_id = '236566') nc3
thanks

Similar Messages

  • Can i use case in query in oracle form 6i

    sir can i use case in query in oracle form 6i
    such as
    select empno, case when deptno=10 then dptno end from emp;
    please gice me

    Hello,
    Does this code compile ?
    If not, I'm afraid that the PL/SQL engine of Forms6i does not recognize this syntax.
    Francois

  • Problem Querying Oracle Forms Using a Date Field and a Format Mask

    Hello,
    We are experiencing a problem with Oracle Forms that I was wondering if you can help me with.
    We have several Forms that have single database blocks assigned to Oracle tables. The Forms are queryable and one of the fields we’re querying on is assigned to a field on the base table which is Not Null and has a Type of DATE. We are storing date/time information in this field on the database table. The item on the form is set up as a Date field with a Maximum Length of 7, a Format Mask ‘MMDDYY’ and having a Query Length of 10.
    We’ve seen a discrepancy in how these fields are used to query the base table block. On some user’s computers they are able to enter a 6 digit date followed by the % sign (e.g. ‘091808%’) and they get the expected results. Other users get ‘FRM-40301: Query caused no records to be retrieved. Re-enter’. Do you know why we are experiencing this difference?
    - The Oracle Database version we are running is Release 10.1.0.5.0.
    - The Forms Developer version that we’re experiencing the problem with is 4.5.10.15.2
    Thanks,
    Kris

    There is no obvious reason that I can see.
    Version 4.5 is very old so you might have problems calling Oracle Support. If you can reproduce the same problem o0n 10.1.2 you should call have them analyze the problem.

  • List Item problem in oracle forms

    Hi,
    I am using list item in oracle forms 6i and facing one problem. I am populating list using following built-in.
    Clear_list()
    Create_Group_From_Query( )
    Populate_list()
    The problem I am facing is when list gets populate it keep the cursor at last element of list with null value. I want cursor to go at first item in the list. Is this thing is possible. The list item I am using is pop-list. In combo its showing list perfectly but I have to use pop-list only. Please help to come out of this problem.
    Thanks in advance
    Shweta.

    Hi Shweta,
    Please post your query in Oracle Forms discussion forum.
    Thanks,
    Wilson.

  • Problem installing Oracle forms and report in windows 7

    I have a problem while installing Oracle forms and reports in windows 7 64 bit
    The error is : [as] [ERROR] [] [oracle.as.provisioning] [tid: 20] [ecid: 0000IY5_e_EApIRMyYAhMG1BuDGr00000B,0] [[
    oracle.as.provisioning.exception.ASProvWorkflowException: Error Executing workflow.
    at oracle.as.provisioning.engine.WorkFlowExecutor._createDomain(WorkFlowExecutor.java:688)
    at oracle.as.provisioning.engine.WorkFlowExecutor.executeWLSWorkFlow(WorkFlowExecutor.java:393)
    at oracle.as.provisioning.engine.Config.executeConfigWorkflow_WLS(Config.java:866)
    at oracle.as.install.classic.ca.standard.StandardWorkFlowExecutor.execute(StandardWorkFlowExecutor.java:65)
    at oracle.as.install.classic.ca.standard.AbstractProvisioningTask.execute(AbstractProvisioningTask.java:26)
    at oracle.as.install.classic.ca.standard.StandardProvisionTaskList.execute(StandardProvisionTaskList.java:61)
    at oracle.as.install.classic.ca.ClassicConfigMain.doExecute(ClassicConfigMain.java:124)
    at oracle.as.install.engine.modules.configuration.client.ConfigAction.execute(ConfigAction.java:335)
    at oracle.as.install.engine.modules.configuration.action.TaskPerformer.run(TaskPerformer.java:87)
    at oracle.as.install.engine.modules.configuration.action.TaskPerformer.startConfigAction(TaskPerformer.java:104)
    at oracle.as.install.engine.modules.configuration.action.ActionRequest.perform(ActionRequest.java:15)
    at oracle.as.install.engine.modules.configuration.action.RequestQueue.perform(RequestQueue.java:63)
    at oracle.as.install.engine.modules.configuration.standard.StandardConfigActionManager.start(StandardConfigActionManager.java:158)
    at oracle.as.install.engine.modules.configuration.boot.ConfigurationExtension.kickstart(ConfigurationExtension.java:81)
    at oracle.as.install.engine.modules.configuration.ConfigurationModule.run(ConfigurationModule.java:83)
    at java.lang.Thread.run(Thread.java:619)
    So I Google for it and found that this is version mismatch (May be I am wrong) and it tells that I have to install WLS - 10.3.2 with ofm_pfrd_win_11.1.1.2.0_64 (1 to 4)
    But I am unable to get wls version 10.3.2.
    For better understanding I am listing my installers :
    (I) Windows 7 Ultimate 64 Bit
    (II) (Oracle 11g) win64_11gR2_database (1 & 2)
    (III) ofm_pfrd_win_11.1.1.2.0_64 (1 to 4)
    (IV)wls1033_generic.jar , wls1033p_generic.jar , wls1035_generic.jar
    (V)accessbridge-2_0_2-fcs-bin-b06
    (VI)ofm_rcu_win32_11.1.1.2.1_disk1_1of1,ofm_rcu_win_11.1.1.3.1_disk1_1of1
    (VII) ofm_wc_generic_11.1.1.5.0_disk1_1of1
    (VIII)jdk-6u38-nb-7_2_1-windows-i586-ml , jdk-6u38-windows-x64
    (IX) oepe-wls-indigo-installer-11.1.1.8.0.201110211138-10.3.6-win32
    (X)wls1033_oepe111150_win32.exe
    (XI)wls1035_win32.exe
    (XII)wls1035_oepe111172_win64
    (XIII)oepe-indigo-installer-12.1.1.0.1.201203120349-12.1.1-win64
    After the installation while configure the forms reports, I am stuck while creating domain.
    steps I follow is :
    (i) Install Windows 7 Ultimate 64 Bit
    (ii) (Oracle 11g) win64_11gR2_database (1 & 2)
    (iii) wls1033_generic.jar
    (iv) accessbridge-2_0_2-fcs-bin-b06
    (v)ofm_rcu_win32_11.1.1.2.1_disk1_1of1
    (vi) ofm_pfrd_win_11.1.1.2.0_64 (1 to 4)
    Please any body help, for the installation of oracle forms and reports.
    I have a formatted Windows 7 Ultimate
    Where I have installed Adobe Acrobat Reader
    IIS server from windows installer
    Now I want to know the exact procedure so that i can run the forms and report in my machine.
    This is my first installation of Oracle forms & Reports, so please do not pre assume about my understanding (Like "to install this he surely did this environment settings" )
    Please specify all the steps
    Furthermore if Another software I have to download then please tell me.
    And I will be grateful if you specify the mistakes in my side.
    Looking forward with anticipation.

    Solved, Thank you

  • Creating timer problem in oracle forms

    Hello,
            I am using oracle weblogic 10.3.5 with oracle forms 11g at windows 7.I am trying to make a trigger but getting frm 40738 argument 1 to builtin GET_APPLICATION_PROPERTY cant be null error. I am using code at when-new-form-Instance trigger:
    declare
        timer_id TIMER;
        one_second number:=1000;
        st varchar2(100);
    begin
        timer_id :=find_timer('CLOCK_TIMER');
        If not id_null(timer_id) then
            delete_timer('timer_id');
        else
            timer_id := CREATE_TIMER('CLOCK_TIMER',one_second,REPEAT);
            --timer_id:=create_timer('CLOCK_TIMER',one_second,repeat);
            st:=Get_application_property(TIMER_NAME);
            message(st);
            end if;
            select to_char(sysdate,'HH24:MI:SS') into :EVENTS.CURRENT_TIME from dual;
            exception when others then
            message(TO_CHAR(SQLCODE)||''||SQLERRM);       
        end;
    and at  When-Timer-Expired trigger:
    declare
        timer_name varchar2(30);
    BEGIN
       timer_name := GET_APPLICATION_PROPERTY(TIMER_NAME);
    IF  timer_name = 'CLOCK_TIMER' THEN
          SELECT  TO_CHAR(SYSDATE,'HH24:MI:SS')
          INTO   :EVENTS.CURRENT_TIME
          FROM   DUAL;
    END IF;
       EXCEPTION WHEN OTHERS THEN
          MESSAGE(TO_CHAR(SQLCODE)||''||SQLERRM);
    END;
            Thank You
    regards
    aaditya.

    The problem is that you have a local variable with the same name as the CONSTANT "TIMER_NAME".  Therefore, your call to GET_APPLICATION_NAME is passing the value of your Local Variable to the built-in instead of the value of the CONSTANT 'TIMER_NAME."
    declare
        timer_name varchar2(30);
    BEGIN
       timer_name := GET_APPLICATION_PROPERTY(TIMER_NAME);
    IF  timer_name = 'CLOCK_TIMER' THEN
    Change your code so your variable TIMER_NAME is unique (different) from the constant TIMER_NAME variable. A common programming standard prefix your variable names with the data time.  Following this concept, rename your variable to V_TIMER_NAME.
    Craig...

  • Field selection problem in Oracle Forms

    I am using an application created in Oracle 6i Forms (patch 11).
    Mouse navigation in the forms do not work properly.
    Since a field is selected and some string is typed then first character is always ignored hence it is necessary to press a key like before typing required string.
    I'm using Java VM 1.4.1 on client-side,
    The same application works well when I'm using Oracle JInitiator.
    does anybody know how to work around the problem ?
    thanks

    Hi, again and thanks for the patience. I am using the oracle plugin all the time and it works. But I need to use the application on different computer where the oracle JInitiator could not be installed. There I am trying to use the Sun Java Plugin Version 1.4.2_06 (build 1.4.2_06-b03) which shall be compatible. Since last time I asked again the provider and I found that the application is pure Oracle Forms 9i application which doesn't need Java when it is run on the computer where the application is instaled. The Java plugin is then used to show the forms and to provide the comunication between clients and application server. Probably it is clear to you however I am not a developer but poor user only. I have also tried to play with the application to find how it works (or doesn't works). It seems that the problem is exactly with mouse navigation. When tab or enter is used then it works fine. But when a form field is selected by mouse then a character is typed and i can see it. But when I continue with the writing the first character is overwrite. Sometimes when there is a list of records row by row and I try to get to next row using the mouse the application tells me that some bloody key is not valid but using the key down I can easily go ti next row. To tell the truth I don't like mouses at all so it is no problem to me but other users do not know how Tab works :-)

  • Strange Problem in Oracle Forms.

    Hello,
    I have a strange problem of a form not opening in the migrated App Server but is working fine in the existing server.
    The problem is that we have now migrated to App Server 10.1.2.3.0 (patch applied to 10gR2 App Server installation) from 9.2.0.4.
    The issue is that the same form works perfectly fine in 9.2.0.4 but doesnt open up in the 10.1.2.3.0 server itself !
    The form is called using "new_form" procedure.
    I even cross checked by giving other form names; they work fine. But this set of forms (for which problem occurs) only doesnt open up.
    All the forms are compiled against 10.1.2.3 Compiler; All point to the same OLB and all of them have a common menu bar.
    Peculiar thing is WEBUTIL is working for all forms. Version is 1.0.6. No problems in WebUtil.
    Please help me making this sole out as we need to migrate this ASAP.
    Requesting one and all.
    Thanks.

    Solved it out..
    It was an error in frmwebutil.jar installation.
    Below is the link from Metalink:
    https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=421930.1
    Cheers !

  • Ref Cursor Problem in Oracle Forms 6i

    Hi all.
    In Oracle Forms 6i, can not I do this?
    DECLARE
    TYPE CUR_REF IS REF CURSOR;
    CUR_PRODUCTS CUR_REF;
    VAR_QUERY VARCHAR2(3000) := 'SELECT something FROM table';
    BEGIN
    OPEN CUR_PRODUCTS FOR VAR_QUERY;
    END;
    It generates error on opening that it expects a SELECT statement.
    How can I open a dynamic ref cursor in Oracle Forms 6i??? The same thing works fine in PL/SQL.
    Regards,
    Zaaf
    Thanks in advance.

    It could be like this:
    PROCEDURE dynamic_cursor ( PC$Clause  IN Varchar2 )
    IS
      cursor_number EXEC_SQL.CursType;
      -- Variables for the data to be returned into
      LC$ACTYPE       Number;
      -- Control variables
      LN$count       Number;
      LC$sql_order   Varchar2(256);
    BEGIN
         -- Open the cursor --
         cursor_number := Exec_SQL.Open_cursor;
         -- build the complete SQL order -- 
         LC$sql_order := PC$clause  ;
         -- Parse the SQL order --
         EXEC_SQL.PARSE(cursor_number, LC$sql_order);
         -- Define the columns for the data to be returned --
         EXEC_SQL.DEFINE_COLUMN(cursor_number,1,LC$ACTYPE);
         -- Execute the Cursor --
         LN$count := EXEC_SQL.EXECUTE(cursor_number);
         -- Loop and fetch each row from the result set --
         While EXEC_SQL.FETCH_ROWS(cursor_number) > 0 Loop
           EXEC_SQL.COLUMN_VALUE(cursor_number,1,LC$ACTYPE);
              begin
                select chqfac, pasfac, indbcr ,
                staxfl, excise, incchg, cat001 , trntyp , subtyp
                into s_chkbok, s_pasbok, s_intber,
                s_staxfl, s_excise, s_incchg, s_cat001 , ss_trntyp , ss_subtyp
                from stfeacty
                where brancd = s_brancd
                and actype = LC$ACTYPE;
                s_actype := LC$ACTYPE ;
              exception
                when no_data_found then
                  NULL;
                when too_many_rows then
                  NULL;
              end;
         End Loop ;
         -- Close the cursors
         EXEC_SQL.CLOSE_CURSOR(cursor_number);
    EXCEPTION
      When EXEC_SQL.INVALID_CONNECTION Then
         message('Unexpected Invalid Connection error from EXEC_SQL');
      When EXEC_SQL.PACKAGE_ERROR Then
         message('Unexpected error from EXEC_SQL: '||to_char(EXEC_SQL.LAST_ERROR_CODE)|| EXEC_SQL.LAST_ERROR_MESG);
      If EXEC_SQL.IS_OPEN(cursor_number) Then
        EXEC_SQL.CLOSE_CURSOR(cursor_number);
        message('Exception - Cleaned up Cursor');
      End if;
    END; That you could call with the following:
    dynamic_cursor('SELECT ac_type FROM SYSADM.SAVINGS');But, if the query is as simple with only the table name change, you could aslo use a simpliest solution based on a record group.
    Francois

  • List items problems in oracle forms 6i

    Hello friends,
    I am using list item in oracle forms 6i and facing one problem. I am populating list using following built-in.
    Clear_list()
    Create_Group_From_Query( )
    Populate_list()
    The problem I am facing is when list gets populate it keep the cursor at last element of list with null value. I want cursor to go at first item in the list. Is this thing is possible. The list item I am using is pop-list. In combo its showing list perfectly but I have to use pop-list only. Please help to come out of this problem.
    Thanks in advance
    Shweta.

    I have a question related to this post...what if you want the first item on the list to be the null record - but have it at the top of the list - like all other drop downs I've seen? I'm running on forms 9i
    Edited by: saburo on Mar 2, 2010 7:58 AM

  • Slow Problems with Oracle Forms 10g and Oracle Database 11g

    Hi, I wonder if there is a compatibility problem between Version 10.1.2.0.2 32 Oracle Forms and Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production. This is because my application runs correctly on a version of Oracle Database 10g, and when we migrated the database to an Oracle Database 11g, slowness problems came out.
    Thanks.

    We have the same issue happening with our custom forms and with some of the standard forms in EBSO. So far we have found that the form invoking a view causes ridiculous slowness in opening the form (40 mins). Using a table access has shortened the open time significantly. At this time Oracle DBAs at OOD have no clear idea why it is happening.
    we are on 11.1 database with 11.5 EBSO
    Edited by: user3223867 on Feb 4, 2011 7:55 AM

  • CASE STATEMENT NOW WORKING IN FORMS 6i

    Hi Friends,
    I have Written Case statement in Forms 6i, but is giving me compilation Errors...................
    The Same query is Working in TOAD...................

    Forms 6i's PL/SQL engine doesn't support CASE, you need to use DECODE.
    Latest versions of Forms support CASE.

  • Update with case statement problem.

    Hi,
    I have this statement
    update tab_tr set col_rate =
      case
      when col_ern_type in ('031','035','036') then (1.5 * col_rate)
      when col_ern_type in ('041','045','046') then (2 * col_rate)
    end;this statement updated some 2 million rows in the table tab_tr. But the total count of rows for col_ern_type in ('031','035','036', '041','045','046') yeild only around 222642 rows.
    select count(*) from tab_tr where col_ern_type in ('031','035','036', '041','045','046');  --> 222642 rowswhat is the problem with the above update statement.
    Thank you,

    Hi,
    DBA_1976 wrote:
    ... I thought the case statement conditions are counted as the where condition. But ......A CASE expression just takes the place of some other expression, such as a literal, a function, or a column.
    For example, which rows do you think this should update?
    UPDATE  tab_tr
    SET     col_rate  = 100;It would update all rows, of course.
    How about this statement?
    UPDATE  tab_tr
    SET     col_rate  = column_x;Will it only change the rows where column_x are a certain value, or not NULL, or in any way depend on column_x? No, of course not. It will update all rows.
    How about this statement?
    UPDATE  tab_tr
    SET     col_rate  = function_y (col_ern_type);Will it only change the rows where the fucntion returns a certain value? Will it depend on the value in col_ern_type? No, of course not. It calls the function for each row, and whatever the function returns (even if the function returns NULL), that's what goes into col_rate on each row.
    A CASE expression is just something that you can substitute in place of any other expression, such as the literal 100, or the column column_x, or the function function_y in the statements above. Naturally, the value that gets put into col_rate will depend on what the CASE expression returns, but the behavior of the UPDATE statement as a whole will not.

  • Another Problem with Oracle Forms 10G

    Hi Experts;
    Previously I posted here a problem was having with Oracle Form, when I tried to execute it (Internet Explorer has closed this webpage to help protect your computer. A malfunctioning or malicious add-on has caused Internet Explorer to close this webpage) .
    However, with the help of a good Buddy of this forum, I could solved the problem and my forms were running properly. But today, i don't know how it's giving me a new problem. When I choose Run Form, I get this error (website restore error. Internet Explorer has stopped trying to restore this website. It appears that the website continues to have a problem.)
    Any suggestion to solve this problem?
    Thanks for your help.
    Regards
    Al

    Hi Aamir;
    I didn't upate file, but I don't know how, but last sunday the google toolbar was installed. I removed it already yesterday, but now I got this problem, I don't know if the installation and then, removing this toolbar, updated any important file.
    The thing is, now I can not execute my forms.
    Regards;
    Al

  • Integration problem between oracle forms 10g and oracle report 10g

    Hi!
    I've got any error message "Unable to connect to the report server "server name"" when a oracle report is run using run_report_object in the oracle form under oracle form developer 10g. Please advise any settings are required in order to run the report. Thank you very much.
    Best Regards
    Pinga

    The report server is running as the report can be run via URL in the brower. However, it prompts out the error when it is called by oracle form using the run_report_object.

Maybe you are looking for

  • Sale order with 2 diff pricing procedure

    Friends, Would you pleas clarify me, if we can create <b>single</b> Sale Order - having 2 line items, each item having 2 different pricing procedures? If its possible, pls send me the customised settings. Thanks, Pravin.

  • Dolby Home Theater v4

    http://support.lenovo.com/en_US/downloads/detail.page?DocID=DS029566 I ran across the above link in my "travels".   It is a Lenovo download link for  Dolby Home Theater v4 for Win. 7 x32 and x64 for ThinkPad S430 and Twist S230u. My question is can I

  • Flash Vars is not working when we accessing from other class files

    Hi all, I'm currently developing a flex application where i need to pass the data from the flash vars to the other class files instead of the main actionscript class file. Does any body know how i should go about doing that?? you can see this below c

  • Why does my iPod touch has, despite iOS 6, no panorama function in the camera?

    Why does my iPod touch has, despite iOS 6, no panorama function in the camera?

  • My iphone5 is not recognized in the itunes  store

    My iphone 5 is not recognized as a device on my computer.  I thought I needed to plug int in via the usb cord that came with the phone, open itunes and voila?  Not so, but I'm not savy enough technologically to figure out how to get it to work.  Also