convert multiple records of unique records...

can someone help pls to convert this two records into one record for each account?

Here is the table. For each account, there will be two records for two dates.
It is to say, opening date and closing with the opening and the closing balance.

I want to appear as a single record.

the opening balance will be the least date and next day will be the closing balance.

Note: If there is there is only one record for an account, then this would be considered
date of opening and the opening balance. date and closing balance sheet will be null.

Oracle 11g
CREATE TABLE TEST2
(
  RECORD_TYPE   VARCHAR2(5 BYTE),
  ACCOUNT_NO    VARCHAR2(12 BYTE),
  BALANCE_DATE  DATE,
  SD_BALANCE    NUMBER(18,4)
);
SET DEFINE OFF;
Insert into TEST2
   (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE)
 Values
   ('ABAL', '0105070411', TO_DATE('02/02/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), -6611663.15);
Insert into TEST2
   (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE)
 Values
   ('ABAL', '0105070411', TO_DATE('02/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), -6611663.15);
Insert into TEST2
   (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE)
 Values
   ('ABAL', '0105071013', TO_DATE('02/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), -1321170);
Insert into TEST2
   (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE)
 Values
   ('ABAL', '0105071013', TO_DATE('02/02/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), -1321170);
Insert into TEST2
   (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE)
 Values
   ('ABAL', '0106071012', TO_DATE('02/02/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1321170);
Insert into TEST2
   (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE)
 Values
   ('ABAL', '0106071012', TO_DATE('02/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1321170);
COMMIT;



I am looking for


record_type  account_no   opening_date  opening_balance  closing_date  closing_balance
ABAL         0105070411   20100201      -6611663.15      20100202      -6611663.15
ABAL         0105071013   20100201      -1421173         20100202      -1321170
ABAL         0106071012   20100201       1341170         20100202      1321170
select record_type,  account_no,   min(BALANCE_DATE) opening_date,  min(SD_BALANCE) opening_balance,  max(BALANCE_DATE) closing_date,  max(SD_BALANCE) closing_balance from test2 group by record_type, account_no;

Tags: Database

Similar Questions

  • Assign an ID to multiple records in bulk by using the checkboxes.

    I have a data block that contains the number of records. There is a check box against each file. and a button below the records.

    I want to assign an id to multiple records whose check box is selected.

    My requirement is when I click on the button under the block, then unique id must be assigned to all the records check box is selected.

    Maybe it is done by means of cursor or loops or both.

    Please, help me in coding of what trigger button.


    Thank you very much.

    Press and hold in the other block (control block) and when pressed to release button

    go_block('block_name');
    first_record;
    IF :check_box = 'Y' THEN--means checked
       :unique_id := 'value';
    END IF;
    if :system.last_record = 'TRUE' then
      eixt;
    else
     next_record;
    end if;
    first_record;
    

    But beware when the checkbox is disabled also.

    I want to update each record in the block but it is not working. below is my pl code behind button.
    

    If it is a block of the base table, you cannot update in the before update trigger?

    Published by: GD on September 9, 2011 23:25

  • Question to merge data from multiple records

    Hi all, could really use some help here, I tried to fix this for hours now:

    Make 3 different models for labels that I print on the basis of models of labels Avery for InDesign. When I come to my fusion of data on any of them, I select "Multiple records" in the title records per Document Page, but the preview and the actual creation just spits out a single unique label on each new page. For example, I use 2 x 4 "labels on 2 of them, so it should print 10 per page, but instead to put 10 unique labels on a page, it puts each new label on a new page. Therefore, instead of 100 pages for the 1 000 labels that I print, I find myself with 1,000 pages.

    I know a double check of size constraints on the text box and make sure it suits you when duplicated, and to my knowledge, who is seeking as it's nice. I'm also fairly certain that CSV files that I use are in the right format, too. I am quite stuck at this stage as to what I have to do to solve this problem, no guidance would be great. Here are the screenshots of what I'm looking, please let me know if there is anything else I can give you to help diagnose the problem.

    Screen Shot 2012-09-24 at 10.52.08 AM.png

    Screen Shot 2012-09-24 at 10.52.28 AM.png

    Screen Shot 2012-09-24 at 10.52.37 AM.png

    Screen Shot 2012-09-24 at 10.53.17 AM.png

    Screen Shot 2012-09-24 at 10.53.33 AM.png

    I thinnk the best way to deal with this would be to ensure that all the Avery template information on the master page. Let him be active while you do the layout in the upper left position on THE DOCUMENT PAGE, and then assign the master let anything showing that your placholders and art added none.

    Reassign the master model after the merger.

  • validation against multiple records (section multiple registration)

    How can I validate the records in a record Multiple point (3 files) against multiple records in a database? In other words, if they have previously registered (and is committed to the database) 'A', 'B' and 'C' and then try to enter "C", "D" and "E", a trigger failure will occur because 'C' is recognized as being already in the database. I'm already having control of duplicate records of subject "during a session" via the form, but does not prevent a user to re - enter and update a different record with the same value as one of the other documents submitted previously. Does make sense? I guess I could control it at the database level, making the the user_id AND primary keys of point value, but I want to control it until the user selects the button "Update".

    This should check the records that are unique to that user only. Does make sense?

    Mark,
    You have a post request (PQ) trigger adding or modifying data when a record is being questioned? The when-validate-Item trigger (WVI) will run only when the State of the item is NEW or CHANGED. When you fill out your form with EXECUTE_QUERY(), the ITEM_STATUS should be query.

    If you use a trigger of PQ, would be to reset the record and status of the article once you set your value in the trigger of PQ. For example:

       SET_ITEM_PROPERTY('MY_BLOCK.MY_ITEM', ITEM_IS_VALID, PROPERTY_TRUE);
    

    Another option would be to set the status of all return to the QUERY.

      SET_RECORD_PROPERTY(:SYSTEM.trigger_record, STATUS, QUERY_STATUS);
    

    I hope this helps.
    Craig...

  • Reading time to fetch multiple records vs. single record

    Hi all

    I have an application where I need to get several records, I use an SMU-5185, and basically, the problem is that it takes too long to retrieve multiple records, I did a test to measure the time it takes for the reading of the hole 32 MB of data and results.

    Parameters:

    Records to Fetch = 8192 (maximum 1 page = 4 KB, 8192 Records = 32 MB)

    Fetch time = 1100 ms

    Records to Fetch = 1

    Samples to Fetch = (2 ^ 25-1500) = 32MB

    Fetch time = 70 ms

    So, I want to know why it takes more time to get the multiplerecords if both are reading the same amount of data? Is there something I can do to decrease the recovery time?

    Thank you

    Hi Rodrigo,

    In fact, I think that the rate of release should be out of the equation, as in the while loop I wait until the end of the acquisition,

    You're absolutely right, I apologize for this oversight.

    I'm you test your code and see several times (about 930ms) Fetch when only pick a channel.  As soon as I specified two channels, the recovery time is an order of magnitude smaller (around 90ms).  Change the sampling frequency, fetch timeout and record length do not seem to affect this disparity in the order of magnitude.

    So to reiterate:

    In the case of single record , changing from one channel to both channels double recovery time.  It's what I expect.

    In the case of multi recording , changing from one channel to both channels decreases the time of recovery by an order of magnitude.  I don't think that.

    Furthermore, when I test in the example shipping niScope EX Acquisition configured standard I do not see this effect.

    (1) can you confirm that, in the case of multi account for your tests, you see that the recovery time reduced when you specify two channels instead of one?

    (2) can you confirm that you are not able to replicate that in the example Acquisition set up ?

    I have tabled a CAR 350194 to address this behavior more with R & D, but unfortunately I can't promise a timeline for the resolution.  I recommend at this stage unless you change Acquisition is configured when you set up your code instead of starting from scratch.  Support at home OR you can call at any time to check the condition of this CAR.

    To answer your question of why a use case takes more time than another, it will take more time to study according to the guidelines of this CAR.  We have already mentioned there is some overhead involved with multi-record fetch, but whether or not the time more or less long you see are good times is something that R & D will have to answer.

    Please let me know if you can confirm what I see by testing.

    -Andrew

  • 5152. multiple record acquisition forever

    Is it possible to do a multiple record acquisition on the 5152, which itself will be automatically retrigger forever?

    I have currently a multiple record acquisition implemented to acquire 256 records, but the external triggers (using the TRIG BNC of input) are so close together that the software cannot rearm the coverage in time for the next acquisition, and some triggers are missed.

    For example, we are capture 8000 samples to 2 MS/s, if every record is 4 ms in duration. The external trigger occurs at the beginning of all of the records, with a period of 4 ms, so I essentially continuous. Each 256 files (about once per second), the LabVIEW VI transfers data in memory, he wrote on the disk, it displays on the front panel, etc, then re - the scope for the next acquisition of weapons. It would be ideal that the scope can be configured for the immediate release of an another multiple record acquisition (preferably in hardware), so that it could acquire in parallel with LabVIEW treatment files and write data to the disk.

    Any thoughts on how I might accomplish this?

    Hi Schrockwell,

    There is no way to make a Multi-Multi Record Acquisition.

    What you want to do, the short answer is Yes - there is a way to introduce within the finished construction of the API OR-SCOPE, but you should make sure that

    1. you must enable more Records than available memory

    2. you must set the number of records in very huge.  Since this value is an Int32, theoretically, the more important you can set avalue of about 2.15 billion (2 ^ 31-1).   After that, you must stop and restart your acquisition.

    The total time that the acquisition will continue for is:

    = Total number of records [#] acquisition [s] Total time / Trigger rate [Hz]

    3. Finally, you should make sure that you can endure the flow in your PXI/PCI bus, and you have designed your code effectively to support this.

    Two important things I noticed is that you decide to display data on a chart, and you write on a disc.  View data in a graph will lead your program last much longer the complete loop iteration - instead, try rΘcupΦre without display data.  Secondly - if you write to a disc, you must use queuesto do.

    If you already do this, then the question of highest level, it's whether or not you are supplying data on your digitizer.  If so, you must work around this problem so that there is no backlog of data.  The extraction flow (data transferred in your program using the Fetch function) must be equal to your Flow of Acquisition:

    Acquisition flow [B/s]

    = Number of samples per registration type [Sa/REC/WAV] * rate [Hz] * resolution digitizer [bytes / his]

    (Since the 5152 is a 8-bit digitizer, the resolution of your digitizer is 1 b/sample).

    If you can compare your speed of recoveryand who then subtract the acquisition flowcalculation, then you should see a number (in B/s) which reflects the speed at which you are supplying data.  For an acquisition to keep forever, this number must be virtually zero.

    I hope this helps,

    -Andrew

  • convert xm recorded in wmp

    How can I change the format to convert the recorded XM Helix recorder media to Windows Media Player?

    Hi Pirate001,

    There is no tool in Windows to convert xm files in wmp format, but you can use your favorite search engine to download any third-party converter that will convert xm files in wmp format.

    Note: This response contains a reference to third party World Wide Web site. Microsoft provides this information as a convenience to you. Microsoft does not control these sites and no has not tested any software or information found on these sites; Therefore, Microsoft cannot make any approach to quality, security or the ability of a software or information that are there.

    Hope the helps of information. Please post back and we do know.

    Concerning
    Joel S
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Web service PLSQL returning multiple records

    Hello

    I am creating a web service using oracle 11 g, which should be able to return multiple records.

    Based on the code and the advice of the samples found on the internet, here is my code:

    CREATE OR REPLACE TYPE test_rec is OBJECT (
        s_nume_adre                    NUMBER ,
        c_eta_civi                     VARCHAR2(4 BYTE),
        l_nom1_comp                    VARCHAR2(40 BYTE),
        l_nom2_comp                    VARCHAR2(40 BYTE),
        l_nom3_comp                    VARCHAR2(40 BYTE),
        l_pren_comp                    VARCHAR2(30 BYTE),
        d_date_nais                    DATE);
    
    
    CREATE OR REPLACE TYPE test_array AS TABLE OF test_rec;
    */
    
    CREATE OR REPLACE PACKAGE test_pkg AS
      function get_rows(snume_adre in number) return test_array;
    END;
    /
    
    CREATE OR REPLACE PACKAGE BODY test_pkg AS
      function get_rows(snume_adre in number) return test_array is
        v_rtn   test_array := test_array(null);
        v_first boolean := true;
    
        cursor c_get_rows(snume_adre in number) is
          SELECT a.s_nume_adre,
                 nvl(a.c_eta_civi, '') c_eta_civi,
                 nvl(a.l_nom1_comp, '') l_nom1_comp,
                 nvl(a.l_nom2_comp, '') l_nom2_comp,
                 nvl(a.l_nom3_comp, '') l_nom3_comp,
                 nvl(a.l_pren_comp, '') l_pren_comp,
                 nvl(a.d_date_nais, to_date('01.01.1900', 'dd.mm.yyyy')) d_date_nais
        FROM bro.z45 a
      where a.s_nume_adre = snume_adre or snume_adre is null;
    
      begin
       
        for rec in c_get_rows(snume_adre) loop
          if v_first then
            v_first := false;
          else
            v_rtn.extend;
          end if;
       
        v_rtn(v_rtn.last) := test_rec(rec.s_nume_adre, rec.c_eta_civi, rec.l_nom1_comp, rec.l_nom2_comp,
                                    rec.l_nom3_comp, rec.l_pren_comp, rec.d_date_nais);
        end loop;   
    
        return v_rtn;
      end;
    END;
    /
    
    --select * from table (test_pkg.get_rows(null));
    
    
    

    I am able to retrieve data using select.

    However, when I try to access its wsdl I get an error:

    < envelope soap: >

    < soap: Body >

    < soap: Fault >

    Client: soap < faultcode > < / faultcode >

    entry processing < faultstring > error < / faultstring >

    < detail >

    < OracleErrors > < / OracleErrors >

    < / details >

    < / soap fault: >

    < / soap: Body >

    < / envelope soap: >

    -- -------------------------------------------------------------------------------------------------------------

    If I comment the function call in the package declaration I get a "correct": wsdl

    -- -------------------------------------------------------------------------------------------------------------

    " < name definitions = targetNamespace"GET_ROWS"=" http://xmlns.Oracle.com/orawsv/test/TEST_PKG/GET_ROWS "xmlns =" http://schemas.xmlsoap.org/wsdl/ "xmlns:tns =" http://xmlns.Oracle.com/orawsv/test/TEST_PKG/GET_ROWS "container =" http://www.w3.org/2001/XMLSchema "xmlns:soap =" http://schemas.xmlsoap.org/wsdl/SOAP/ "> " ""

    < types >

    " < xsd: Schema targetNamespace = ' http://xmlns.Oracle.com/orawsv/test/TEST_PKG/GET_ROWS "elementFormDefault ="qualified"> "

    < xsd: element name = "GET_ROWSInput" >

    < xsd: complexType >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: element name = "GET_ROWSOutput" >

    < xsd: complexType >

    < / xsd: complexType >

    < / xsd: element >

    < / xsd: Schema >

    < / types >

    < name of message = "GET_ROWSInputMessage" >

    < name of part = "parameters" element = "tns:GET_ROWSInput" / >

    < / message >

    < name of message = "GET_ROWSOutputMessage" >

    < name of part = "parameters" element = "tns:GET_ROWSOutput" / >

    < / message >

    < portType name = "GET_ROWSPortType" >

    < operation name = "GET_ROWS" >

    < input message = "tns:GET_ROWSInputMessage" / >

    < output message = "tns:GET_ROWSOutputMessage" / >

    < / operation >

    < / portType >

    < connection name = "GET_ROWSBinding" type = "tns:GET_ROWSPortType" >

    " < style: soap = transport = 'document' binding ' http://schemas.xmlsoap.org/SOAP/HTTP "/>

    < operation name = "GET_ROWS" >

    < soap: operation soapAction = "GET_ROWS" / >

    < input >

    < soap body parts: = 'settings' use = "literal" / >

    < / Entry >

    < output >

    < soap body parts: = 'settings' use = "literal" / >

    < / output >

    < / operation >

    < / binding >

    < service name = "GET_ROWSService" >

    < documentation > Oracle Web Service < / documentation >

    < name of port = "GET_ROWSPort" binding = "tns:GET_ROWSBinding" >

    " < soap: address location = ' http://server.domain.ch:8080 / orawsv/TEST/TEST_PKG/GET_ROWS "/>

    < / port >

    < / service >

    < / definitions >

    -- -------------------------------------------------------------------------------------------------------------

    Any suspicion that how create and access pl sql web service returning multiple lines?

    I use java not and do not have access to tools such as JDeveloper.

    Thank you!

    The real problem is that collection types are not supported for the return parameters.

    The solution is to wrap the collection into another object.

    Here is an example of work based on your settings:

    CREATE OR REPLACE TYPE test_rec is OBJECT (
      empno  number(4)
    , ename  varchar2(10)
    , hiredate date
    );
    /
    
    CREATE OR REPLACE TYPE test_array AS TABLE OF test_rec;
    /  
    
    CREATE OR REPLACE TYPE test_array_wrapper is OBJECT ( arr test_array );
    /
    
    CREATE OR REPLACE PACKAGE test_pkg AS
      function get_rows(p_deptno in number) return test_array_wrapper;
    END;
    /  
    
    CREATE OR REPLACE PACKAGE BODY test_pkg AS
      function get_rows(p_deptno in number) return test_array_wrapper is
        results  test_array;
      begin  
    
        select test_rec(empno, ename, hiredate)
        bulk collect into results
        from scott.emp
        where deptno = p_deptno;     
    
        return test_array_wrapper(results);
      end;
    END;
    /
    

    The wsdl is then generated correctly:

    SQL> select httpuritype('http://DEV:dev@localhost:8080/orawsv/DEV/TEST_PKG/GET_ROWS?wsdl').getxml() from dual;
    
    HTTPURITYPE('HTTP://DEV:DEV@LOCALHOST:8080/ORAWSV/DEV/TEST_PKG/GET_ROWS?WSDL').GETXML()
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
      
        
          
            
              
                
              
            
          
          
            
              
                
              
            
          
          
            
              
                
                  
                    
                      
                        
                          
                        
                      
                    
                  
                
              
            
          
          
            
              
              
                
                  
                    
                  
                
              
              
            
          
        
      
      
        
      
      
        
      
      
        
          
          
        
      
      
        
        
          
          
            
          
          
            
          
        
      
      
        Oracle Web Service
        
          
        
      
    
    
  • Add multiple records using the UTL file

    Hi, I have rarely treat PLSQL so any help would be greatly appreciated.

    I need to run a query that selects all instances where the status of a column table

    is equal to true and then write this to a file on the operating system. It is fine if there is only a single disc, but often, there will be multiple records.

    My script file UTL to process 1 plug is as below:


    DECLARE
    L_HANDLER UTL_FILE. TYPE_DE_FICHIER;
    vData VARCHAR2 (85);

    BEGIN


    SELECT THE STATE
    IN vDATA
    Of error_table;
    L_HANDLER: = UTL_FILE. FOPEN ('MYDIR', 'error.txt', 'W');
    UTL_FILE. PUTF (L_HANDLER, VDATA);
    UTL_FILE. FCLOSE (L_HANDLER);
    END;


    Thank you very much

    Adam

    Hi, Adam.

    One way is like this:

    DECLARE

    L_HANDLER UTL_FILE. TYPE_DE_FICHIER;

    BEGIN

    L_HANDLER: = UTL_FILE. FOPEN ("MYDIR", "error.txt', 'W');

    FOR (IN) r

    SELECT THE STATE

    Of error_table

    )

    LOOP

    UTL_FILE. PUTF (L_HANDLER, r.status);

    END LOOP;

    UTL_FILE. FCLOSE (L_HANDLER);

    END;

    There are more effective ways, but they are much more complicated.

  • Can I have multiple records of ra_interface_distributions_all against a ra_interface_lines_all record?

    Hello!

    Can I have multiple records of ra_interface_distributions_all against a ra_interface_lines_all record?

    Thank you.

    I was able to create multiple lines of distribution for a command line. Just ensure that the total amount or the total percentage of distribution lines is equal to the amount of the line or per cent = 100. You use either amount or percentage based on what is found on the source of the transaction-> account assignment of revenues.

  • Create multiple records to domain name full esxi

    When you configure vsphere, we configured esxi to have multiple mgmt vmkernel ports.  When configuring dns, are there problems with having multiple records a for that host name?

    example of dns configuration:

    ESXi-1 in a 10.1.1.1

    ESXi-1 in a 10.2.2.1

    Thank you

    Scott

    Yes we do .plz find command to add route to vmkernel port

    vicfg - route.pl - a 192.NNN.100.0 255.255.255.0 192.NNN.0.1

    Adds an entry to the road to 192.NNN.100.0 network through 192.NNN.0.1

    For more information Please reffer page 34 of vSphere command-line Interface

    Installation and reference Guide

    concerning

    Maniac

  • Insert multiple record Oracle forms 6i/9i / 10g

    Hello

    How can I insert multiple record using a tabular view as an oracle.

    what I use for loop?

    can someone help me? I have kindda stuck in this problem...


    Scenario:
    I have 5 display of last_name text_item and I put 4 names on it...

    If I use Insert, it only get the 4th name I drove...

    question:
    How can I put them all together?

    I build the block manually.

    Not a very good idea, I think, but if you really want to do it this way, you will need to loop through the records:

    first_record;
    <>
    loop
       insert into ....
       exit when :system.last_record = 'TRUE';
       next_record;
    end loop record_loop;
    
  • Insert multiple records in a database using the DB adapter and stored procedure

    Hi all

    I want to insert multiple records in a database using a stored procedure. I wanted to insert these records using a data adapter and data adapter must be called by a mediator.

    Can anyone suggest me some ideas if it's possible with capabtilities OOB in SOA suite or not?

    Thank you for your help in advance.

    Thank you
    Shiv

    The trick is in the stored procedure. You must use a data type that will handle multiple records I use varray. An example can be found in this post.

    Re: Mutiple calls to AppsAdapter (pl/sql) when the payload has multiple records

    When you read the procedure stored in the db adapter wizard looks and xsd / xml if you have maps accordingly.

    see you soon
    James

  • Update multiple records at once

    First, thank you very much the people who have helped me out several times now. I put things together and came across another issue of 'beauty' begin as follows. In the previous topics, I had a way to get to an array of automated classification based on the inputs of a fixtures table and some simple calculations. Now, which has been accomplished which resulted in me having to update all the teams by simply clicking a button.

    As you can see in the code below, using a table with every row a form, at the end of the line, there is a button called 'OK' I have to push to update the record according to. A repeat region for all teams in this query shows the ranking of 'new', but is not yet inserted in the League table. Is it possible to have this repeat region without having to push 18 or 20 times a button update? At the end of the table, one (1) button update all records? The primary key is composed like this ' 0000 - u00a "(4 numéros un tiret puis un «u» 1 ou 2 numéros et 1 ou 2 lettres à nouveau)."

    <?php require_once('Connections/connection.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }

    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }

    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "klassement")) {
      $updateSQL = sprintf("UPDATE klassement SET wedstrijden=%s, overwinning=%s, verlies=%s, gelijkspel=%s, goalsvoor=%s, goalstegen=%s, goalverschil=%s, punten=%s WHERE ploegid=%s",
                           GetSQLValueString($_POST['wedstrijden'], "int"),
                           GetSQLValueString($_POST['overwinning'], "int"),
                           GetSQLValueString($_POST['verlies'], "int"),
                           GetSQLValueString($_POST['gelijkspel'], "int"),
                           GetSQLValueString($_POST['goalsvoor'], "int"),
                           GetSQLValueString($_POST['goalstegen'], "int"),
                           GetSQLValueString($_POST['goalverschil'], "int"),
                           GetSQLValueString($_POST['punten'], "int"),
                           GetSQLValueString($_POST['ploegid'], "text"));

      mysql_select_db($database_koscw, $koscw);
      $Result1 = mysql_query($updateSQL, $koscw) or die(mysql_error());

      $updateGoTo = "klassement-ploegen.php?reeksid=" . $row_klassement['reeksid'] . "";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $updateGoTo));
    }

    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }

      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }

    $reeks_klassement = "-1";
    if (isset($_GET['reeksid'])) {
      $reeks_klassement = $_GET['reeksid'];
    }
    mysql_select_db($database_koscw, $koscw);
    $query_klassement = sprintf("select * from klassement where reeksid = %s order by status asc, punten desc, overwinning desc, goalverschil desc", GetSQLValueString($reeks_klassement, "text"));
    $klassement = mysql_query($query_klassement, $koscw) or die(mysql_error());
    $row_klassement = mysql_fetch_assoc($klassement);
    $totalRows_klassement = mysql_num_rows($klassement);

    $id_reeks = "-1";
    if (isset($_GET['reeksid'])) {
      $id_reeks = $_GET['reeksid'];
    }
    mysql_select_db($database_koscw, $koscw);
    $query_reeks = sprintf("select reeksnaam from reeksen where reeksid = %s", GetSQLValueString($id_reeks, "text"));
    $reeks = mysql_query($query_reeks, $koscw) or die(mysql_error());
    $row_reeks = mysql_fetch_assoc($reeks);
    $totalRows_reeks = mysql_num_rows($reeks);

    mysql_select_db($database_koscw, $koscw);
    $query_seizoen = "select * from seizoen";
    $seizoen = mysql_query($query_seizoen, $koscw) or die(mysql_error());
    $row_seizoen = mysql_fetch_assoc($seizoen);
    $totalRows_seizoen = mysql_num_rows($seizoen);

    $huidig=$row_seizoen['huidigseizoen'];
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" type="text/css" media="all" href="../_styles/koscw-admin.css" />
    <title>Klassement <?php echo $row_reeks['reeksnaam']; ?> | Beheerpaneel | 1349</title>
    </head>
    <body>
    <div id="container">
    <h1 class="overzichth1">Klassement <?php echo $row_reeks['reeksnaam']; ?></h1>
    <?php if ($totalRows_klassement > 0) { // Show if recordset not empty ?>
    <table cellpadding="5" cellspacing="0" border="0" id="klassement">
    <tr>
      <td class="klassementsmall bgccc bold"></td>
           <td class="klassementteam bgccc bold">Ploegnaam</td>
           <td class="klassementsmall bgccc bold">+</td>
           <td class="klassementsmall bgccc bold">-</td>
           <td class="klassementsmall bgccc bold">=</td>
          <td class="klassementsmall bgccc bold">#</td>
           <td class="klassementsmall bgccc bold"><img src="../_img/goalsmade.png" alt="Goals +" /></td>
           <td class="klassementsmall bgccc bold"><img src="../_img/goalsagainst.png" alt="Goals -" /></td>
           <td class="klassementsmall bgccc bold"><img src="../_img/goalsdifference.png" alt="Goals &asymp;" /></td>
           <td class="klassementsmall bgccc bold">PTN</td>
          <td class="klassementsmall bgccc"> </td>
    </tr>
    <?php
    $i=0;
    do {
    $i++;
    if($i % 2) { //this means if there is a remainder
         echo "<tr class=\"calendareven\">";
    } else { //if there isn't a remainder we will do the else
         echo "<tr class=\"calendarodd\">";
    }
    ?>
    <td>
    <?php
    $rank += 1;
    echo $rank;
    ?>      </td>
           <td class="klassementteam">
              <?php
            $thuisploeg=$row_klassement ['ploegid'];
              $sql_select_thuisploeg="select ploegnaam from ploegen where ploegid = ('$thuisploeg')";
              $resultset_thuisploeg=mysql_query($sql_select_thuisploeg);
              while ($data_thuisploeg=mysql_fetch_array($resultset_thuisploeg))
              {echo $data_thuisploeg['ploegnaam'] . " ";}?></td>
           <form action="<?php echo $editFormAction; ?>" method="POST" name="klassement">
          <input type="hidden" name="ploegid" value="<?php echo $row_klassement ['ploegid']; ?>" />
           <td>
          <?php
           $tw=$row_klassement['ploegid'];
           $sql_select_tw="SELECT COUNT( * ) AS twin FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$tw' AND thuisploeggoals > bezoekersgoals";
           $resultset_tw=mysql_query($sql_select_tw);
           $data_tw=mysql_fetch_array($resultset_tw);
           $data_tw['twin'];
          
           $uitwin=$row_klassement['ploegid'];
           $sql_select_uitwin="SELECT COUNT( * ) AS awin FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$uitwin' AND thuisploeggoals < bezoekersgoals";
           $resultset_uitwin=mysql_query($sql_select_uitwin);
           $data_uitwin=mysql_fetch_array($resultset_uitwin);
           $data_uitwin['awin'];
          
           $win=($data_tw['twin'])+($data_uitwin['awin']);
           ?>
          <input type="text" name="overwinning" value="<?php echo $win; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
          <?php
           $tv=$row_klassement['ploegid'];
           $sql_select_tv="SELECT COUNT( * ) AS tver FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$tv' AND thuisploeggoals < bezoekersgoals";
           $resultset_tv=mysql_query($sql_select_tv);
           $data_tv=mysql_fetch_array($resultset_tv);
           $data_tv['tver'];
          
           $uitverlies=$row_klassement['ploegid'];
           $sql_select_uitverlies="SELECT COUNT( * ) AS aver FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$uitverlies' AND thuisploeggoals > bezoekersgoals";
           $resultset_uitverlies=mysql_query($sql_select_uitverlies);
           $data_uitverlies=mysql_fetch_array($resultset_uitverlies);
           $data_uitverlies['aver'];
          
           $ver=($data_tv['tver'])+($data_uitverlies['aver']);
           ?>
          <input type="text" name="verlies" value="<?php echo $ver; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
          <?php
           $thuisdraw=$row_klassement['ploegid'];
           $sql_select_thuisdraw="SELECT COUNT( * ) AS tdraw FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$thuisdraw' AND thuisploeggoals = bezoekersgoals";
           $resultset_thuisdraw=mysql_query($sql_select_thuisdraw);
           $data_thuisdraw=mysql_fetch_array($resultset_thuisdraw);
           $data_thuisdraw['tdraw'];
          
           $awaydraw=$row_klassement['ploegid'];
           $sql_select_awaydraw="SELECT COUNT( * ) AS adraw FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$awaydraw' AND thuisploeggoals = bezoekersgoals";
           $resultset_awaydraw=mysql_query($sql_select_awaydraw);
           $data_awaydraw=mysql_fetch_array($resultset_awaydraw);
           $data_awaydraw['adraw'];
          
           $draw=($data_thuisdraw['tdraw'])+($data_awaydraw['adraw']);
           ?>
          <input type="text" name="gelijkspel" value="<?php echo $draw ?>" class="inputscore" readonly="readonly" />
          </td>
          <td>
          <?php $wedstrijden=$win+$ver+$draw; ?>
          <input type="text" name="wedstrijden" value="<?php echo $wedstrijden; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
           <?php
          $tgv=$row_klassement ['ploegid'];
           $sql_select_tgv="SELECT SUM( thuisploeggoals ) AS tgv1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$tgv'";
           $resultset_tgv=mysql_query($sql_select_tgv);
           $data_tgv=mysql_fetch_array($resultset_tgv);
           $data_tgv['tgv1'];

          $ugv=$row_klassement ['ploegid'];
           $sql_select_ugv="SELECT SUM( bezoekersgoals ) AS ugv1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$ugv'";
           $resultset_ugv=mysql_query($sql_select_ugv);
           $data_ugv=mysql_fetch_array($resultset_ugv);
           $data_ugv['ugv1'];

           $gv=($data_tgv['tgv1'])+($data_ugv['ugv1']);
           ?>
          <input type="text" name="goalsvoor" value="<?php echo $gv; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
           <?php
          $tgt=$row_klassement ['ploegid'];
           $sql_select_tgt="SELECT SUM( thuisploeggoals ) AS tgt1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND bezoekersid = '$tgv'";
           $resultset_tgt=mysql_query($sql_select_tgt);
           $data_tgt=mysql_fetch_array($resultset_tgt);
           $data_tgt['tgt1'];

          $ugt=$row_klassement ['ploegid'];
           $sql_select_ugt="SELECT SUM( bezoekersgoals ) AS ugt1 FROM kalender WHERE seizoen = '$huidig' AND speeldag !=0 AND thuisploegid = '$ugv'";
           $resultset_ugt=mysql_query($sql_select_ugt);
           $data_ugt=mysql_fetch_array($resultset_ugt);
           $data_ugt['ugt1'];

           $gt=($data_tgt['tgt1'])+($data_ugt['ugt1']);
           ?>     
          <input type="text" name="goalstegen" value="<?php echo $gt; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
           <?php $goals=$gv-$gt; ?>
          <input type="text" name="goalverschil" value="<?php echo $goals; ?>" class="inputscore" readonly="readonly" />
          </td>
           <td>
           <?php $punten=($win*3)+($draw*1); ?>
          <input type="text" name="punten" value="<?php echo $punten; ?>" class="inputscore" readonly="readonly" />
          </td>
          <td>
          <input type="submit" value="OK" />
          </td>
          <input type="hidden" name="MM_update" value="klassement" />
           </form>
      </tr>
      <?php } while ($row_klassement = mysql_fetch_assoc($klassement)); ?>
    </table>
    <?php } // Show if recordset not empty ?>

    </div>
    </body>
    </html>
    <?php
    mysql_free_result($klassement);

    mysql_free_result($reeks);

    mysql_free_result($seizoen);
    ?>

    Each record is separated, as well as a record can be updated at once, unless you want that all records have the same value.

    To update multiple records in a single operation, you must send the form tabular data. You do this by adding an empty pair of brackets at the end of the name attribute of each entry on the form like this:

     
    

    This translates by $_POST ['ploegid'] which contains a table of all IDS: $_POST ['ploegid'] [0], $_POST ['ploegid'] [1], $_POST ['ploegid'] [2] and so on. All the attributes of the repeat region name need to have added hooks. The following hidden field should be outside of the repeat region and may not have the brackets:

    
    

    You can then use a loop for updating the values like this:

    for ($j = 0, $len = count($_POST['ploegid']); $j < $len; $j++) {  $updateSQL = sprintf("UPDATE klassement SET wedstrijden=%s, overwinning=%s,   verlies=%s, gelijkspel=%s, goalsvoor=%s, goalstegen=%s, goalverschil=%s,   punten=%s WHERE ploegid=%s",                       GetSQLValueString($_POST['wedstrijden'][$j], "int"),                       GetSQLValueString($_POST['overwinning'][$j], "int"),                       GetSQLValueString($_POST['verlies'][$j], "int"),                       GetSQLValueString($_POST['gelijkspel'][$j], "int"),                       GetSQLValueString($_POST['goalsvoor'][$j], "int"),                       GetSQLValueString($_POST['goalstegen'][$j], "int"),                       GetSQLValueString($_POST['goalverschil'][$j], "int"),                       GetSQLValueString($_POST['punten'][$j], "int"),                       GetSQLValueString($_POST['ploegid'][$j], "text"));
    
      mysql_select_db($database_koscw, $koscw);  $Result1 = mysql_query($updateSQL, $koscw) or die(mysql_error());}
    
  • Data merge multiple records do not work

    Hi all

    When you try to merge multiple records, the result is the same if I selected just a recording.

    Here's the situation:

    Source file:

    • Excel file with several records, saved as a csv and txt

    The target file:

    • InDesign CS4 file with a single page.
    • framework of a text on the page,
    • a table with the header line and a line of body
    • every cell of body line contains a data field

    I went through all the necessary steps:

    • Choose the data source file (tried with csv and txt, the results are the same) and insert the fields in the table
    • chose "All records" to merge
    • to merge records: selected multiple records

    After choosing "Preview", I see only one record per page, and the new pages are created automatically for EACH record! This is not what I want.

    What I want is for as many records if poster in the table as possible and then to InDesign to create additional if necessary pages.

    What I am doing wrong, or isn't it possible?

    Thank you for all your comments!

    Several records, ID to duplicate everything on the page, so unless there is enough space for all of this, you will get several records.

    Think of it as a frame around all your items, group, then using the step and repeat, except merge data won't allow any element to extend beyond the edge of the drawing page.

Maybe you are looking for