Write as asa one insert

Hi,
Need help to write a insert statement instead of insert and update same table.
1) this is my insert statement
INSERT INTO SS_ITEM_STAT_OPN(
        REP_ID, ITEM_ID, REPORT_COLUMN_DISPLAY, REPORT_COLUMN_SEQ_NO, BEGIN_VALUE, END_VALUE)
        SELECT
        LN_SEQ_REP_ID, ITEM_ID, REPORT_COLUMN_DISPLAY, REPORT_COLUMN_SEQ_NO, BEGIN_VALUE, END_VALUE
        FROM VW_SCALE_SCORE_CONFIG CROSS JOIN REP_ITEM_STAT_OPN
        WHERE REP_ID = LN_SEQ_REP_ID;
and  select few values from same table into pl/sql table  for where clause like below
SELECT ITEM_ID, BEGIN_VALUE, END_VALUE
        BULK     COLLECT INTO TV_SS_ITEM_STAT_OPN
        FROM     SS_ITEM_STAT_OPN
        WHERE     REP_ID=LN_SEQ_REP_ID
        ORDER BY REP_ID, ITEM_ID, REPORT_COLUMN_SEQ_NO;and updating using for loop like below
FOR LN_SSI_OPN IN NVL(TV_SS_ITEM_STAT_OPN.FIRST,1)..NVL(TV_SS_ITEM_STAT_OPN.LAST,0)
        LOOP
            UPDATE SS_ITEM_STAT_OPN SET
            TOT_STUD_ITEM_SS             =     NVL((SELECT COUNT(*)
                                            FROM PSYCHOMETRIC_ITEM_STAT_OPN A, VW_SCALE_SCORE_CONFIG B
                                            WHERE    SS_ITEM_STAT_OPN.ITEM_ID=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).ITEM_ID
                                            AND     (SS_ITEM_STAT_OPN.BEGIN_VALUE=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).BEGIN_VALUE
                                                    AND    SS_ITEM_STAT_OPN.END_VALUE=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).END_VALUE)
                                            AND     SS_ITEM_STAT_OPN.ITEM_ID = A.ITEM_ID
                                            AND SS_ITEM_STAT_OPN.END_VALUE = B.END_VALUE
                                            AND ROUND(A.SCALE_SCORE) > BEGIN_VALUE
                                            AND ROUND(A.SCALE_SCORE) <= END_VALUE
                                            AND CONDITION_COLUMN= 'SCALE_SCORE'
                                            GROUP BY ITEM_ID,END_VALUE),0),
            TOT_STUD_CORR_ANS_ITEM_SS     =     NVL((SELECT COUNT(*)
                                            FROM PSYCHOMETRIC_ITEM_STAT_OPN A, VW_SCALE_SCORE_CONFIG B
                                            WHERE SS_ITEM_STAT_OPN.ITEM_ID=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).ITEM_ID
                                            AND     (SS_ITEM_STAT_OPN.BEGIN_VALUE=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).BEGIN_VALUE
                                                    AND    SS_ITEM_STAT_OPN.END_VALUE=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).END_VALUE)
                                            AND  SS_ITEM_STAT_OPN.ITEM_ID = A.ITEM_ID
                                            AND SS_ITEM_STAT_OPN.END_VALUE = B.END_VALUE
                                            AND ROUND(A.SCALE_SCORE) > BEGIN_VALUE
                                            AND ROUND(A.SCALE_SCORE) <= END_VALUE
                                            AND CONDITION_COLUMN= 'SCALE_SCORE'
                                            AND RESPONSE_IS_CORRECT = 1
                                            GROUP BY ITEM_ID,END_VALUE),0),
            TOT_STUD_SS                 =  NVL((SELECT COUNT(*) FROM
                                            (SELECT A.TEST_SESSION_DETAIL_ID
                                            FROM PSYCHOMETRIC_ITEM_STAT_OPN A, VW_SCALE_SCORE_CONFIG B,SS_ITEM_STAT_OPN
                                            WHERE SS_ITEM_STAT_OPN.ITEM_ID=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).ITEM_ID
                                            AND     (SS_ITEM_STAT_OPN.BEGIN_VALUE=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).BEGIN_VALUE
                                            AND    SS_ITEM_STAT_OPN.END_VALUE=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).END_VALUE)
                                            AND SS_ITEM_STAT_OPN.END_VALUE = B.END_VALUE
                                            AND ROUND(A.SCALE_SCORE) >B.BEGIN_VALUE
                                            AND ROUND(A.SCALE_SCORE) <= B.END_VALUE
                                            AND CONDITION_COLUMN= 'SCALE_SCORE'
                                            GROUP BY A.TEST_SESSION_DETAIL_ID),VW_SCALE_SCORE_CONFIG
                                            WHERE END_VALUE=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).END_VALUE
                                            GROUP BY END_VALUE),0)
            WHERE    REP_ID = LN_SEQ_REP_ID
            AND     SS_ITEM_STAT_OPN.ITEM_ID=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).ITEM_ID
            AND     (SS_ITEM_STAT_OPN.BEGIN_VALUE=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).BEGIN_VALUE
                    AND    SS_ITEM_STAT_OPN.END_VALUE=TV_SS_ITEM_STAT_OPN(LN_SSI_OPN).END_VALUE);
            COMMIT;please help to write as a insert statement since this update taking more time.

Oh.. sorry,
version:10.1.0.2.0
DDL
TABLE SS_ITEM_STAT_OPN
Name                                      Null?    Type                       
REP_ID                                    NOT NULL NUMBER                     
ITEM_ID                                   NOT NULL NUMBER                     
REPORT_COLUMN_DISPLAY                     NOT NULL VARCHAR2(100)              
REPORT_COLUMN_SEQ_NO                               NUMBER                     
BEGIN_VALUE                                        NUMBER                     
END_VALUE                                          NUMBER                     
TOT_STUD_ITEM_SS                                   NUMBER                     
TOT_STUD_CORR_ANS_ITEM_SS                          NUMBER                     
TOT_STUD_SS                                        NUMBER                     
CONDN_IER                                          VARCHAR2(50)               
CONDN_ITEM_DIFF                                    VARCHAR2(50)Business rule:
First inserting below few columns using insert statement usingsub query of anther table .
REP_ID, ITEM_ID, REPORT_COLUMN_DISPLAY, REPORT_COLUMN_SEQ_NO, BEGIN_VALUE, END_VALUEand below columns updating based diff condition with sub queries(see the my 1st post) .
TOT_STUD_ITEM_SS,TOT_STUD_CORR_ANS_ITEM_SS,TOT_STUD_SSIndexes
only unique constraint since has pk constraint on 3 columnsconstarints
CONSTRAINT SS_ITEM_STAT_OPN_PK
PRIMARY KEY
(REP_ID, ITEM_ID, REPORT_COLUMN_DISPLAY)no triggers.
last question i'm not getting

Similar Messages

  • Need to change as one insert stmt

    Hi,
    I'm using below two insert statements in side the procedure.can i re write as a one insert.pls help
            INSERT INTO REP_ITEM_STAT_OPN (
            REP_ID, ITEM_ID, TOT_STUD_BY_ITEM, TOT_TIME_BY_ITEM, MIN_TIME_BY_ITEM,MAX_TIME_BY_ITEM)
            SELECT LN_SEQ_REP_ID, ITEM_ID, COUNT(1), SUM(RESPONSE_DURATION), TO_CHAR(MIN(RESPONSE_DURATION)),
            TO_CHAR(MAX(RESPONSE_DURATION))
            FROM PSYCHOMETRIC_ITEM_STAT_OPN
            WHERE TEST_SESSION_DATE IS NOT NULL
            GROUP BY ITEM_ID;
            INSERT INTO REP_ITEM_STAT_OPN (
            REP_ID, ITEM_ID, TOT_STUD_BY_ITEM, TOT_TIME_BY_ITEM, MIN_TIME_BY_ITEM,MAX_TIME_BY_ITEM)
            SELECT LN_SEQ_REP_ID, ITEM_ID, 0, 0, '.','.'
            FROM PSYCHOMETRIC_ITEM_STAT_OPN
            WHERE TEST_SESSION_DATE IS NULL
            GROUP BY ITEM_ID;
            COMMIT;

    Hi,
    Use CASE to map all non-NULL values of test_session_date to a single value (1 in the example below).
    Add this CASE expression to your GROUP BY clause, and use it in NVL2 (or CASE, if you prefer) expressions when the value to be INSERTed is different for the NULLs and the non-NULLs.
    For example
    INSERT INTO REP_ITEM_STAT_OPN (
            REP_ID, ITEM_ID, TOT_STUD_BY_ITEM, TOT_TIME_BY_ITEM, MIN_TIME_BY_ITEM,MAX_TIME_BY_ITEM)
            SELECT    LN_SEQ_REP_ID
         ,       ITEM_ID
         ,       NVL2 (tsd_flag, COUNT (*),              0)
         ,       NVL2 (tsd_flag, SUM (RESPONSE_DURATION), 0)
         ,       ...     -- other columns needed
            FROM       got_tsd_flag
         (       -- Begin sub-query to compute tsd
              SELECT  ln_seq_rep_id
              ,     item_id
              ,     ...      -- other columns needed
              ,     CASE
                        WHEN  test_session_date  IS NOT NULL
                        THEN  1
                   END     AS tsd_flag
              FROM     psychometric_item_stat_opn
         )       -- End sub-query to compute tsd
            GROUP BY  ITEM_ID
         ,       tsd_flag;Rather than repeat the same CASE expression over and over, the statement above uses a sub-query to compute it once.
    Edited by: Frank Kulash on Dec 14, 2009 7:12 AM
    This is essentially Centinul's solution, only Centinul forgot to change the GROUP BY clause.

  • Read from 2 tables, write only to one. Simple, but impossible??

    I've been messing about with various annotations for quite a while now, and I can't seem to figure out how to accomplish this seemingly simple task. I'm hoping somebody could explain to me the probably very obvious and simple mistake that I am making.
    I realize that question would otherwise point to problems in my database design and persistence strategy, but I can't seem to read from 2 tables, and write to only one. I have an entity bean that refers mainly to one table, but needs just one column of information from another table. It should not attempt to alter the secondary table, just join on it to get the one field it needs. So far, I've got the following:
    @Entity
    @Table(name = "ventureprofile")
    @SecondaryTable(name = "venture",
                    pkJoinColumns = @PrimaryKeyJoinColumn(name="ventureid"))
    @NamedQueries( {
            @NamedQuery(name = "Ventureprofile.findByVentureprofileid", query = "SELECT v FROM Ventureprofile v WHERE v.ventureprofileid = :ventureprofileid"),
            @NamedQuery(name = "Ventureprofile.findByVentureid", query = "SELECT v FROM Ventureprofile v WHERE v.ventureid = :ventureid"),
            @NamedQuery(name = "Ventureprofile.findByVenturesummary", query = "SELECT v FROM Ventureprofile v WHERE v.venturesummary = :venturesummary"),
            @NamedQuery(name = "Ventureprofile.findByLogoimagelocation", query = "SELECT v FROM Ventureprofile v WHERE v.logoimagelocation = :logoimagelocation"),
            @NamedQuery(name = "Ventureprofile.findByVisible", query = "SELECT v FROM Ventureprofile v WHERE v.visible = :visible ORDER BY v.venturename")
    public class Ventureprofile implements Serializable {
        @Id
        @GeneratedValue(strategy=GenerationType.AUTO, generator="Ventureprofile.ventureprofileid.seq")
        @SequenceGenerator(name="Ventureprofile.ventureprofileid.seq", sequenceName="ventureprofile_ventureprofileid_seq", allocationSize=1) 
        @Column(name = "ventureprofileid", nullable = false)
        private BigInteger ventureprofileid;      
        @Column(name = "ventureid", table="ventureprofile", nullable = false)
        private Long ventureid;
        @Column(name = "venturesummary")
        private String venturesummary;
        @Column(name = "logoimagelocation")
        private String logoimagelocation;
        @Column(name = "visible", nullable = false)
        private boolean visible;  
        @Column(table = "venture", name = "venturename", nullable=false, insertable=false, updatable=false)
        private String venturename;
    //... The extra column of data is "venturename", the tables are related by the column "ventureid". I contest, that since I have specified for read/write access no fields mapped to the 'venture' table (I specified with 'table=' any ambiguous columns), and described the table relationship via my @PrimaryKeyJoinColumn annotation, that toplink should not try to persist anything to the 'venture' table. However, I am getting the following exception:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: org.postgresql.util.PSQLException: ERROR: null value in column "venturename" violates not-null constraint
    Error Code: 0
    Call: INSERT INTO venture (ventureid) VALUES (?)
            bind => [220]
    Query: InsertObjectQuery(VCMarkWeb.db.entity.Ventureprofile[ventureprofileid=220])
            at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:311)
    ...It seems pretty clear that toplink is trying to insert an empty row into the secondary table, and barfing since it is inserting no values, including those constrained to be nonnull. Anyway...I hope it's clear what's going on here, and perhaps somebody knows the right way to do this. Thanks fot your help!

    Tom and Cornelius,
    Thank you both for your ideas. This what I think I will do:
    1) Drive up to OWC (fortunately they are only about 15 miles away from where I live) and get a bigger HD and some more RAM.
    2) Copy the OS9 applications on the existing HD to a thumb drive.
    3) Install the new hard drive and memory
    4) Install OSX TIger and 9.2.2
    5) Maybe do the 4.1.8 firmware update also, maybe.
    6) Look around for a Superdrive and if I can get one for a good price, I'll do it otherwise I'll just use USB thumb drives if I need to copy something off the PB.
    One thing that I was fighting with the other day was that when I had the yoyo power supply plugged in and attached when the PB was in the kitchen, the batteries would not charge although the yoyo was outputting +24 VDC.
    I move everything to the garage, where I originally fixed the yoyo power supply, plug it in out there and the batteries started charging!!! Scratching my head...then I check the voltage between the metal barrel (with the Vsensing resistor attached between the metal shell and the ground wire) of power supply plug and the +24 VDC wire and there is 22 to 23 VDC with the batteries being charged. In the kitchen when they were not being charged, it was about 1.0 VDC. So I rotate the plug a little bit and the batteries start charging. Rotate it more and the batteries don't charge. Something else to do when I have spare time.
    Anyway, thanks for the help and suggestions.
    John

  • I copied message to SMS field and sent. After that the message still exist all the time in the SMS field. When I open the application I must always first delete the "saved"  ones before I write the new one. What to do to finally/definitely delete the save

    I copied message to SMS field and sent. After that the message still exist all the time in the SMS field. When I open the application I must always first delete the “saved”  ones before I write the new one. What to do to finally/definitely delete the save message?

    sorry it's ios6

  • Can we write more than one routing rule in a RS?

    Can we write more than one routing rule in a RS?

    You can specify multiple routing rules for a single operation of a routing service. If no filter is applied, they are all executed. For routing rules with filters, only the target operations for which the filter condition holds are invoked. Priority is based on the order in which they appear in the routing rules window.
    Ronald

  • How does one insert symbols in Pages?

    how does one insert symbols into a Pages documeent?

    do you know about the press and hold trick on the standard keyboard? try to press and hold on the letter A and watch the menu that pops up, or try to hold the zero key to get degrees.

  • Can Pages write two numbers one over another, like atomic number and mass?

    Is it possible in Pages 08 to write two numbers right atop one another like you do for atomic number and mass number? One a bit under the line, one a little over the line, both at the same place (not one after the other)? I haven't found out how to to it.
    TIA

    Perl,
    I'm a little hesitant to post this because it's so clunky, but I don't know how desperate you are to include this notation in your work so I'll throw it out there.
    You may create a Text Box with one number over the other and insert it into your work, but it comes with a big warning. Here's an example:
    Note the following:
    o The Text Box is formatted as Floating and Object Causes Wrap is UnChecked. Warning: If you add or delete text ahead of the symbol, the registration will be lost, and if you reformat the document in any way, you may have to go looking for your symbol and move it back to where it belongs.
    o The Text in the Box is formatted as Centered
    o You will have to manually create space for the symbol in your text by using spaces, changes in line spacing or other techniques.
    This notation is pretty rare, since the Atomic Number is redundant with the Element Symbol.
    Regarding a math module, you can create an impressive variety of math notations with Grapher.app, located in your Applications > Utilities folder. When you Copy and Paste notations from Grapher, you'll have the same problems with registration, unfortunately.
    Regards,
    Jerry

  • Up a score of one insert swf in captivate

    I do not control many variables in captivate and wanted to know how to do the following scenario:
    I realize a quiz of 10 questions via captivate I want to know the score at the end.
    When the student answers correctly, before moving on to the other question it accesses a swf animation style is a penalty shootout game where he will be able scored 1 point if he succeeded. I will wish that this score is accumulated each time the learner brand appraisse the final result screen on a line other than the result of the quiz. For only the score against questions ascend to lms. What line of code do I insert in my swf file so that captivate retrieves the score via the swf animation?

    That means the file path or link to the original file has been broken.   Apply the two fixes below in order as needed: 
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Since only one option can be run at a time start with Option #3, followed by #4 and then #1 as needed.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments.  However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • Problems with JSF&Tiles (displaying twice one inserted page in tiles)

    I'm using Tiles framework withih Dynamic Web Project in Websphere (WSAD 5.1.1), the project is based on JSF.
    - included tiles.jar in WEB-INF/lib directory
    - in web.xml defined servlet action as: <servlet>
              <servlet-name>action</servlet-name>
              <display-name>TilesServlet</display-name>
              <servlet-class>org.apache.struts.tiles.TilesServlet</servlet-class>
              <init-param>
                   <param-name>definitions-parser-validate</param-name>
                   <param-value>false</param-value>
              </init-param>
              <load-on-startup>2</load-on-startup>
         </servlet> - also to Faces Servlet set value "load on startup" on 1
    - added struts-tiles.tld to WEB-INF folder
    - then I created index.jsp: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    <%@ page
    language="java"
    contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    %>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM WebSphere Studio">
    <META http-equiv="Content-Style-Type" content="text/css">
    <LINK href="theme/Master.css" rel="stylesheet"
         type="text/css">
    <TITLE>index.jsp</TITLE>
    <%-- jsf:codeBehind language="java" location="/JavaSource/codebehind/index.java" --%><%-- /jsf:codeBehind --%>
    </HEAD>
    <f:use_faces>
         <BODY>
         <TABLE border="1">
              <TBODY>
                   <TR>
                        <TD>
                             <tiles:insert page="/menu.jsp" flush="false"/>
                        </TD>
                        <TD>
                             <tiles:insert page="/content.jsp" flush="false"/>
                        </TD>
                   </TR>
              </TBODY>
         </TABLE>
         </BODY>
    </f:use_faces>
    </HTML> - menu.jsp and content.jsp inserted in index.jsp are not the same, and here is code for menu.jsp: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <HTML>
    <HEAD>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ page
    language="java"
    contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    %>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM WebSphere Studio">
    <META http-equiv="Content-Style-Type" content="text/css">
    <LINK href="theme/Master.css" rel="stylesheet"
         type="text/css">
    <TITLE>menu.jsp</TITLE>
    <SCRIPT type="text/JavaScript" language="JavaScript"
         src=".ibmjsfres/hxclient.js"></SCRIPT>
    <LINK rel="stylesheet" type="text/css"
         href=".ibmjsfres/css/stylesheet.css" title="Style">
    <%-- jsf:codeBehind language="java" location="/JavaSource/codebehind/menu.java" --%><%-- /jsf:codeBehind --%>
    </HEAD>
    <f:use_faces>
         <BODY><hx:script_collector>
         <h:form formName="form1" id="form1"><P><hx:panel_actionbar
                        id="actionbar1"><hx:panel_actionbar nestedTitleText="Sub-Panel Label" id="actionbar2"><hx:command_buttonex label="Command Label" id="button1" action="go_page01"></hx:command_buttonex><hx:command_buttonex label="Command Label" id="button2"></hx:command_buttonex></hx:panel_actionbar><hx:panel_actionbar nestedTitleText="Sub-Panel Label" id="actionbar3"><hx:command_buttonex label="Command Label" id="button3"></hx:command_buttonex><hx:command_buttonex label="Command Label" id="button4"></hx:command_buttonex></hx:panel_actionbar></hx:panel_actionbar></P></h:form>
         </hx:script_collector></BODY>
    </f:use_faces>
    </HTML>The problem is when I run application on server and go to index.jsp the resulting page is containing two times menu.jsp, instead once menu.jsp and once content.jsp.
    Also when you click on buttons in "second" menu.jsp it's like it was clicked on the "first and the original one". When you click navigation rules do apply.
    Can anyone help on this?
    Message was edited by:
    DeYo

    I haven't solved problem yet but so far I realised this:
    - the problem is that both menu.jsp and content.jsp have forms, with tags: <h:form formName="form1" id="form1">.
    I've tried renaming form and id, but it didn't worked, alo tried changing scope of managed beans for the two inserted jsp pages - still nothing.
    - also if the content.jsp is not containing form but other JSF components like Image or Hyperlink, that components are not being shown/rendered.

  • TS3276 Hi.  Just started using Mac Mail on a macbookpro v10.6.8.  I tried to send a message with two excel (for mac) files attached.  One attached as a file, one inserted all the text into the message body.  Help?

    Just started using my Mac Mail program instead of web mail.  When I went to attach two pdf files, one attached as a file, the other inserted all the text into the body of the email message.  How do I get it to attach both pdf's as files?

    I think you're confusing two different things. If you attached PDF files and one of them displayed the PDF icon in the message window, that means it was more than one page. If you saw what appeared to be the actual document for the other PDF file, that means it's only one page and it's normal for it to display that way.
    However, I seem to recall there may (or should) be a button at the bottom-right of the message window that allows you to display those files as icons, even if they're one page. If not, there's a third-party addition you can use to add that feature:
    http://lokiware.info/Attachment-Tamer

  • How to write the code to insert into attendance table

    Hi,
    I have a report
    class lov (through which all the classes will be selected).
    once any class seleted from the list it will display all the students in the class
    my query in the report was
    SELECT FIRST_NAME || ' ' || SURNAME "Pupil_Name",
    er.pupil_number,
    APEX_ITEM.CHECKBOX(1,er.pupil_number) "tickthebox"
    FROM PEAS_PUPIL pu, PEAS_ENROLMENT_REGISTER er
    WHERE pu.pupil_number = er.pupil_number
    AND er.class_id = :P53_CLASS
    pupil number column hidden becuase its a pk.
    as pupil_name and checkbox (called tickthebox)
    now I HAVE written on submit process to insert records into attendance table see below
    for i in 1..apex_application.g_f01.count loop --- check is the selector checbox, pupil_number is the hidden column with the table's PK
    INSERT INTO PEAS_ATTENDANCE (ATTENDANCE_ID,PUPIL_NUMBER) VALUES
    attendance_seq.NEXTVAL,
    APEX_APPLICATION.G_F01(i)
    end loop;
    but this is only inserting checked records ...not inserting unchecked records.
    is there anyway i can insert both checked and unchecked records into tABLE.
    THANKS
    PRASAD

    What I mean is that if you want to use checkbox item you must compare its value to current row ID.
    You have two items containing pupil_number:
    - APEX_ITEM.CHECKBOX(1,er.pupil_number)
    - APEX_ITEM.HIDDEN(2,er.pupil_number)
    When you call first one like "FOR i in 1 .. apex_application.g_f01.COUNT", you will get only pupil_numbers of checked checkboxes.
    When you call second one like "FOR i in 1 .. apex_application.g_f02.COUNT", you will get pupil_numbers of all rows.
    You get "no data error" because you reffer in your process to variable apex_application.g_f01(i) for row i, that is not checked.
    That's why you should check in your process if current row is checked every time when you want to reffer to this checkbox. You can do it using this code:
    FOR i in 1 .. apex_application.g_f02.COUNT
    LOOP
    FOR j in 1 .. apex_application.g_f01.COUNT
    LOOP
    IF apex_application.g_f01(j) = apex_application.g_f02(i) THEN
          /Your process for checked records/
    END IF;
    END LOOP;
          /Your process for unchecked records/
    END LOOP;And I think you should modify your report query for:
    SELECT FIRST_NAME || ' ' || SURNAME "Pupil_Name",
    APEX_ITEM.HIDDEN(2,er.pupil_number)||APEX_ITEM.CHECKBOX(1,er.pupil_number) "tickthebox"
    FROM PEAS_PUPIL pu, PEAS_ENROLMENT_REGISTER er
    WHERE pu.pupil_number = er.pupil_number
    AND er.class_id = :P55_CLASSYou can find some interesting information about using checkbox in APEX help.
    Regards,
    Przemek

  • Obiee 10g write back error while insertion

    Hi,
    Im getting an error while trying to write back a column to oracle database.
    Error details
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator.
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27024] The EXECUTE PHYSICAL statement must specify a physical SQL statement to execute. (HY000)
    SQL Issued: EXECUTE PHYSICAL CONNECTION POOL orcl
    Xml issued
    <?xml version="1.0" encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="WriteBack">
    <XML>
    <writeBack connectionPool="orcl">
    <insert> INSERT INTO writebackasim(name)values (@{c1}) </insert>
    <update> </update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Help me please...

    now it is updating the value...But still error message is coming
    and i have changed the code to insert..BUt now getting the error message and not inserting the value.. can you please debug this.
    ?xml version="1.0" encoding="utf-8"?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="WriteBack">
    <XML>
    <writeBack connectionPool="orcl">
    <insert>insert into writebackasim(id,name)values(@{c0},'@{c1}')</insert>
    <update>select null from dual</update>
    <postUpdate>COMMIT</postUpdate>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    error message
    An error occurred while writing to the server. Please check to make sure you have entered appropriate values. If the problem persists, contact your system administrator.
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27024] The EXECUTE PHYSICAL statement must specify a physical SQL statement to execute. (HY000)
    SQL Issued: EXECUTE PHYSICAL CONNECTION POOL orcl COMMIT
    -

  • [php+mysql] how to pass data from one insert form to another?

    Hi all,
    I have an insert form (in a mysql db) on the page. Is there a way to
    view the inserted data after inserting so stat the user can print it
    out?
    TIA
    tony

    >Hi Tony,
    >let´s assume the table´s Primary Key column is named "id" -- just add this value (available as "Dynamic Data") to the "Redirect after Insert" URL in the following way:
    >print.php?id={id}
    >...and on that page add a recordset which queries the table like that:
    >"SELECT * FROM tablename WHERE id" equals the URL parameter "id"
    >That should be all there is to do.
    >Cheers,
    >Günter Schenk
    >Adobe Community Expert, Dreamweaver
    Hi Günter,
    Thanks, it works.
    I added a bit of code to set a session variable using this Parameter
    URL, so that I can manage the record ID along the whole user session.
    So, I ask you a little question: when it is best to delete or destroy
    session variables? after displaying the inserted records or just befor
    inserting the first one?
    Here is my little test workflow:
    1- destroy variable sessions (I think I will unset session variables
    one by one instead, to eliminate the risk to delete other sesssion
    variable (UserID...)
    2- insert the first record (redirect to the next page using the record
    ID1)
    3- set a session variable (S1) using the ID1 coming from previous page
    ($_GET)
    4- insert the second record (redirect to the next page using the
    record ID2)
    5- set a session variable (S2) using the ID2 coming from previous
    page ($_GET)
    6- insert the third record (redirect to the next page using the
    record ID3)
    7- set a session variable (S3) using the ID3 coming from previous page
    ($_GET)
    8- create a recordsets to filter the db by S1, S2 and S3.
    9- display the report
    it seems to work.
    do you think there is something to refine?
    Thanks again for your kindness.
    tony

  • Two VMs and exclusive write access to one file

    How can one guarentee exclusive write access to a file when two vms want to write to it?
    I looked at
    http://developer.java.sun.com/developer/JDCTechTips/2003/tt0304.html#2
    However, I am not sure whether a race condition could happen or not.
    (I thinking like:
    if file is not writable, change to writeable,
    else if file is writable, wait for a while and check again.
    write what you want
    change file back to not writeable.
    Is there some OS level exclusive access thing we can take advantage of? The follow up question would be, what about system crashes?
    Thanks.

    The problem with what you describe is that two JVMs
    could discover the file is not writeable at the same
    time, and then change it to writeable. You need some
    sort of action which can only be successfully
    completed by one JVM. Here's an idea:
    Create a dummy file which represents a "lock" (only
    one JVM may hold the lock). When a JVM wants the
    lock, it attempts to delete the file. This can only
    succeed for one JVM. Once you have the lock, you do
    your business and then restore the file.http://java.sun.com/j2se/1.4/docs/api/java/io/File.html#delete()
    not bad. It's a false situation too.
    However, deadlock can happen if the other VM goes down while the lock is taken.

  • JUNIT: how to desgin this test so there would be one INSERT to db?

    Hi there,
    How should I design this test:
    I would like to upload a files system and do INSERT to the db. once I have the info in the db I would like to READ it and check against some other files.
    so I have something like this:
    doInsert();
    doRead();
    test1();
    test2();
    test3()...;problem that I have is the doInsert. this takes ~ 50 seconds and once it has been executed I wish to delete it ONLY in the last test.
    currently (and unfortunately) I have this:
    doInsert()
    read()
    doTest1();
    delete();
    doInsert()
    read()
    doTest3();
    delete();
    doInsert()
    read()
    doTest2();
    delete();can anyone advise how to do once time insert and one time delete?
    thank you

    3b,
    is there any way to make them symmetrical?
    How would I mirror one half without any external plugins?
    It is quite possible to create a symmetrical drawing live with the help of Illy, with her inbuilt tools, without any external plugins, if you just start in the right way. Obviously, it is much better to see the whole appearance while you create it.
    You may see the reflection live after each Anchor Point if you start out as follows (for Pen Tool with vertical reflection to the right, similar for other directions):
    1) Create the first two Anchor Points of your basic path;
    2) Effect>Distort&Transform>Transform>ReflectX with 1 copy and the middle right side Reference Point chosen;
    3) With the Pen Tool ClickDrag (or Click) anew from the second Anchor Point and go on;
    If you wish, you may:
    4) Object>Expand Appearance and Ctrl/Cmd+J to join the half paths.
    Ctrl/Cmd+Z Undo is your friend: you can just go back and redo while drawing the basic path.

Maybe you are looking for

  • Please fix player (as3 engine, at least in cs3)

    at least two things: 1. if you write something like beginfill(_color); draw some shape (...) endfill(); beginfill(_other_color); draw another shape endfill(); what you would expect, and what is supposed to happen according to specifications, i sthat

  • TS4272 erase free space stuck on creating temporary file

    I upgraded to 10.7.4 and followed instructions in http://support.apple.com/kb/TS4272 At step 9 Disk Utility is stuck on 'creating temporary file' for the last 24 hours. I have canceled and tried more than once.

  • Time Machine Folder Information

    Hi, I installed a Time Capsule (500GB) approx a month ago and backups have worked well and as planned, until now. The folder information within Time Machine displays 0 items under folder name "Desktop" (for all backups being taken) yet the backup dis

  • What are the advantages and disadvantages to cookies?

    Ok, so I am required to interview some expert for a Final in college. I choose to do my final on cookies throughout the different browsers. The downside is that it is nearly impossible to get a one-on-one interview from an expert in this field. This

  • 10.4.9 and fast user switching - my mouse disappears!

    Actually, the mouse doesn't disappear, but the cursor does. I am able to switch from my primary (administrator) account into a user account, and things run OK. When I log out of that account, though, the mouse cursor disappears. The mouse is still ac