Use of Select stmts with Update stmts

Hi,
I want to execute the following update stmt...
UPDATE Test1_tab a
SET a.invpln_seq_no = (SELECT b.seq_no
FROM Test2_tab b
WHERE b.contract_id = a.contract_id
AND b.date_from = a.period_from_date)
WHERE a.invpln_seq_no != (SELECT b.seq_no
FROM Test2_tab b
WHERE b.contract_id = a.contract_id
AND b.date_from = a.period_from_date)
Here the problem is I have used 'SELECT b.seq_no FROM Test2_tab b WHERE b.contract_id = a.contract_id AND b.date_from = a.period_from_date' twice, one in the SET clause and the other one in WHERE clause...But it is the same SELECT stmt...So this same Select stmt runs twice when I run the whole update stmt I guess. Is there a way to do the above update, where it runs the SELECT stmt only once...
Any input is highly appreciated...
Thanks And Best Regards,
/Dinesh...

Then you can use Merge statement instead.
try this
merge into test1_tab t1
using
(SELECT a.rowid,b.seq_no SEQ_DEST
FROM test1_tab a,test2_tab b
WHERE b.contract_id = a.contract_id
AND  b.date_from = a.period_from_date
AND a.invpln_seq_no != b.seq_no) t2
ON (t1.rowid=t2.rowid)
WHEN MATCHED THEN
UPDATE SET t1.invpln_seq_no=t2.seq_destor if you are sure that sno is a unique key with out any duplicates and if you are going to perform one time manual update then you can use an undocumented hint /*+ bypass_ujvc */ to do this.
*DO NOT include this code if you are about to add it in a production procedure or a function
UPDATE /*+ bypass_ujvc */ (SELECT a.invpln_seq_no SEQ_SRC,b.seq_no SEQ_DEST FROM test1_tab a,test2_tab  b
WHERE b.contract_id = a.contract_id
AND  b.date_from = a.period_from_date
AND a.invpln_seq_no != b.seq_no)
SET SEQ_SRC = SEQ_DESTRegards,
Prazy

Similar Messages

  • Using a Select list with Submit

    I am trying to use the select list with Submit on my page.
    I have 3 select lists.
    On the first one,I am showing the list of all jacks.
    When the user selects a jack from the first list, I want to show all the jacks except the one which was selected.
    When the user selects a jack from the second list, I want to show all the jacks except the ones selected in the first list and the second list.
    I have created the select lists with submit and then I have put the query for getting the jacks. I created an unconditional branch. I am also passing the variables so that I can set the values of the items on submit.
    I also created a computation as mentioned in one of the OTN discussions, and have mentioned the value of second list to be calculated from the first and 3rd from first and second.
    But after clicking the first select list, I am losing all the existing values on the first page. I wonder what I am missing here. Can anyone hellp?
    Thanks,
    Gargi

    Gargi,
    In this case using 'select list with redirect' makes more sense rather than with SUBMIT. So change all the select lists to 'select list with redirect' (it redirects to same page inserting 'select list' value session state).
    Now for the 2nd select list query add a condition in where clause like
    WHERE sl_col != :P1_SL1And for the 3rd select list query add a condition in where clause like
    WHERE sl_col NOT IN (:P1_SL1, :P1_SL2)Hope it helps :-)
    Cheers,
    Hari

  • Want to use ldb selection screen with select queries

    I want to use ldb selection screen with select queries since ldb having performance issue .How can I use the fields of the dynamic selection of LDB in the select queries

    Hi,
    Check the code snippet below: Here 'XXXX' is the table for your select query.
      DATA L_DS_CLAUSES TYPE RSDS_WHERE.
      MOVE 'XXXX' TO L_DS_CLAUSES-TABLENAME.
      READ TABLE DYN_SEL-CLAUSES WITH KEY L_DS_CLAUSES-TABLENAME
                                 INTO L_DS_CLAUSES.
      SELECT * FROM XXXX
              WHERE field1 IN ...
               AND   field2 ....
               AND (L_DS_CLAUSES-WHERE_TAB).
          PUT XXXX.
      ENDSELECT.
    You can also try using the FM 'RS_REFRESH_FROM_DYNAMICAL_SEL' passing SY-CPROG in curr_report and 'M'  for mode to get the dynamic selection screen values.
    Regards,
    Munesh.

  • How to use a select statement with chinese characters?

    I am currently developing a java servlet<using tomcat 4.x> which allows me to use select statement to retrieve results from the Microsoft SQL Server 2000 database. I am using a simple form to get the parameter for querying. The main problem i'm facing is that there are chinese information in the SQL database, but i can't retrieve it through the sql statement with the chinese characters input<thru the form with the help of NJ STAR>in the WHERE condition. When i execute the statement, it returns me no results even though the rows are present in the database.
    Does anyone have the solution to using chinese words in the WHERE clause of the select statement to retrieve results with columns which contains chinese characters? Please help me. Thanks everyone. :)
    PS: when i cut and paste those characters in the sql database and paste onto java.. it is ??? in questionmarks.. but when i paste them into excel 2000.. its shown as chinese chars again..
    please heelppp~~

    Greetings,
    PS: when i cut and paste those characters in thesql
    database and paste onto java.. it is ??? in
    questionmarks.. but when i paste them into excelThis is why the SELECT is not returning any results.
    You need to set the character encoding set on your
    statement and parameters for the characters to be
    properly translated. Refer to the charsetName
    parameter in the String class constructor in your API
    docs and also to
    $JDK_DOCS/guide/intl/encoding.doc.html in your JDK
    documentation.
    2000.. its shown as chinese chars again..Because Office programs are performing the same kind
    of character translation with the appropriate MS APIs.
    please heelppp~~Regards,
    Tony "Vee Schade" Cookis it possible for you to show me some coding examples? i don't really understand what is to be done in order to set the char set and what does it really do.. tried reading up but still dun understand.. :(
    pardon my shallow knowledge of java..
    ok..
    The thing is when i used an insert statement with chinese characters of GBK format hardcoded into the java servlet and then i use the insert statement to insert the chars into the database, it cannot be seen as a chinese word when i off the NJStar. and then it can be searched out with my current form of servlet.. below is my coding of the servlet..
    note: i've set my html file to charset = GBK
    //prototype of Search engine...
    //workable for GBK input and output...
    import java.io.*;
    import java.io.OutputStream;
    import java.io.IOException;
    import javax.servlet.http.*;
    import javax.servlet.ServletException;
    import java.util.*;
    import java.sql.*;
    import java.nio.charset.Charset;
    public class SearchBeta extends HttpServlet {
         private Vector musicDetails = new Vector();
         private String query = "";
         public void service (HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException, UnsupportedEncodingException {
              query = req.getParameter ("T1");
              System.out.println("before:"+query);
              String type = req.getParameter ("D1");//type
              query = req.getParameter ("T1");
              //query = "������";
              System.out.println("after:"+query);
              getResults(type,query);
              System.out.println("locale = :"+req.getLocale());
              res.setContentType ("text/html;charset=GBK");
              PrintWriter out = res.getWriter();
              out.println("<html>");
              out.println("<head>");
              out.println("<body bgcolor = \"black\">");
              out.println("<font face = \"comic sans ms\" color=\"Cornsilk\">");
              if (query.length()==0)
                   out.println ("Please key in your search query.");
              else if (musicDetails.size()==0)
                   out.println ("Sorry, no results matching your search can be found.");
              else {
                   out.println("<center>");
                   out.println("<table cellspacing = \"50\">");
                   int i = 0;
                   //Display the details of the music
                   while (i<musicDetails.size()) {
                        Results details = (Results)musicDetails.get(i);
                        String dbArtist = "";
                        String dbAlbum = "";
                        String dbTitle = "";
                        String dbCompany = "";
                        dbAlbum = details.getAlbum();
                        dbTitle = details.getTitle();
                        dbCompany = details.getCompany();
                        dbArtist = details.getArtist();
                        try{
                             dbAlbum = new String(dbAlbum.getBytes("ISO-8859-1"),"GBK");
                             dbTitle = new String(dbTitle.getBytes("ISO-8859-1"),"GBK");
                             dbCompany = new String(dbCompany.getBytes("ISO-8859-1"),"GBK");
                             dbArtist = new String(dbArtist.getBytes("ISO-8859-1"),"GBK");//correct translation.
                        catch(UnsupportedEncodingException e){
                             System.out.print(e);
                             e.printStackTrace();
                        String dbImage_loc = details.getImage();
                        out.println("<tr>");
                             out.println("<td><table>");
                                  out.println("<img src=C:\\Program Files\\Apache Group\\Tomcat 4.1\\webapps\\examples\\ThumbNails\\"+dbImage_loc+">");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Artist: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbArtist+"</font></td>");
                             out.println("</tr>");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Title: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbTitle+"</font></td>");
                             out.println("</tr>");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Company: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbCompany+"</font></td>");
                             out.println("</tr>");
                             System.out.println("album: "+ dbAlbum);
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Album: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbAlbum+"</font></td>");
                             out.println("</tr>");
                             System.out.println("company: "+ dbCompany);
                             out.println("</table></td>");
                        out.println("</tr>");
                        i++;
                   out.println("</table>");
                   out.println("</center>");
              out.println("</font>");
              out.println("</body>");
              out.println("</head>");
              out.println("</html>");
              out.close();
              //to remove all the elements from the Vector
              musicDetails.removeAllElements();
         //get Searched Music Details and store in Results object which is stored in musicDetails vector
         public void getResults (String type, String searchQuery) {
              try {
                   Class.forName ("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                   Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=music","sa","kokkeng");
                   Statement stmt = con.createStatement();
                   String query = "SELECT * FROM MusicDetails WHERE "+type+" = '"+searchQuery+"'";
                   ResultSet rs = stmt.executeQuery(query);
                   while (rs.next()) {
                        String artist = rs.getString("Artist");
                        String title = rs.getString("Song");
                        String company = rs.getString("Company");
                        String album = rs.getString("Album");
                        String image_loc = rs.getString("Image");
                        Results details = new Results (artist,title,company,album,image_loc);
                        musicDetails.add(details);
                   stmt.close();
                   con.close();
              catch (Exception e) {
                   System.out.println(e.getMessage());
                   e.printStackTrace();
    with the above servlet i created, i can search out the data in the database which i've inserted through the insert statement. I still can't search for things i've keyed into the database directly using NJStar..
    thank you so much for helping.. really hope any one else who knows the answer to this will reply too... thank you all so much...
    -KK

  • Using correlated sub-query in update stmt

    Hi,
    I just need a help to fine tune this below query. The following query is throwng connection reset error.
    UPDATE ftmmgr.RECON_TEMP RT SET PRCS_STAT_F =
    (CASE WHEN (SELECT COUNT(1) as count FROM ftmmgr.INVC_ITEM ii WHERE ii.INVC_SEQ_I = RT.INVC_SEQ_I) =
    (SELECT COUNT(1) as count FROM ftmmgr.RECON_TEMP rtr WHERE rtr.INVC_SEQ_I = RT.INVC_SEQ_I AND
    UPPER(TRIM(SLF_RECON_F)) = 'N' AND UPPER(TRIM(SRC_SYS_C)) = 'FTM')
    THEN 'F' ELSE 'O' END)
    Thanks in advance

    vasanthskr wrote:
    Hi,
    I just need a help to fine tune this below query. The following query is throwng connection reset error.
    UPDATE ftmmgr.RECON_TEMP RT SET PRCS_STAT_F =
    (CASE WHEN (SELECT COUNT(1) as count FROM ftmmgr.INVC_ITEM ii WHERE ii.INVC_SEQ_I = RT.INVC_SEQ_I) =
    (SELECT COUNT(1) as count FROM ftmmgr.RECON_TEMP rtr WHERE rtr.INVC_SEQ_I = RT.INVC_SEQ_I AND
    UPPER(TRIM(SLF_RECON_F)) = 'N' AND UPPER(TRIM(SRC_SYS_C)) = 'FTM')
    THEN 'F' ELSE 'O' END)
    Thanks in advanceNo database version provided?
    No table structures povided?
    No example data provided?
    No explanation as to what you're trying to achieve?
    As for tuning....
    No explain plans provided?
    No trace provided?
    No details of indexes or statistics, cardinality, selectivity or skew of data provided?
    Read these threads:
    [How to post a SQL statement tuning request|http://forums.oracle.com/forums/thread.jspa?threadID=863295&tstart=0]
    [When your query takes too long...|http://forums.oracle.com/forums/thread.jspa?messageID=1812597#1812597]
    It's also a good idea to provide a nicely formatted version of your code so people can read it, using {noformat}{noformat} tags around it...UPDATE ftmmgr.RECON_TEMP RT
    SET PRCS_STAT_F =
    (CASE WHEN (SELECT COUNT(1) as count
    FROM ftmmgr.INVC_ITEM ii
    WHERE ii.INVC_SEQ_I = RT.INVC_SEQ_I)
    =
    (SELECT COUNT(1) as count
    FROM ftmmgr.RECON_TEMP rtr
    WHERE rtr.INVC_SEQ_I = RT.INVC_SEQ_I
    AND UPPER(TRIM(SLF_RECON_F)) = 'N'
    AND UPPER(TRIM(SRC_SYS_C)) = 'FTM')
    THEN 'F'
    ELSE 'O'
    END)

  • Use of SELECT SINGLE FOR UPDATE

    Hello,
    Am I missing something with FOR UPDATE addition in Open SQL? When I use it I can't get a lock to appear to SM12. For example, if I select a single record for update from table EKKO it's still possible to effect a normal MEPO update of the releavnt purchase order even before a COMMIT WORK command in my code.
    Any ideas?
    Thanks,
    Chris.

    Hello Chris
    FOR UPDATE command creates only a database lock,
    you can't see database locks in sm12.
    You should use related "lock object"  to lock entries in table EKKO with sm12
    For finding the lock object follow steps below :
    - Go to transaction se11
    - Write your table EKKO
    - Click button : Where Used List
    - Choose only "Lock object" in the next popup screen
    Every lock object has two function module ENQUEUE_<LOCK OBJ NAME> and DEQUEUE_<LOCK OBJ NAME>
    enqueue function creates lock in sm12 and dequeue deletes lock entry from sm12.
    And you can display parameters from se37 and use it.
    I hope it helps.

  • Use of selection table with 4 fields

    Hi everyone
    Can someone please explain to me what is the use of the seltab 4 fields, how they are used and provide an example, cos Im kinda struggling understanding them...
    Thanks in advance
    Adam

    Hi,
    Explicity there is a selection table for select-options that is seltab and it have sign, low, high, and option.
    Actually these values are also available in ranges.
    Just to explain you go through this info.
    What are the difference between SELECT-OPTIONS & RANGES?
    Here both SELECT-OPTIONS & RANGES works for the same purpose. They both are used for the range selection from selection screen. The main diff. between them is, while we use SELECT-OPTIONS system implicitly creates the select options internal table which contains the fields of SIGN,OPTION,LOW & HIGH. But in case of RANGES, this internal table should be defined explicitly.
    Eg. to SELECT-OPTIONS :
    REPORT YARSELECT.
    TABLES YTXLFA1.
    SELECT-OPTIONS : VENDOR FOR YTXLFA1-LIFNR.
    INITIALIZATION.
    VENDOR-LOW = 1000. " It specifies the range starting value.
    VENDOR-HIGH = 2000. " It specifies the range ending value.
    VENDOR-OPTION = 'BT'. " specifies ranges value is in between.
    VENDOR-SIGN = 'I'. "specifies both inclussive.
    APPEND VENDOR.
    SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB
    WHERE LIFNR IN VENDOR.
    Eg. to RANGES:
    REPORT YARRANGE.
    TABLES YTXLFA1.
    RANGES: VENDOR FOR YTXFLA1-LIFNR.
    SELECT LIFNR LAND1 NAME1 FROM LFA1 INTO TABLE ITAB
    WHERE LIFNR IN VENDOR.
    Here with RANGES user has to design an internal table with fields -
    SIGN,OPTION,LOW and HIGH EXPLICITLY.
    >
    Example:
    select-options: bukrs for zstock-bukrs.
    Should the user fill in 'ABFI' in BUKRS on the selection screen, BUKRS will look like this:
    IEQABFI
    This is because BUKRS is set as a table as follows:
    begin of bukrs occurs 0,
    SIGN(1) type c,
    OPTION(2) type c,
    LOW like bukrs,
    HIGH like bukrs,
    end of bukrs.
    Now, when you create the following range, it will have the exact same fields set inside its table:
    Ranges: bukrs for zstock-bukrs.
    The difference is, because ranges doesn't show on the selection screen, you will have to fill it yourself, meaning you will have to fill bukrs-sign, bukrs-option, bukrs-low & bukrs-high all manually.
    Some tips:
    Sign is always I (for Include) or E (for Exclude)
    Option can be a whole range, which includes:
    EQ (Equal)
    BT (Between))
    CP (Contain Pattern)
    So let's say you want to have the range check for all company codes not starting with AB, you will set your code as follow:
    ranges: bukrs for zstock-bukrs.
    bukrs-sign = 'E'. "Exclude
    bukrs-option = 'CP'. "Pattern
    bukrs-low = 'AB*'. "Low Value
    bukrs-high = ''. "High Value
    append bukrs.
    Always remember to APPEND your range when you fill it, as the WHERE clause checks against the lines of the range table, not against the header line.
    Hope this explains it well enough.
    >
    What does SIGN "I" & "E" mean?
    The "I" stands for Include, and the "E" for Exclude.
    The easiest way to learn how the range selections work is, create the following dummy program:
    report dummy.
    tables: mara.
    select-options: matnr for mara-matnr.
    start-of-selection.
    loop at matnr.
    write: / matnr-sign,
    matnr-option,
    matnr-low,
    matnr-high.
    endloop.
    Run this program, and fill in a lot of junk into MATNR. Fill in some includes, some excludes, some ranges, etc., and you will soon realise how the system builds ranges (select-options). Once you know that, you can fill your own ranges quickly and efficiently.
    Hope this info helps.
    Regards,
    Kumar.

  • Lost use of all extensions with update to 3.6.11 ... Add ons window is locked

    This morning, FF updated to 3.6.11. When I loaded FF no add ons were visible on the upper or lower tool bars. When I opened the Add Ons window, it locks up and will not allow me to access any options, disable, or uninstall. It also does not allow me to check for updates.

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).<br />
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]<br />
    <br />
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.<br />
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.<br />
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")<br />

  • PSCS6 no longer recognizes my CR2 files and will not open. Using Canon 5DMark III with updated Camera Raw . It has worked before but now won't open files from this camera.

    I have been able to open files from this camera before but still checked for latest Camera Raw download. Still won't open files from this camera. Opens files from my 60D just fine. I downloaded the latest and it has worked before. What the heck is going on?

    Glad to be of help. But I'm curious (not critical of what you are doing) to know why so many people like to use Nikon Transfer to transfer their files to the computer. It is still necessary to import them into Lightroom. And, from my perspective, it seems simpler and maybe even a little quicker to use the Lightroom import dialog. I have Nikon cameras, and have never even installed the Nikon Transfer utility. What is so unique about it?

  • Problem with Update Select in Stored procedure

    I am using Oracle 8. I'm writing a StoredProcedure and Oracle doesn't like the statement:
    update
    Leave_Coverages
    set
    Rate_Monthly = Rate_Monthly + (select Rate_Monthly from Leave_coverages where Leave_Coverage_ID = 10800)
    where
    Leave_Coverage_ID = 10799;
    When I run the above statement from the command line - I have no problem. This statement in the stored procedure works:
    update
    Leave_Coverages
    set
    Rate_Monthly = Rate_Monthly + 4
    where
    Leave_Coverage_ID = 10799;
    So essentially, I'm having trouble using a select in an update statement, but only in a Stored Procedure.

    Denis,
    This question was answered on this forum in the last week or so but I wasn't quickly able to locate this post.
    Basically Oracle prior to version 9 had an SQL parser and a separate PL/SQL parser. The PL/SQL parser had to be updated each time new features were added to the SQL parser; often it lagged behind so that there were things you could do in plain SQL but weren't supported when using the same SQL in a cursor or directly in PL/SQL (with an INTO clause or RETURNING ... INTO clause).
    From Oracle 9 these two parsers have been rolled into one so that new features introduced into SQL automatically also become available when used from PL/SQL.
    So the answer to your curiousity on whether it will work in 9 or 10 is: if it works in SQL it should work just fine from PL/SQL.
    Cheerio,
    Colin

  • Why set bosed mode cant be used with UPDATE or DELETE loading strategy

    Hi,
    Could u please tell me why i am not able to use SET BASED mode with UPDATE or DELETE loading strategy in OWB mappings.
    Appreciate your help.

    I came across this point while reading OWB documenation which i got from
    http://www.oracle.com/technology/documentation/index.html
    Here is the topic details:
    Staretegies for configuring PL/SQL mappings
    Set Based
    here is the exact statement from the document..
    Warehouse builder doesnt support UPDATE or DELETE loading in set set based mode.

  • How to access the value of fiedl ( select list with redirect )

    WE created one report and form. When i click in the edit button of the report
    for the specific record ; the system go automatically in the form
    and show me all the information. In my form ia have some fields ( select list with redirect ) in this way i store the key but i can see the description.
    I want to control the delete operation in checking the value of some field
    in my form. How can i do that. When i verfy the content with SESSION
    my variable are empty
    Thanks
    Marc Fortin

    Hello Larry,
    You can use a select list with submit and create a branch to the page you want to go to.
    Hope that helps.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • A Select statement with Appending table statement in it.

    Hi,
      How can I use a select statement with a <Appening table> statement in it.
    SELECT DISTINCT <field Name>
                    FROM <DB table name>
                    APPENDING TABLE <itab>
                    WHERE <fieldname> EQ <Itab1-fieldname>
                      AND <fieldname> EQ <itab2-fieldname>.
    Can I use the above select statement.If I'm using this...how this works?
    Regards
    Dharmaraju

    Hi, Dharma Raju Kondeti.
    I found this in the SAP online help, hope this can help you.
    Specifying Internal Tables
    When you read several lines of a database table, you can place them in an internal table. To do this, use the following in the INTO clause:
    SELECT ... INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE <itab>
                              [PACKAGE SIZE <n>] ...
    The same applies to the line type of <itab>, the way in which the data for a line of the database table are assigned to a table line, and the CORRESPONDING FIELDS addition as for flat work areas (see above).
    The internal table is filled with all of the lines of the selection. When you use INTO, all existing lines in the table are deleted. When you use APPENDING; the new lines are added to the existing internal table <itab>. With APPENDING, the system adds the lines to the internal table appropriately for the table type. Fields in the internal table not affected by the selection are filled with initial values.
    If you use the PACKAGE SIZE addition, the lines of the selection are not written into the internal table at once, but in packets. You can define packets of <n> lines that are written one after the other into the internal table. If you use INTO, each packet replaces the preceding one. If you use APPENDING, the packets are inserted one after the other. This is only possible in a loop that ends with ENDSELECT. Outside the SELECT loop, the contents of the internal table are undetermined. You must process the selected lines within the loop.
    Regards,
    feng.
    Edited by: feng zhang on Feb 21, 2008 10:20 AM

  • Dynamic select list with displaying a description

    Hi,
    I want to have a select List, my list refer to a lov, and the lov refer to a table contaning 2 columns : code and description,
    The list must display only the code, but I want having an item beside the list dispaling the description....
    I have used a select list with the query :
    select code d, code r from prog_theme order by 1 desc
    and Now : what is the way for displaying the description
    Thanks!!
    Lila

    Ok, here goes the top down approach...
    In the HTML header of my page, i have this reference to a js file containing the javascript - <script src="#WORKSPACE_IMAGES#108.js" type="text/javascript"></script>
    Then in an HTML Region I have the following code to create the divs that will be shown and hidden - <div id="divREGION" class="divs">Select region to get list of countries.</div>
    <div id="divCOUNTRY" class="divs">Select country to get list of cities.</div>
    <div id="divCITY" class="divs">Select city and then press "Get Employees". </div>
    Note that these divs contain static content. You may be able to create dynamic content for these divs by creating dynamic query regions and putting div tags around the region (i havent tried this, it may require template modification).
    The select boxes have this code in the "HTML form elements attributes" - onFocus="javascript:showHideDiv(this,true)" onBlur="javascript:showHideDiv(this,false)"
    This onFocus and onBlur call the showHideDiv() function, passing in the object reference of the select box and a true/false to show/hide the related div.
    The actual javascript function that is contained in the 108.js file is:
    function showHideDiv(objThis, inBool){
         var divid = "div" + objThis.id.substring(3);
         if (inBool) {
         ShowDiv(divid);
         else {
    HideDiv(divid);
    That function in turn calls either the ShowDiv() or HideDiv() functions, depending on the true or false, passing in the ID of the div to be changed...
    function ShowDiv(divid){
         eval('document.all'+ '["' + divid + '"]' + '.style' +'.display = "inline"');
    function HideDiv(divid){
         eval('document.all'+ '["' + divid + '"]' + '.style' +'.display = "none"');
    Hope this helps.

  • Javascript / Select List with Submit problems

    I have a page (page 3) where I can either edit or create a record. If I am editing a record, the data loads on page 3 via a PL/SQL block. On page 3, I have a textual item with Javascript linked to it which pops up a new window. In the Javascript, I am passing three values to the next page. Two of those values (P3_ITEM1, P3_ITEM2) are 'Select List with Submit'. If I am creating a new record from page 3, the Javascript works fine and the popup window comes up when I click on the textual item. However, if I am editing an existing record, I get an error when I click on my textual link. Looking at the address bar, it is not passing the value of P3_ITEM1 and P3_ITEM2 to the next page. It does, however, pass the value of P3_ITEM3 (not a 'Select List with Submit') to the next page. Again, the Javascript popup works fine if I use the 'Select List with Submit' fields to populate P3_ITEM1 and P3_ITEM2 (i.e. if I submit those fields) and it does not work if P3_ITEM1 and P3_ITEM2 are already populated when page 3 loads (i.e. if I do not submit those fields). Looking at the session variables, it appears as though P3_ITEM1 and P3_ITEM2 are set prior to clicking the link which initiates the Javascript. However, the URL in the popup window says the value of those fields is 'undefined'. Does anybody have any idea what I can do to make this work or why it is not working? Thanks.
    -Chris

    Hello Chris,
    It seems like you are having some problem with setting/reading session state, but it’s really hard to pin point the problem without seeing any code. Can you post your two pages on apex.oracle.com?
    Regards,
    Arie.

Maybe you are looking for