title: Trying to use a column value to set other column in IG Oracle APEX
body: <p>I am developing an application using oracle apex 19.2 and I need to use the ID in one column of my Interactive grid as a variable in a query to set the value of another column in the same grid. So far I have done the following:</p>
  
  <p>-Creating the IG using a query as source (the DB is called with a DBLink):</p>
  
  <pre><code> select * from System.TV_CANALES@CGTVLINK where C_ID_DEMARCACION = :P3_C_ID_DEMARCACION and (T_CARACTER = 'Privado 1' OR T_CARACTER = 'Privado 2' OR T_CARACTER = 'Privado 3')
  </code></pre>
  
  <p>-The table fields are : C_ID_CANAL, T_CARACTER, C_ID_DEMARCACION</p>
  
  <p>-Create a new Column called Prestador Servicio Vigente, which must show the field T_RAZON_SOCIAL from another table, which is related to C_ID_PERSONA and C_ID_CANAL by means of the following query:</p>
  
  <pre><code>select T_RAZON_SOCIAL from System.TV_PERSONAS@CGTVLINK a
  join System.TV_EXPEDIENTES@CGTVLINK b on a.C_ID_PERSONA = b.C_ID_PERSONA
  where b.C_ID_CANAL IN (select C_ID_CANAL from System.TV_CANALES@CGTVLINK where C_ID_DEMARCACION = :P3_C_ID_DEMARCACION and (T_CARACTER = 'Privado 1' OR T_CARACTER = 'Privado 2' OR T_CARACTER = 'Privado 3') AND L_VIGENCIA_PRESTADOR = 1) 
  </code></pre>
  
  <p>The output of this query is the following:</p>
  
  <p><a href="https://i.stack.imgur.com/lScij.png" rel="nofollow noreferrer">https://i.stack.imgur.com/lScij.png</a></p>
  
  <p>Each of those results is related to a C_CANAL_ID in my IG</p>
  
  <p><a href="https://i.stack.imgur.com/mY0u3.png" rel="nofollow noreferrer">https://i.stack.imgur.com/mY0u3.png</a></p>
  
  <p>My problem is that I don't know how does APEX reference each row of my column in order to be able to set each of the values that my query returns in its corresponding row by using the variable C_ID_CANAL to relate it (I already tried using binding variables (:P3_C_ID_CANAL), but it returns an error as I am trying to set 3 values to a single row. I would appreciate in anyone could tell me which condition should I add to my query in order to obtain the desired value.</p>
  
  <p>Thanks in advance</p>