3 Replies Latest reply: Jul 11, 2011 12:37 PM by jariola RSS

    Select list filter in a tabular form problem

    Gerard
      Hello everyone:

      I need to filter a list in a tabular form, depend on another column value in the same row of the Tabular Form

      Try using the syntax *#COLUMN#* in the query of select list but did not work.

      This is my query
      SELECT   nombre_respuesta, cod_respuesta
        FROM   enc_respuesta
       WHERE   cod_pregunta = #COD_PREGUNTA#
      There is another way I can refer to the value of a column in the same row?

      regards

      Gerard
        • 1. Re: Select list filter in a tabular form problem
          jariola
          Hi,

          You can not use column substitution string in LOV query.
          Use APEX_UTIL.SAVEKEY_VC2 in your form query and then APEX_UTIL.KEYVAL_VC2 in LOV query.

          Regards,
          Jari

          Edited by: jarola on Jul 11, 2011 10:03 AM

          I did not find site where is guide how use APEX_UTIL.KEYVAL_VC2
          But see this
          http://htmldb.oracle.com/pls/otn/f?p=18326:54:::::P54_ID:1282

          Instead creating that custom package, use APEX_UTIL.SAVEKEY_VC2 and APEX_UTIL.KEYVAL_VC2
          • 2. Re: Select list filter in a tabular form problem
            Gerard
            Thank you so much for the quick response saved my life!.

            For future reference let examples of the use of APEX_UTIL.SAVEKEY_VC2 and APEX_UTIL.KEYVAL_VC2


            This is the query of the Tabular Form
            SELECT   den.cod_encuesta,
                     den.cod_det_encuesta,
                     den.cod_pregunta,
                     pre.nombre_pregunta,
                     den.respuesta,
                     den.observaciones,
                     APEX_UTIL.SAVEKEY_VC2(den.cod_pregunta) codpreg
              FROM   enc_det_encuesta den, enc_pregunta pre
             WHERE   den.cod_pregunta = pre.cod_pregunta   
               AND   den.cod_encuesta = :P6_COD_ENCUESTA
            This is the query "Select list"
            SELECT   nombre_respuesta, cod_respuesta
              FROM   enc_respuesta
             WHERE   cod_pregunta =  APEX_UTIL.KEYVAL_VC2
            regards

            Gerard
            • 3. Re: Select list filter in a tabular form problem
              jariola
              Hi,

              Great, and thanks sharing code for reference.


              Regards,
              Jari