Values with the HTML not getting informed when using AJAX in the APEX

Hello

I use AJAX to fill some values in a tabular report.

I have a java script of this form (I took this example Denes http://apex.oracle.com/pls/otn/f?p=31517:241:1400877312570049) example

< script language = "JavaScript" type = "text/javascript" >

function f_set_multi_items_tabular (pValue, bow) {}
get var = new htmldb_Get (null, html_GetElement('pFlowId').value,
= Set_Multi_Items_Tabular', 0);
{if (pValue)}
Get.Add ('TEMPORARY_APPLICATION_ITEM', pValue)
Get.Add ('T_ROWNUM', Prow)
} else {}
Get.Add ('TEMPORARY_APPLICATION_ITEM', 'null')
}

gReturn = get.get ('XML');

{if (gReturn)}
var l_Count = gReturn.getElementsByTagName("item").length;
for (var i = 0; i < l_Count; i ++) {}
var l_Opt_Xml = gReturn.getElementsByTagName ("item");
var l_ID = l_Opt_Xml.getAttribute ('id');
var l_El = html_GetElement (l_ID);
{if (l_Opt_Xml.firstChild)}
var l_Value = l_Opt_Xml.firstChild.nodeValue;
} else {}
var l_Value = ";
}

{if (l_El)}
If (l_El.tagName == 'INPUT') {}
l_El.value = l_Value;
} Else if (l_El.tagName == 'SPAN' & & l_El.className == 'Raptor') {}
l_El.parentNode.innerHTML = l_Value;
l_El.parentNode.ID = l_ID;
} else {}
l_El.innerHTML = l_Value;
}
}
}
}
get = null;
}

< /script >


And I the process of application as follows
BEGIN
OWA_UTIL.mime_header ("text/xml", FALSE);
HTP.p ('Cache-Control: non-cache');
HTP.p ('Pragma: non-cache');
OWA_UTIL.http_header_close;
HTP.prn ("< body >");
HTP.prn ("< desc > This XML genericly defines several elements < / desc > '");
HTP.prn ("< item id =" f05_000 "|: T_ROWNUM |" "> ' |: TEMPORARY_APPLICATION_ITEM |") ("< / item > ');
HTP.prn ("< / body >");
END;
If I have: TEMPORARY_APPLICATION_ITEM as "Vikas" gets it displays correctly, but if I "& lt;" b & gt; Vikas & lt; b & gt;' it shows null. If she tags HTML function l_Opt_Xml.firstChild.nodeValue does not correctly work.
Please tell me what modiifcation can I use in the l_Opt_Xml.firstChild.nodeValue function to get values with HTML tags also to are displayed.

Thank you
Vikas

Vikas,

Try to escape special characters:

htf.escape_sc(:TEMPORARY_APPLICATION_ITEM)

Kind regards
Dan

Tags: Database

Similar Questions

  • How to connect windows media with internet player, to get information out of cd & dvd when I pull them out?

    Could not get information of cd or dvd media when I pull them out on windows media player

    Hello

    What operating system is installed on the computer?

    In many cases, the reader can download information from the media for you and add it to your files automatically. For example, when you rip a CD, the player can search an online database and download information from media on the tracks on the CD.

    The player can periodically analyze the contents of the Player library for items that are missing information on the media. First, it matches the items in your Player library to entries in the online database, and then it downloads the missing media information and adds it to the files in the Player library automatically.

    For more information, see the following article:

    Add or edit media information in Windows Media Player:

    http://Windows.Microsoft.com/en-us/Windows7/add-or-edit-media-information-in-Windows-Media-Player

  • You can directly download the CC applications and authenticate with my adobe cloud identification information without using the desktop application? whenever I have try with the desktop app it says impossible to arrive on the same adobe servers when I'm c

    Hello

    You can directly download the CC applications and authenticate with my adobe cloud identification information without using the desktop application? whenever I have try with the desktop app it says impossible to arrive on the same adobe servers when I'm connected to the Internet and I don't have any active anti-virus software?

    Thank you

    No application of cc, no clouds. It's the simple truth here. Programs cannot operate without him, since he controls the installation and licensing. the rest, we do not know, since you have not provided any useful technical information. Start by reading this (yet?):

    Solutions to connection errors, activation and connection with creative Cloud applications and Creative Suite

    What also good technical details are necessary.

    Mylenium

  • Do not get information on costs when using / * + RULE * / in Toad 9.5

    Hello

    All while optimizing a query when using / * + RULE * / in the query I get no info for the cost and cardinality.
    Can you tell me is the / * + RULE * / obsolete in oracle or what can be the reason.


    Help me..

    Thanks in advance.

    948707 wrote:
    Hello

    All while optimizing a query when using / * + RULE * / in the query I get no info for the cost and cardinality.
    Can you tell me is the / * + RULE * / obsolete in oracle or what can be the reason.

    Why do you use this suspicion?

    In addition to the fact that the basic optimization rule is obsolete, the optimizer can either make rule base optimization or cost optimization. Why wait get based cost information when using the basic optimization rule?

    Do not use these tips. Optimisation cost function is far superior to the basic rule.

  • Need to null values with the values of filling the date before weekend/holidays

    I have a table with a Date column, column Type and rate column.

    The problem is when the weekends and holidays, column Type and rate column are null.

    I need all null values with the values of Type and fill rate before that date is the weekend and public holidays.

    Example:

    I have:

    RATE OF TYPE DATE
    07/01/2010 4510 PM 3.71
    07/01/2010 CETE28 4.59
    07/01/2010 TIIE28 4.95
    07/02/2010 4510 PM 3.82
    07/02/2010 CETE28 4.63
    07/02/2010 TIIE28 5.11
    * NULL NULL 07/03/2010 *.
    * NULL NULL 07/04/2010 *.
    07/05/2010 4510 PM 3.91
    07/05/2010 CETE28 4.74
    07/05/2010 TIIE28 5.25

    Will be:

    RATE OF TYPE DATE
    07/01/2010 4510 PM 3.71
    07/01/2010 CETE28 4.59
    07/01/2010 TIIE28 4.95
    07/02/2010 4510 PM 3.82
    07/02/2010 CETE28 4.63
    07/02/2010 TIIE28 5.11
    * 07/03/2010 4510 PM 3.82*
    * 07/03/2010 CETE28 4.63*
    * 07/03/2010 TIIE28 5.11*
    * 07/04/2010 4510 PM 3.82*
    * 07/04/2010 CETE28 4.63*
    * 07/04/2010 TIIE28 5.11*
    07/05/2010 4510 PM 3.91
    07/05/2010 CETE28 4.74
    07/05/2010 TIIE28 5.25

    What could I do?

    Hello

    You can use the analytic LAST_VALUE function to get the last day of work before each date into your table. It will be the same as the current day for every day of work.
    Do it a self-join to combine each current line (c) with the last day of work (l):

    WITH     got_last_work_day     AS
    (
         SELECT     dt, type, rate
         ,     LAST_VALUE ( CASE
                        WHEN  type  IS NOT NULL
                        THEN  dt
                       END
                       IGNORE NULLS
                      ) OVER (ORDER BY dt)     AS last_work_day
         FROM     table_x
    )
    SELECT       c.dt, l.type, l.rate
    FROM       got_last_work_day     c
    JOIN       got_last_work_day     l  ON       (    c.dt          = l.dt
                             AND  c.type          = l.type
                             )
                           OR     (    c.last_work_day     = l.dt
                             AND  c.type          IS NULL
                             )
    ORDER BY  c.dt
    ,       l.type
    ;
    

    Among other things, I guess that the type is NULL if (and only if) the line represents a holiday or weekend, and that the combination (dt, type) is uniuqe.

  • How to compare the new values with the old values in triggers.

    Dear all,

    Please tell me how to compare the new values with the old values in triggers.

    Hi, the employee example is in the document. You'd better read yourself.

    CREATE OR REPLACE TRIGGER Print_salary_changes
      BEFORE DELETE OR INSERT OR UPDATE ON Emp_tab
      FOR EACH ROW
    WHEN (new.Empno > 0)
    DECLARE
        sal_diff number;
    BEGIN
        sal_diff  := :new.sal  - :old.sal;
        dbms_output.put('Old salary: ' || :old.sal);
        dbms_output.put('  New salary: ' || :new.sal);
        dbms_output.put_line('  Difference ' || sal_diff);
    END;
    /
    
  • Could not get credentials store using jps-config

    using jdev 11.1.1.3 and try to create the connection to my local AAU.

    Assistants of connection Jdev gives a popup window mentioned above error. and does not create a connection. settings of Conn I give are correct

    Could not get credentials store using jps-config


    What is the solution?

    THX

    I'm glad this solved...

    Please mark the thread as answered...

    Timo

  • ValueChangeListner do not get fired when I entered the same value after you remove the first.

    Hello world

    Can anyone help on this.

    JDeveloper version 11.1.1.7

    I use '< af:inputText >' with valueCaangeListner.

    Here as soon as I entered a value, valueChangeListener get fired...

    Problem:

    When I remove the and I entered the same gain value in the text entry box, ValueChangeListner do not get fired.

    When I came again, a value different valueChangelistner get me fired.

    Kind regards

    Malenfant.

    What you say is logic and sense, you enter 500 then delete 00 then add 00 in inputText perspective there is no change in place, therefore, the converter does not occur because there is no changes occur.

    To do something like that you can do a work around using javascript. You can follow these steps:

    1. Select af:inputText and bind it to the backbean

    
    

    2 - Add clientListener and serverListener inside inputText as:

    
        
        
        
    
    

    3 - Add handelEnterButton as javascript method:

    function handelEnterButton(event)
    {
      var code=event.getKeyCode();
      if (code==13)
      {
         var source = event.getSource();
         AdfCustomEvent.queue(source,"serverListenerOperations", {}, false);
      }
    }
    

    4. in the method of serverListener back bean refresh as inputText component:

      public void serverListener(ClientEvent clientEvent)
      {
        RequestContext.getCurrentInstance().addPartialTarget(getMyInputTextComponent());
      }
    

    5. now, try to change something in the inputText and then press enter

  • Header does not get changed when on the fly optione activated.

    I tired to change the header of the report using a reminder & it was working fine when I generate the report by keeping the option "on the fly report' disabled. When I try to execute the same sequence with "on the fly report option" on I do not see header information that I could see when "on the fly" option is disabled. I did find the cause and found the following link http://digital.ni.com/public.nsf/allkb/05F43468942BE32E86256D980074E200 but it did not work very well. I was not able to understand the reason of not revealing the header information when "on the fly" option is enabled.

    kpraveen,

    I looked at the files attached to this knowledge base and saw that they were modified versions of files delivered with TestStand 3.0.  Because we have made some changes to these files from this version, there is no guarantee that they will work with the latest version of TestStand.

    If you need this behavior in a newer version, you can change yourself the sequence reportgen_ files.  You will need create sequences modifyheader and modifyfooter in the sequence thost files, then call these the result of OTF process sequence sequences.  We are currently working on a set of more detailed guidelines, and I'll post here when they are available.

  • Data do not get stored when entered in the online form

    Hello

    When I enter data in a form online and save its does not get recorded and the data entered is lost. Please let me know if I missed any parameters.

    Thank you
    Sravan

    Good reading this post it connects to other posts on the same topic:- does not record data values

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • With the help of Photoshop CS6 on Yosemite with a Cintiqt and get crashes when I go to save. A way to solve this problem? Only the updates seem to come from CC and I am the last of people loading discs.

    Well, my last computer was destroyed when the son of a friend seeps water so I am rocking a brand new Macbook Pro. Unfortunately, this means that I have to use Yosemite. I am a cartoonist and I draw in Photoshop using a Cintiq. I indeed get bugs like not being able to use some keyboard shortcuts, or by using the zoom or the lasso. But the important thing is that Photoshop crashes when I go to save the work for the first time. No idea how to solve this problem?

    Install the MacOS 10.10.1 update to fix the crash bugs generalized in the open and save dialog boxes.

    And make sure you have the plugin WhiteWindowWorkaround installed in CS6 (no not necessary in 2014 CC) to work around some of the well-known MacOS issues.

  • I do not get audio when I the central channel in the mixer audio surround solo

    I tried and looking for days as to why I can't hear the sound when I put the audio puck into the central channel and turn the Center to 100% and it solo.  The same thing happens to the LS and RS when the washer is in L or R.  I have a Max of Mini Matrox as capture and output.  Volume indicators show sounds and I can double click on the channel and hear the sound with the mixer audio clip, but not with the audio mixer. I managed to create the Blu Rays using surcode and LS and RS out, but no center channel.

    It must be something simple but I can't find anything on it to help.  I have Adobe CC (2 weeks ago) on a clean machine with the latest Matrox drivers.

    The problem seems to be fixed.  I'm not positive as to why, but here's what I did.  I created a new project and quite well done what I did before (I think).  The only thing that I know that I have done differently, is that when you export audio with Surcode, I chose Bluray as the "target".  It offers 3 targets.  1 Dolby 2. Dolby 3. BluRay.  It is default to Dolby and their site does not (or not) have a view of the documentation updated or explaining what these objectives are or what they do.  Apparently, this option is brand new.  However, Surcode people contacted me after I did and insisted that the change of objectives would have no effect.  It works now and I stick to the workflow that worked.  I bought the Surcode Plug and it of real quick and looks very good.  Another 6 takes the file without the need for transcoding.

  • can not get sound when connected to the tv viahdmi

    I'm trying to find the audio and graphic drivers for my compaq 8510p.

    I tried all of the recommended things

    Hi nrob7208,

    Welcome to the Forums of HP Support!

    I understand that you do not get sound from your HP Compaq 8510p Notebook PC, and you want the graphics and audio drivers. He is a professional computer, and you will get the best results for your question, here, to the HP Enterprise Business Community.

    I hope this helps.

    Thank you and have a great day!

  • JAX - ws with sqlj deploy not, but ok when removed?

    I'm new to Jdeveloper (currently using 12.1.2.0.0) and I haven't used Java for some time. So I apologize if the question is stupid.


    Because I have problems with the current project, I decided to write a very simple java jax - ws service the use of sqlj and make sure that it would work. JAX - ws compiles without error. It is only when you use GUI JDeveloper to test the web service when I am presented with the problem.


    Please see ebelow the two very simple classes:


    =============================== WebService class =============================


    package sqlj.test3;
    
    
    import java.sql.SQLException;
    import javax.jws.WebMethod;
    import javax.jws.WebService;
    
    
    @WebService
    public class Test_Main {
        public Test_Main() {
            super();
        }
       
        @WebMethod(action = "incrementNumber")
        public int incrementNumber( int i ) throws SQLException { 
    
    
            FRE_Handler fre = null;
            int tmpReply = 0;
           
            try{
                fre = new FRE_Handler();
                tmpReply = fre.add1ToNumber( i );
            } catch (SQLException e )        {
                System.out.println( "Error code: " + e.getErrorCode() + " Error msg: " + e.getMessage() );
                String sqlState = e.getSQLState();
                System.out.println( "SQL state: " + sqlState );       
            } finally {
                try {
                    fre.getCtx().getConnection().close();
                }
                catch( SQLException e ) {
                    System.out.println( "Error code: " + e.getErrorCode() + " Error msg: " + e.getMessage() );
                    String sqlState = e.getSQLState();
                    System.out.println( "SQL state: " + sqlState );   
                }
            }
            return tmpReply;
        }
    }
    
    


    ======================================= sqlj class =========================

    package sqlj.test3;
    
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import sqlj.runtime.ref.DefaultContext;
    
    public class FRE_Handler {  
    
        private DefaultContext ctx;
    
        public FRE_Handler() throws SQLException {
            super();
        
            try{
                // Create the DB Connection
                java.sql.Connection conn = DriverManager.getConnection( "jdbc:oracle:thin:@ORACLE-DB:1521:orcl", "USER", "PASSWORD" );
                conn.setAutoCommit( true );
                DefaultContext.setDefaultContext( new DefaultContext( conn ) );
                ctx = DefaultContext.getDefaultContext();
            
            } catch( SQLException e ) {
                System.out.println( "Error code: " + e.getErrorCode() + " Error msg: " + e.getMessage() );
                String sqlState = e.getSQLState();
                System.out.println( "SQL state: " + sqlState );
            }
        }
    
        public int add1ToNumber( int i ) {
            return i + 1;
        }
    
        protected DefaultContext getCtx() {
            return ctx;
        }
    }
    
    
    

    as mentioned above, the source code compiles without error, but when I do use the JDeveloper feature 'test the Web Service', I get the following erros:

    =============================== error message ====================================

    [Running the application on IntegratedWebLogicServer SQLJ_TEST_3...]

    [16: 50:03] SQL_Test_3WebApp.war of Module Web recognized in the project SQL_Test_3.jpr

    [16: 50:03]-deployment began.  ----

    [16: 50:03] the target platform's (Weblogic 12.x).

    [16: 50:04] recovery of the existing application information

    [16: 50:04] analysis of the dependence running...

    [16: 50:04] deployment 2 profiles...

    [16: 50:04] wrote on the Web for C:\Users\Dev\AppData\Roaming\JDeveloper\system12.1.2.0.40.66.68\o.j2ee\drs\SQLJ_TEST_3\SQL_Test_3WebApp.war application Module

    [16: 50:04] wrote the Module Enterprise Application to C:\Users\Dev\AppData\Roaming\JDeveloper\system12.1.2.0.40.66.68\o.j2ee\drs\SQLJ_TEST_3

    [16: 50:04] Application deployment...

    < April 1, 2014 16:50:04 CEST > < WARNING > < Application customer > < BEA-2162200 > < no hand-class defined in the Java Module manifest file: empty.jar. This module will be treated as a utility JAR and subsequent initialization steps will be skipped. >

    < April 1, 2014 16:50:06 CEST > < error > < com.sun.xml.ws.server.http > < BEA-000000 > < WSSERVLET11: impossible to analyze the length descriptor: A WebService annotation is not present on the class: sqlj.test3.FRE_Handler

    com.sun.xml.ws.model.RuntimeModelerException: a WebService annotation is not present on the class: sqlj.test3.FRE_Handler

    at com.sun.xml.ws.model.RuntimeModeler.getServiceName(RuntimeModeler.java:1528)

    at com.sun.xml.ws.server.EndpointFactory.getDefaultServiceName(EndpointFactory.java:545)

    at com.sun.xml.ws.server.EndpointFactory.getDefaultServiceName(EndpointFactory.java:527)

    at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:272)

    at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:179)

    Truncated. check the log file full stacktrace

    >

    < April 1, 2014 16:50:06 CEST > < error > < hats > < BEA-149265 > < error has occurred in the execution of the request of deployment with the ID "1396363804511" for "10" task Error is: ' weblogic.application.ModuleException: weblogic.management.DeploymentException: com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: impossible to analyze the length descriptor: a WebService annotation is not present on the class: sqlj.test3.FRE_Handler.

    weblogic.application.ModuleException: weblogic.management.DeploymentException: com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: impossible to analyze the length descriptor: A WebService annotation is not present on the class: sqlj.test3.FRE_Handler

    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)

    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)

    to weblogic.application.internal.flow.ModuleStateDriver$ 3.next(ModuleStateDriver.java:213)

    to weblogic.application.internal.flow.ModuleStateDriver$ 3.next(ModuleStateDriver.java:208)

    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)

    Truncated. check the log file full stacktrace

    Caused by: weblogic.management.DeploymentException: com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: impossible to analyze the length descriptor: A WebService annotation is not present on the class: sqlj.test3.FRE_Handler

    at weblogic.servlet.internal.WebAppServletContext.initContainerInitializer(WebAppServletContext.java:1342)

    at weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1276)

    at weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1262)

    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1779)

    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2807)

    Truncated. check the log file full stacktrace

    >

    < April 1, 2014 16:50:06 CEST > < error > < hats > < BEA-149202 > < encountered an exception while trying to commit the 1 task for the application "SQLJ_TEST_3". >

    < April 1, 2014 16:50:06 CEST > < WARNING > < hats > < BEA-149004 > < failures have been detected all introducing deploy the task for the application "SQLJ_TEST_3" >.

    < April 1, 2014 16:50:06 CEST > < WARNING > < hats > < BEA-149078 > < message 149004 track battery

    weblogic.application.ModuleException: weblogic.management.DeploymentException: com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: impossible to analyze the length descriptor: A WebService annotation is not present on the class: sqlj.test3.FRE_Handler

    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)

    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)

    to weblogic.application.internal.flow.ModuleStateDriver$ 3.next(ModuleStateDriver.java:213)

    to weblogic.application.internal.flow.ModuleStateDriver$ 3.next(ModuleStateDriver.java:208)

    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)

    Truncated. check the log file full stacktrace

    Caused by: weblogic.management.DeploymentException: com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: impossible to analyze the length descriptor: A WebService annotation is not present on the class: sqlj.test3.FRE_Handler

    at weblogic.servlet.internal.WebAppServletContext.initContainerInitializer(WebAppServletContext.java:1342)

    at weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1276)

    at weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1262)

    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1779)

    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2807)

    Truncated. check the log file full stacktrace

    >

    [16: 50:06] undeployment.

    [16: 50:06] - incomplete deployment.

    [16: 50:06] remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)

    # Can't run application SQLJ_TEST_3 due to the deployment on IntegratedWebLogicServer error.

    [16: 50:06] requested cancellation

    [SQLJ_TEST_3 application stopped and cancelled IntegratedWebLogicServer]

    If help or pointers in the right direction would be he really likes.

    Thank you

    The WSDL generator does not find the file source of class FRE_Handler.java.

    Copy the class FRE_Handler.java of the C:\JDeveloper\mywork\Tutorials\webservice\Annotation\classes\annotation folder to the C:\JDeveloper\mywork\WebService\Annotation\src\annotation folder.

  • Matrix of distances: selection of values with the number of the column as a variable

    Hi all

    You wonder if SQL can do natively, let's go.

    I have a static table with the same amount of rows and columns, that changes forever; It represents the distances between locations (e.g. countries).
    It's basically a distance matrix (you can find a good example on Wikipedia ).

    My SQL statement must extract the distances of this matrix, based on the IDS of countries located in another table.
    Select a field is simple:

    SELECT * from cdistances where countryid =
    (select countryid from countries where upper (country) = upper (& getcountry));

    When I run the present, I get a line of all distances to all countries of the country I go when asked. But I would limit the outcome of a country of destination that I entered.

    Of course, a CASE statement would solve this nicely, but since we are talking more than 200 countries, which will become unmanageable.

    Another method that I approached is to use a variable as a column, as below:

    SELECT & getdestination of cdistances where countryid =
    (select countryid from countries where upper (country) = upper (& getcountry));

    It works well when I get directly the column identifier (manually from the keyboard) but I would like to automate even further.
    My names of columns in the matrix of distances are named as follows:
    countries1, countries2, countries3... country200 - where the number ID the real country, preceded by the constant string 'country '.
    So I tried to define a variable as a concat between 'country' and another variable:
    def getd2 = concat ("D2C", & testcountryid);
    Of course, it does not; the output of the script is:

    old: def getd2 = concat ('country', & testcountryid)
    New: def getd2 = concat ("country", 12)

    where I expected to be 'country12.

    I'm so little loss of thoughts. Maybe I'm pushing my train of thought in the wrong way, so I guess the general question would be: how to select a specific column of a table based on information outside the SQL statement dynamically?

    Hello

    I'm still confused.
    Is your table called chessking or testdistances, or you have 2 separate tables?

    I'm guessing that your single table is testdistances, and you want to pass a list of countryids, such as that of 3.1 to a query and get results as follows:

    `COUNTRYID  DISTANCE3  DISTANCE1
    ---------- ---------- ----------
             1         18         15
             3         13          1
    

    If so:

    DEFINE     country_list = "3,1"
    
    -- Preliminary Query, to set column_list
    COLUMN     column_list_col     NEW_VALUE column_list
    
    SELECT     'distance' || REPLACE ( '&country_list'
                               , ','
                         , ',distance'
                         )          AS column_list_col
    FROM    dual;
    
    -- Main Query
    SELECT     countryid
    ,     &column_list
    FROM     testdistances
    WHERE     countryid     IN (&country_list)
    ;
    

    Sorry, I'm out of time now. I'll explain more in a few hours.

Maybe you are looking for