4 Replies Latest reply on Aug 13, 2018 11:20 AM by Alibune

    ORA-06502 when page submits

    Alibune

      Hello everyone!

       

      I'm having some trouble with my dynamic action, i have a dynamic action that fires when a popup LOV changes and it sets the value of an item with this code:

       

      DECLARE
      
       v_docs varchar(100);
      
       BEGIN
      
      
       SELECT LISTAGG (strDescricao, ', ') WITHIN GROUP (order by strDescricao) INTO v_docs 
              FROM AssuntoTipoDocumento ATD INNER JOIN TipoDocumento TP ON TP.ID =  ATD.fkeTipoDocumento
              WHERE fkeAssunto = :P100100_ASSUNTO AND blnObrigatorio = 1;
              
              RETURN v_docs;
              
              END;
      

       

      it works fine on first run, but when i submit the page it shows me this error:

       

      when i disable the DA i don't get any errors, can anybody help me please?

        • 1. Re: ORA-06502 when page submits
          Franck N

          Hi,

          you have a Data Type conversion Issue here.

          if i am right? :

          fkeAssunto is of type number
          

           

           

          you just have to adjust your code as bellow:

           

          DECLARE  
            
           v_docs varchar(100);  
            
           BEGIN  
            
            
           SELECT LISTAGG (strDescricao, ', ') WITHIN GROUP (order by strDescricao) INTO v_docs   
                  FROM AssuntoTipoDocumento ATD INNER JOIN TipoDocumento TP ON TP.ID =  ATD.fkeTipoDocumento  
                  WHERE fkeAssunto = TO_NUMBER(:P100100_ASSUNTO) AND blnObrigatorio = 1;  
                    
                  RETURN v_docs;  
                    
                  END;  
          
          

          regards,

          Franck

          1 person found this helpful
          • 2. Re: ORA-06502 when page submits
            Pavel_p

            Hi,

            there is a very little chance that anybody could help. We don't know your data model, data in tables...you haven't even specified which item is being set by the DA, so we know absolutely nothing about your environment and the cause of the problem, except of what is obvious from the error message (which is quite self-explanatory, I would say).

            Please, run the page in debug mode and share the entire debug trace in text form (not as an image).

            Thank you,

            Pavel

            1 person found this helpful
            • 3. Re: ORA-06502 when page submits
              Scott Wesley

              A value_error exception after listagg-ing some data into a variable that's 100 bytes long?

               

              If you might aggregate over 33 rows of data, you're going to get that error.

               

              edit - that's with only 1 character per row. I'd say ~10 rows would get you into trouble.

              1 person found this helpful
              • 4. Re: ORA-06502 when page submits
                Alibune

                Hello everyone!

                 

                thanks for advice, but i changed the way i was doing to one easier