4 Replies Latest reply: Jan 23, 2013 9:38 AM by ocp_2001 RSS

    Value at Address in Forms Procedure

    Shoaib
      Hi All,

      In my Oracle Forms ,I am writing one procedure....but stucked at one place..


      abc = 15;

      y = 'abc' ;

      I want to use y in such a way that it should give me output as 15.

      Please suggent any way to do this.


      Thanks
      Shoaib
        • 1. Re: Value at Address in Forms Procedure
          HamidHelal
          Shoaib wrote:
          Hi All,

          In my Oracle Forms ,I am writing one procedure....but stucked at one place..


          abc = 15;

          y = 'abc' ;
          Hi Shoaib,

          The information you provides is very less to give answer.
          What is your form version ?
          what is your code ?
          What problem your are faced ?
          what is the data type of abc and y

          I want to use y in such a way that it should give me output as 15.
          y='15';
          Only i said..
          <li>How to ask questions the smart way


          Hope this helps...
          • 2. Re: Value at Address in Forms Procedure
            Shoaib
            Forms Version :- 6i

            I am creating a procedure in oracle Forms, which will write to excel with some columns.

            Now I want the column generation to be Dynamic during runtime.So for that, I Get all the columns list from the loop and that column I will use as a Heading in Excel.

            For Dynamic Column Generation Following Code I have Written
            --------------------------------------------------------------------------------------------------------------------------------------------------------------------
            {
            Declare
            Cursor Temp is
            Select stk_1,stk_2,stk_3,stk_4 From ABC;

            Cursor Total_Columns Is
            Select Code from Stock_locations;

            var_text varchar2(100);
            var_count number := 0;
            var_final_text varchar2(2000);

            Begin
            For A in Temp Loop

            For B in Total_Columns Loop
            var_count := var_count + 1;
            var_text := 'A.'||'stk_'||var_count;
            var_final_text := var_final||';'||var_text;
            End Loop;
            TEXT_IO.PUT(INFILE,VAR_FINAL_TEXT);
            End Loop;
            End,

            }

            This "var_final_text" is placing

            " A.stk_1;A.stk_2;A.stk_3 "

            But I want the Value of Stk_1 , Stk_2 , Stk_3 instead of Columns Names of ABC Table.

            Thanks

            Shoaib
            • 3. Re: Value at Address in Forms Procedure
              HamidHelal
              Nice.. You problem is not related with this forum. Please post at PL/SQL

              Hope you will get quick response and solutions...


              Hamid
              • 4. Re: Value at Address in Forms Procedure
                ocp_2001
                Instead of

                var_text := 'A.'||'stk_'||var_count;

                can you not use (assuming you are only working with 4 columns)

                IF var_count=1 THEN
                var_text := A.STK_1;
                ELSIF var_count=2 THEN
                var_text := A.STK_2;
                ELSIF var_count=3 THEN
                var_text := A.STK_3;
                ELSIF var_count=4 THEN
                var_text := A.STK_4;
                END IF;

                Have you considered using dynamic sql (DBMS_SQL)?