Parsing XML and get the required data only using PLSQL

Hi friends,

I have a XML data

< MAJOR_LINE >

< LINEID > 143424538 < / LINEID >

nom_element < ITEMNAME > = < / ITEMNAME >

< > 78245 ITEMPATH < / ITEMPATH >

< QUANTITY > 10 < / QUANTITY >

< MINORLINE >

< LINEID > 143424799 < / LINEID >

TCC_ITEM_NAME < ITEMNAME > < / ITEMNAME >

< > 78245 ITEMPATH < / ITEMPATH >

< QUANTITY > 10 < / QUANTITY >

< MINORLINE LINEID = "123456_line_id" xmlns = "xxyyzz" >

< message > < / message >

< status > < / status >

< covered_Product_line_id > '123_coveredProductLineID '.

< / covered_Product_line_id >

< itemName > < / itemName >

< quantity > < / quantity >

"< service lineId ="456_service_line_id">."

"< covered_Product_line_id >"123_coveredProductLineID"

< / covered_Product_line_id >

< productAttributes / >

< itemType > < / itemType >

< itemPath > < / itemPath >

< coveredProducts childProductLineId = "" / > "

< / coveredProducts >

< parentCoverage / >

< / service >

< / MINORLINE >

< / MINORLINE >

< / MAJOR_LINE >

I want to extract only the Covered_product_line_id and the Service_line_id of the above XML format, these data can come from any where in the xml file and the xml can be any length.

First we need to find the covered_product_line_id and the service_line_id associated with line_id, (as I pointed out in bold) here only a single pair i showed, but it can be in any number. (Note the line_id is inside the tag).

#PLSQL

Help, please.

Thanks in advance

Hey Odie,

Me do string literal too long error:

Select x.*

from xmltable)

XmlNamespaces(default ')

, ' for $i in //serviceLine

, $j in $i / coveredProduct

Returns the element r {}

$i / lineId

, $j/childProductLineId

}'

from xmltype (')

45146937

N20

1

63090598

CON-S

1

SNT

UCS - IOM

342544294

N20-FW012

342544295

342544294

UCS-IOM2

1

N20-C6508-UPG:

45146937

CON-S

1

SNT

342544295

N20-FW012

1

N20-C6508-UPG:

45146937

CON-SN

1

SNT

342544296

FET - 10G

16

N20-C6508 - UPG:U SC EXPERIENCE

342544297

UCSB-5108-PKG-FW

1

N20-C6508-UPXPANSION O

342544298

N20-CBLKP

2

N20-C6508 - UPG:0 - CBLKP

342544299

N01-UAC1

1

N20-C6508 - UPG:N01 - UAC1

342544300

N20-CBLKI

1

N20-C6508 - UPG:U HC EXPANSION OPT: N20-CBLKI

342544301

N20-FAN5

8

N20-C6508 - UPG:U HC EXPANSION OPT: N20-FAN5

342544302

N20-CBLKB1

6

N20-C6508-UPG-CBLKB1

342544303

N20 - CAK

1

N20-C6508-OPT: N20 - CAK

342544304

UCSB-B420-M3-D

1

N20-C6508-UP-B420-M3-D

63090594

CON-SNT-B420M3D

1

SNT

UCS-UC-E5-4617

342544305

UCS-ML-1X324RY-A

342544306

342544305

UCS-UC-E5-4617

2

N20-C6508 - UPG:PU - E5-4617

342544304

CON-SNT-B420M3D

1

SNT

342544306

UCSRY-A

2

N20-C624RY-A

342544304

CON-SNT-B420M3D

1

SNT

342544307

UCS0MS

1

N FIO-1600MS

63090595

CON-SNT-FIOB16MS

1

SNT

342544308

N2KD

4

N20-C6LKD

342544309

UCSB-HS-01-EP

2

N20-C65B-HS-01-EP

342544310

N1K-VSG-UCS-BUN

1

N20-C6508 - UPG:U-BLA1K-VSG-UCS-BUN

342544311

VSG-VLEM-UCS-1

1

N20-C6508 - UPG:U BLN1K BUN: VSG-VLEM-UCS-1

63090596

CON-SAU-VSGUCS

1

SAU

342544312

N1K-VLEM-UCS-1

1

N20-C6508CS-BUN: VMW N-UCS-1

63090597

CON-SAU-VLEMUCS

1

SAU

342544313

UCSB-ACDV

2

N20ACDV

342544314

R2XX-DMYMPWRCORD

2

PWRCORD N20 - C6

')

columns for the ordinalite seq_id

, path number child_product_line_id "childProductLineId".

, service_line_id number path "lineId.

) x ;

Tags: Oracle Development

Similar Questions

  • Parsing XML and get the attributes of a tag

    Hello

    When parsing XML for application of Cascades in C++, I am able to get the value of a tag as follows:

    00000

    But I also want to get the attributes of a tag:

    But I don't know how to get the 'CA' and 'California' attributes with my current code.  Can anyone help?  Here is the code I use to parse the XML code:

    void CMController::requestFinished(QNetworkReply* reply) {
    
        if (reply->error() == QNetworkReply::NoError) {
    
            QXmlStreamReader xml;
    
            QByteArray data = reply->readAll();
            xml.addData(data);
    
            QString zip;
            QString id;
            QString location;
    
            while (!xml.atEnd() && !xml.hasError()) {
    
                /* Read next element.*/
                QXmlStreamReader::TokenType token = xml.readNext();
    
                /* If token is just StartDocument, we'll go to next.*/
                if (token == QXmlStreamReader::StartDocument) {
                    continue;
                }
    
                /* If token is StartElement, we'll see if we can read it.*/
                if (token == QXmlStreamReader::StartElement) {
    
                    if (xml.name() == "zip") {
                        zip = xml.readElementText();
                    }
    
                    if (xml.name() == "id") {
                        ???
                    }
    
                    if (xml.name() == "location") {
                        ???
                    }
    
                }
    
            }
    
            emit succeeded(result);
    
        } else {
            emit failed();
        }
    
        reply->deleteLater();
    
    }
    

    Thank you!

    I found a working example:

    if(xml.name() == "state"){
        QXmlStreamAttributes attrib = xml.attributes();
        QStringRef ref = attrib.value("location");
        qDebug() << "location: " << ref;
    }
    
  • Parsing xml and store the details in the hierarchical tables

    Hi all

    I'm trying to parse a xml code and store the details in the hierarchical tables, however, I am unable to analyze the child attributes of tags and store the details in relational format.

    Oracle - 11.2.0.4 version

    My XML looks like in below:

    <Root>
    <ParentTag name="JobName" attrib1="Text" attrib2="SomeOtherText">
      <ChildTag childAttrib1="SomeValue1" childAttrib2="SomeValue2" />
      <ChildTag childAttrib1="SomeValue3" childAttrib2="SomeValue4" />
      <ChildTag childAttrib1="SomeValue5" childAttrib2="SomeValue6" />
    
      <OtherChildTag childAttrib1="SomeValue1" childAttrib2="SomeValue2" />
    </ParentTag>
    </Root>
    
    

    The table structure is as follows:

    create the table parent_details
    (
    job_id number primary key,
    VARCHAR2 (100) job_name,.
    job_attrib1 varchar2 (100),
    job_attrib2 varchar2 (100)
    );

    create the table child_details
    (
    child_id number primary key,
    number of parent_job_id
    child_attrib1 varchar2 (100),
    child_attrib2 varchar2 (100),
    Constraint fk_child_details foreign key (parent_job_id) refers to parent_details (job_id)
    );

    After analysis, I would expect the data to be stored in the format below:

    Table Name:-
    parent_details
    ID Name     Attribute1  Attribute2
    1  JobName  Text        SomeOtherText
    
    
    ChildTable (Store Child Tag details)
    ID Parent ID Attribute1  Attribute2
    1  1         SomeValue1  SomeValue2
    2  1         SomeValue3  SomeValue4
    3  1         SomeValue5  SomeValue6
    
    

    I tried following SQL, but it does not work. Please suggest if the same SQL can be improved to get the details in the expected format or should I use another solution.

    select job_details.*
      from test_xml_table t,
           xmltable ('/Root/ParentTag'
                      passing t.col 
                      columns 
                        job_name varchar2(2000) path '@name',
                        attribute1 varchar2(2000) path '@attrib1',
                        attribute2 varchar2(2000) path '@attrib2',
                        childAttribute1 varchar2(2000) path '/ChildTag/@childAttrib1'
                    ) job_details;
    

    I'm not forced to have a SQL solution, but would if it can be in SQL.

    Kind regards

    Laureline.

    Post edited by: Jen K - added the SQL, I tried to build.

    Well, the XML contains hierarchical data, and SQL is a "dish" of data, so it's up to you to treat lines that are coming out of the flat style and determine how to get that in separate tables.

    Suppose that we have several nodes of ParentTag each containing several nodes of ChildTag...

    SQL > ed
    A written file afiedt.buf

    1 with t (xml) as (select xmltype ('))
    2
    3
    4
    5
    6
    7

    8
    9
    10
    11
    12

    13
    ') of double)
    14-
    15 end of test data
    16-
    17 select x.p
    18, x.name, x.attrib1, x.attrib2
    19, including
    20, y.childattrib1, y.childattrib2
    21 t
    22, xmltable ('/ Root/ParentTag ')
    23 passage t.xml
    p 24 columns for ordinalite
    25, path name varchar2 (10) '. / @name'
    26, path of varchar2 (10) of attrib1 '. / @attrib1 '


    27, way to varchar2 (10) of attrib2 '. / @attrib2 '
    28 children xmltype road '.'
    29                 ) x
    30, xmltable ('/ ParentTag/ChildTag ')
    passage 31 x.children
    c 32 columns for ordinalite
    33, path of varchar2 (10) of childattrib1 '. / @childAttrib1 '
    34 road of varchar2 (10) of childattrib2 '. / @childAttrib2 '
    35*                ) y
    SQL > /.

    P NAME ATTRIB1 ATTRIB2 C CHILDATTRI CHILDATTRI
    ---------- ---------- ---------- ---------- ---------- ---------- ----------
    1 text JobName SomeOtherT 1 SomeValue1 value2
    1 text JobName SomeOtherT 2 SomeValue3 SomeValue4
    1 text JobName SomeOtherT 3 SomeValue5 SomeValue6
    JobName2 TextX SomeOtherT 1 SomeValue6 SomeValue8 2
    JobName2 TextX SomeOtherT 2 SomeValue7 SomeValue9 2

    Using the 'ordinalite' gives us the line number for this node in the XML file, so that you can identify each parent as well as to say who is the first record of this parent (because it will have a child with the ordinalite 1).

    An INSERT ALL tuition assistance we can insert into two different tables at the same time to keep related data... for example

    SQL > create table tbl1 (pk number, name varchar2 (10), attrib1 varchar2 (10), attrib2 varchar2 (10))
    2.

    Table created.

    SQL > create table tbl2 (parent_pk number, attrib1 varchar2 (10), attrib2 varchar2 (10))
    2.

    Table created.

    SQL > insert all
    2 when c = 1 then
    3 in the tbl1 (pk, attrib1, attrib2)
    4 values (p, attrib1, attrib2)
    When 5 1 = 1 then
    6 in the tbl2 (parent_pk, attrib1, attrib2)
    7 values (p, childattrib1, childattrib2)
    8 with t (xml) as (select xmltype ('))
    9
    10
    11
    12
    13
    14

    15
    16
    17
    18
    19

    20
    ') of double)
    21 select x.p
    22, x.name, x.attrib1, x.attrib2
    23, including
    24, y.childattrib1, y.childattrib2
    25 t
    26, xmltable ('/ Root/ParentTag ')
    27 passage t.xml
    p 28 columns for ordinalite
    29, path name varchar2 (10) '. / @name'
    30, path of varchar2 (10) of attrib1 '. / @attrib1 '
    31, path of varchar2 (10) of attrib2 '. / @attrib2 '
    32 children xmltype road '.'
    33                 ) x
    34, xmltable ('/ ParentTag/ChildTag ')
    passage 35 x.children
    c 36 columns for ordinalite
    37, path of varchar2 (10) of childattrib1 '. / @childAttrib1 '
    38, path of varchar2 (10) of childattrib2 '. / @childAttrib2 '
    39                 ) y
    40.

    7 lines were created.

    SQL > select * from tbl1;

    PK ATTRIB1 ATTRIB2 NAME
    ---------- ---------- ---------- ----------
    1 text JobName SomeOtherT
    2 JobName2 TextX SomeOtherT

    SQL > select * from tbl2.

    PARENT_PK ATTRIB1 ATTRIB2
    ---------- ---------- ----------
    1 SomeValue1 value2
    1 SomeValue3 SomeValue4
    1 SomeValue5 SomeValue6
    SomeValue6 2 SomeValue8
    SomeValue7 2 SomeValue9

  • Moved to the new server and updated applications upgraded to the APEX, 4.2.6.00.03 and get the random error when using IE 11.

    Hello

    I just moved a set of applications on a new server running Oracle 12 c and APEX 4.2.6.00.03, applications where initially on Oracle 10 G database with APEX 3.2.

    When you access via IE 11 users receive the error message after, when it appears that the only way to clear it is to close IE and reopen the application.

    apex_error.PNG

    There is an application that uses a database to MYSQL link, but the error when you use applications that do not use the link, so I'm not sure how to solve the problem.

    The error does not appear when you access applications through Chrome, but not all users have installed chrome.

    Thank you

    Ronnie

    Well Ronnie,

    This thread suppose to have a problem like yours and resolved. Please try on your side:

    After the footer I use: dbms_session.close_database_link ('mysql_databaselink_name');

    Please Urgent help on ora_sqlcode :-28500

    It will be useful.

    Thank you

    Sunil Bhatia

  • When I turn on the computer of mymy and it gives me request error indicating that "the required data was not put into memory due to an error of e state / of"0xc000009c".»

    Original title: IO error

    OK so I turn on my computer and it gives me request error indicating that "the required data was not put into memory due to an error of e state / of"0xc000009c".»

    I run an xp windows 2003-04. My computer does not start completely and if I click on debug or put end to the program there just restarts the computer. How can I solve this problem? and is it possible that I can update my software?

    You say that you can not even start in Safe Mode, so method 1 will not help you, method 2 will not help you and 3 method will not help you.

    I start in the XP Recovery Console and first run a chkdsk/r on the afflicted system, but since we don't know anything about your system, we will need more information.

    It is a shame that in the forums MS Answers, the first response to a new question is (or should be) a request for more information...  You are 5 days in your problem, and so for him it seems that you are not getting anywhere.  If the thread goes inactive for more than a few days, the response of the Microsoft Support Engineer will become the 'response' automatically because it has links to the KB articles.

    Since the Microsoft Answers forum does not have any kind of information system request when a new question is asked, we know absolutely nothing about your system.  Not knowing the basic information a problem prolongs the frustration and the agony of these issues.

    Thank you MS Answers, allowing the resolution of simple problems as frustrating and a lot of time as possible.

    Provide information on your system, the better you can:

    What is your system brand and model?

    What is your Version of XP and the Service Pack?

    Your system have IDE or SATA disks?

    Describe your current antivirus and software anti malware situation: McAfee, Symantec, Norton, Spybot, AVG, Avira!, MSE, Panda, Trend Micro, CA, Defender, ZoneAlarm, PC Tools, Comodo, etc..

    The question was preceded by a loss of power, aborted reboot or abnormal termination?  (this includes the plug pulling, buttons power, remove the battery, etc.)

    The afflicted system has a working CD/DVD (internal or external) drive?

    You have a genuine XP installation CD bootable, which is the same Service as your installed Service Pack (this is not the same as any recovery CD provided with your system)?

    If the system works, what do you think might have changed since the last time it did not work properly?

  • I HAV been trying to update my expiration date of credit card for 3 months.  When I go to lelien for "Update payment Details" and edit the expiration date and &lt; click &gt; save, I get an error saying my address in invalid.  I have several chat sessions

    Can someone please help...  Suggestions, how can I overcome this problem, in which case my Adobe Creative cloud subscription will expire today due to and credit card.

    I tried to update my expiration date of credit card for 3 months.  When I go to the "Update payment Details" link and change the expiry date then < click > save, I get an error saying my invalid address.  I had several chat sessions with support, called support and logged a ticket with support and every time they tell me to go to a particular link to update my contact information.  I do and I get the same error...   "My coordinates are not valid."  Now I'm in the position where my creative cloud membership will expire today everything simply because the Adobe address validation do not think that my address is valid.

    I got 'Cat' sessions with the support,

    I made a phone call to the support and

    I logged a ticket with support.  I'm really trying to pay my subscription.  Support ticket No. 0216009991

    Whenever I have contact the support they gave me a link to the site where I supposedly can I enter my credit card details.

    Whenever I went on the link provided, I'd get the same error.  "My coordinates are not valid."

    What I checked on my address.

    1. I look out the window and the view I get is the same as it was yesterday and the day, and in fact several years ago.

    2. I go out in the street, Yes, the street sign says the name of my street

    3. I go to my mailbox and it does not say the number of my mailing address

    4. yes I get the email to the address registered with Adobe

    5. yes I received the email from adobe delivered to the address

    6. I get the address of Google, yes I can find it on Google

    7. I converted to use the satellite view Google maps

    8. Yes, it's my house, with the 12 solar panels on the roof

    9. Yes, that's my black car in the driveway

    10. I check my reviews for my address Board rate, Yes, this is the address that I recorded with Adobe

    11. Yes, I had this same address registered at Adobe for the past 3 years.  So far I have not had a problem with my address

    12. I work with a software company that actually uses the address of Google, under license validation, built-in in their application.  I used this software to check to see if my address is recognized as valid.  You guessed it is recognized as valid.

    I did check my credit card

    12. Yes, I have, every time checked the status of my credit card with the Bank

    a. the card is valid

    b. the card's not over it's credit limit

    c. the card is not due

    d. the address registered to my credit card with the Bank is the same address that I recorded with Adobe

    Since the last link Adobe support gave me two weeks ago, to change my credit card details, I was able to key a new credit card in the fields (Yes it's good that I was forced to get a new credit card only for Adobe!   If I am that everything would be fine.

    But wait...   The details I provided this link have not been updated on the Adobe site.  (So I check the link... I was scammed to get my card number?)

    After investigation of the link, I'm fairly confident of the link provided is a true link to Adobe.  www.adobe.com/go/Secure

    Did anyone else had this type of problem when you try to update the expiration date of a credit card?

    The question is about to have an impact on my ability to process pictures for my photography business, it affects my ability to earn an income.

    So you could say I'm getting angry some of the stuffing!

    In summary...  I knew that my credit card had a new expiration date and I tried to update the expiration 3 months 3 months.

    Simply because the use of the validation of addresses, Adobe, has a few flaws, I was not able to update this information.  So Adobe today will stop my subscription.

    As I said in previous support tickets, chat sessions and telephone.  I'll be more disappointed if I am prevented from using software and Adobe cloud features.

    It is copied from an email I received during the night from Adobe...

    Continue to create with us

    Hi Thomas,

    Your Creative cloud membership will expire on August 23, 2015 (PT). We hope that you have been getting the best out of all that creative cloud has to offer. To extend your subscription, please update the billing for your account information, or add a prepaid card.

    Update your billing information (there is a link to where I can update the expiry date) pocztek sigh...   I still get the same error telling me that my address is not valid!

    Thank you for being a part of the creative cloud,

    The creative team Cloud

    Good creative team...  I REALLY WANT TO STAY IN THE TEAM, AS YOU CAN SEE FROM THE FOREGOING, THAT I REALLY TRIED TO SOLVE THIS PROBLEM SEVERAL TIMES OVER THE PAST 3 MONTHS.

    I tried to include as much information as possible in what I said earlier, I expressed in a way that will hopefully provide a little humor, but at the same time to portray the frustration I'm feeling right now.

    Honestly, I don't know what more I can do.  It seems that I have no other recourse start litigation for loss of income coming from Adobe address Validation errors.  There is a real chance that I will be litigated against because I won't be able to complete contracts.

    There must be a healthier solution of mind that court proceedings.

    Kind regards

    Thomas Croll

    (Tom)

    Tom, let me some time. I I will get these verified case and will contact you.

  • Compare and get the data in the tables (see post for details)

    I have two tables TableA and TableB. I struggle to write a query to get the dates of TableB (instead of TableA dates) where TableA dates don't coincide with the tableB (beginning and end).

    Example 1: For account A1234,.

    TableA got 2 rows 1/31/2014-3/3/2014 (which corresponds to TableB row), but TableA got another rank 31/01/2014 - 31/01/2014 that corresponds with the date of TableB Begin. In this case, I'm looking for output as below,

    Use TableB start and end date and combine number two rows from TableA for this account

    ACCOUNTTableB_BEGINTableB_ENDAMOUNT
    A123431/01/201403/03/2014100.0000000000

    Example 2: For the B7777 account.

    TableA end date aligns with the end dates of TableB for this account, in this case I want out put as,.

    Use TableB start and end date and get the amount of TableA

    ACCOUNTTableB_BEGINTableB_ENDAMOUNT
    B777705/04/201306/05/2013200.0000000000

    Example 3: On behalf of D5555,.

    Even a TableA line corresponds with TableA, there are two other rows in TableA matching start date with TableA and correspondence with the end date with TableA, in this case, that I put as,.

    Use TableB start and end date and combine number three rows from TableA for this account.

    ACCOUNTTableB_BEGINTableB_ENDAMOUNT
    D555508/08/201410/09/20141100.0000000000

    Example 4: To account E6666.

    Table corresponds to a row with TableB and no additional lines in TableA, just display the data in A table

    Tables and data:

    create table TableA
    (
      Account varchar2(10) not null,
      Begin   date not null,
      End     date not null,
      Amount  number(19,10) not null
    )
    ;
    
    
    create table TableB
    (
      Account varchar2(10) not null,
      Begin   date not null,
      End     date not null,
      Amount  number(19,10) not null
    )
    ;
    
    
    TableA Data:
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('A1234', to_date('31-01-2014', 'dd-mm-yyyy'), to_date('31-01-2014', 'dd-mm-yyyy'), 0.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('A1234', to_date('31-01-2014', 'dd-mm-yyyy'), to_date('03-03-2014', 'dd-mm-yyyy'), 100.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('B7777', to_date('18-04-2013', 'dd-mm-yyyy'), to_date('06-05-2013', 'dd-mm-yyyy'), 120.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('C6666', to_date('25-06-2014', 'dd-mm-yyyy'), to_date('08-07-2014', 'dd-mm-yyyy'), 10.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('D5555', to_date('08-08-2014', 'dd-mm-yyyy'), to_date('16-08-2014', 'dd-mm-yyyy'), 1000.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('D5555', to_date('08-08-2014', 'dd-mm-yyyy'), to_date('10-09-2014', 'dd-mm-yyyy'), 0.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('D5555', to_date('16-08-2014', 'dd-mm-yyyy'), to_date('10-09-2014', 'dd-mm-yyyy'), 100.0000000000);
    
    
    insert into tablea (ACCOUNT, BEGIN, END, AMOUNT)
    values ('E6666', to_date('01-01-2014', 'dd-mm-yyyy'), to_date('01-02-2014', 'dd-mm-yyyy'), 100.0000000000);
    
    
    TableB Data:
    
    
    insert into tableb (ACCOUNT, BEGIN, END, AMOUNT)
    values ('A1234', to_date('31-01-2014', 'dd-mm-yyyy'), to_date('03-03-2014', 'dd-mm-yyyy'), 100.0000000000);
    
    
    insert into tableb (ACCOUNT, BEGIN, END, AMOUNT)
    values ('B7777', to_date('05-04-2013', 'dd-mm-yyyy'), to_date('06-05-2013', 'dd-mm-yyyy'), 200.0000000000);
    
    
    insert into tableb (ACCOUNT, BEGIN, END, AMOUNT)
    values ('C6666', to_date('06-06-2014', 'dd-mm-yyyy'), to_date('08-07-2014', 'dd-mm-yyyy'), 10.0000000000);
    
    
    insert into tableb (ACCOUNT, BEGIN, END, AMOUNT)
    values ('D5555', to_date('08-08-2014', 'dd-mm-yyyy'), to_date('10-09-2014', 'dd-mm-yyyy'), 1100.0000000000);
    
    
    insert into tableb (ACCOUNT, BEGIN, END, AMOUNT)
    values ('E6666', to_date('01-01-2014', 'dd-mm-yyyy'), to_date('01-02-2014', 'dd-mm-yyyy'), 100.0000000000);
    
    
    
    
    SELECT A.ACCOUNT,
           A.BEGIN,
           A.END,
           A.AMOUNT,
           B.ACCOUNT,
           B.BEGIN,
           B.END,
           B.AMOUNT
      FROM TABLEA A
      LEFT JOIN TABLEB B
        ON A.ACCOUNT = B.ACCOUNT
    

    Hello

    SeshuGiri wrote:

    Hi Frank,.

    Your query/solution works very well, but I forgot to mention something in the first post...

    Please insert these additional lines and try the request again.

    TableA Additional lines:

    1. Insert into TABLEA (ACCOUNT, BEGIN, END, QUANTITY)
    2. values ('F9999', to_date (January 2, 2014 ',' dd-mm-yyyy ""), to_date (3 January 2014 ', 'dd-mm-yyyy'), 999.0000000000);
    3. Insert into TABLEA (ACCOUNT, BEGIN, END, QUANTITY)
    4. values ('A1234', to_date (March 3, 2014 ',' dd-mm-yyyy ""), to_date (4 March 2014 ', 'dd-mm-yyyy'), 999.0000000000);

    TableB Additional lines:

    1. Insert into TABLEb (ACCOUNT, BEGIN, END, QUANTITY)
    2. values ('A1234', to_date (March 3, 2014 ',' dd-mm-yyyy ""), to_date (4 March 2014 ', 'dd-mm-yyyy'), 999.0000000000);

    Question 1:

    The table has a rows for A1234 account (i.e. the time period different than the ranks for the same account)

    one is A1234 31/01/2014-03/03/2014, A1234 03/03/2014-03/04/2014

    Your query that returns two rows for A1234 account (which is what I want), but the amount is messed up.

    ACCOUNT BEGIN END TOTAL_AMOUNT
    1 A1234 31/01/2014 03/03/2014 1100
    2 A1234 03/03/2014 03/04/2014 1100

    Except:

    ACCOUNT BEGIN END TOTAL_AMOUNT
    1 A1234 31/01/2014 03/03/2014 101
    2 A1234 03/03/2014 03/04/2014 999

    Question 2:

    In some cases TableA will have an account (F9999), but the TableB don't. I can just this line by making the Left Join right join?

    I don't get the results with additional data. I get 1099 for two lines where account = 'A1234 '.  I get 1100 as the amount on the line with the account = "D5555.  You did it other changes to data?

    Except:

    ACCOUNT BEGIN END TOTAL_AMOUNT
    1 A1234 31/01/2014 03/03/2014 101
    2 A1234 03/03/2014 03/04/2014 999

    Still, I don't see why you want to 101 for the amount of the first row.  Why not 100?

    How can you know which rows from tablea should get attached to what rows from tableb, when the account is not unique?

    Maybe you want something like this:

    SELECT a.account

    b.begin

    b.end

    SUM (a.amount) AS total_amount

    FROM tablea a

    ON a.account = b.account JOIN tableb B

    AND a.begin BETWEEN b.begin

    AND b.end

    AND a.end BETWEEN b.begin

    AND b.end

    GROUP OF a.account, b.begin, b.end

    ORDER BY a.account

    ;

    but I guess just to your needs, and guessing is not a very good or reliable way to solve problems.

    Question 2:

    In some cases TableA will have an account (F9999), but the TableB don't. I can just this line by making the Left Join right join?

    Yes, it looks that you want an outer join.  What happened when you tried?  As always, post your code, the exact results you want from the given sample data, as well as an explanation of how you get these results from these data.

  • I deleted the creative cloud of the trial and the DM Dream weaver of the trial, after only using it for about 6 days, I tried to re-download the two tests and nothing happens. Anyone know how I can get this done. Please advise, your help will be greatly a

    Hello

    I deleted the creative cloud of the trial and the DM Dream weaver of the trial, after only using it for about 6 days, I tried to re-download the two tests and nothing happens. Anyone know how I can get this done. Please advise, your help will be greatly appreciated.

    Hello

    Also see also software Adobe to trial has expired at the beginning

    Hope that helps!

    Kind regards

    Sheena

  • I tried to download a pdf and convert them into excel, but the data in excellent is always to the image format.  How can I get the pdf data into the columns and rows?

    I tried to download a pdf and convert them into excel, but the data in excellent is always to the image format.  How can I get the pdf data into the columns and rows so that I can do the calculations?

    If you start the https://forums.adobe.com/welcome Forums Index

    You will be able to select a forum for the specific Adobe products you use

    Click on the symbol "arrow down" on the right (where it is said to see all our products and Services) to open the drop-down list and scroll

  • I have a new macbook pro and want to install CS3 on it. I followed all the download links. Found my serial number for my Adobe account and get up to date through the whole &amp; get this message ' put in place has encountered an error and cannot continue,

    I have a new macbook pro and want to install CS3 on it. I followed all the download links. Found my serial number for my Adobe account and get up to date through the whole & get this message ' put in place has encountered an error and cannot continue, contact adobe customer support for assistance ' all I want is for CS3 to install on my new computer so I can continue to work and do not have to spend hours working it help Please. CC is not an option, because I work in a country with no reliable unlimited internet access

    New computer means new problems of system operating with the OLD software means

    Fix possible Mac 10.10.4 (at least for Premiere Pro) https://forums.adobe.com/thread/1891705

    10.10 mac. ? sometimes has problems, often related to the 'default' permissions that need to be changed

    -solution https://forums.adobe.com/thread/1689788 of a person

  • Starting from two data tables, how do you get the values in two columns using values in a column (values get col. If col. A is not null values and get the pass. B if col. A is null)?

    Two tables provided, how you retrieve the values in two columns using values in a column (the pass get values. If col. A is not null values and get the pass. B if col. A is null)?

    Guessing

    Select nvl (x.col_a, y.col_b) the_column

    from table_1 x,.

    table_2 y

    where x.pk = y.pk

    Concerning

    Etbin

  • I can not connect to a web site using my iPad. Message says required certificate required. No problem using my laptop. How can I get the required certificate on my iPad?

    EError message say site has no certificate, no problems until what I put at the operating system level. How can I get the required certificate on my iPad?

    Certificates are provided by the site. So if the site has a certificate expired or outdated, it may not work. In your case, the certificate No is probably not updated to work with the new software of Safari on your iPad,

    If all other Web sites running on the iPad except this one, I'll try to contact the manufacturer Web site. If a single Web site does not work, there probably nothing wrong with the iPad. In addition, certificates work differently on an iOS, as opposed to an OSX computer device.

    The only thing that can help on the end of your iPad is to delete the data from the Web site for this particular site. It might be the old data storage a before you update. To do this, go to settings > Safari > advanced > data Web site > Edit > remove data from the Web site.

    If you want to erase all data from the Web site, you can go to settings > Safari > clear the history and data from the Web site. Which will remove saved passwords and all data of the Web site, so don't do that if you know your password.

    Good luck

  • I can't sync my phone to my computer and get the message that my phone doesn't have the latest version of Itunes. I downloaded the latest version on my mac, but what I do on my phone. I'm used to be able to synchronize the two.

    I am more able to sync my I phone on my Mac and get the message that my phone cannot be used because it requires a newer version of iTunes. He tells me to go to www.itunes.com to download the latest version of iTunes... I downloaded the latest version on my mac, but what I do on my phone? I used to be able to sync the two and now I can't even download the photos from my phone on my mac...

    iOS9 on a mobile device requires iTunes 12.3 or higher, which in turn requires a computer running OSX 10.8.5 or higher.  Update of the system only checks the updates for the current version of the system you run, but that itself can be updated.  It may or may not be possible to upgrade your computer to the system requirements. Find your computer on the web site of http://www.everymac.com model and near the bottom of the specification of the system section, he will tell what versions of the operating system, it is able to run. If you can not run a newer system, you will not be able to sync this phone to your current computer. If she can run 10.8.5 or higher, you can either buy a download for Apple OSX 10.8 Mountain Lion code online, or you can try to install the free El Capitan OSX 10.11.  El Capitan can run slower on older machines and require the additional purchase of RAM.  Making a big jump in versions of system is also more likely to affect the old software.

    At el capitan Snow Leopard, it will make my macbook is slow?  - https://discussions.apple.com/thread/7412959

    Mountain Lion 10.8 purchase link United States of America - http://www.apple.com/shop/product/D6377Z/A/os-x-mountain-lion

    Mountain Lion 10.8 purchase link U.K. - http://www.apple.com/uk/shop/product/D6377ZM/A/os-x-mountain-lion

    Course OSX Upgrade General information, including configuration required - http://www.apple.com/osx/how-to-upgrade/

  • How to add two lines when the second row is not visible, but also gets the first data line too?

    Mr President

    Jdev worm is 12.2.1

    How to add two lines when the second row is not visible, but also gets the first data line too?

    I want to add two lines like below picture, but want the second to remain invisible.

    tworows.png

    I asked this question but my way of asking was wrong, that's why for me once again.

    Concerning

    Try to follow these steps:

    1. in the database table to add the new column "JOIN_COLUMN" and add the new sequence "JOIN_SEQ".

    2. Add this new column in the entity object. (You can add this in entity object by right clicking on the entity object and then select "Synchronize with database" then the new column and press on sync)

    3. in your bookmark create button to create only one line NOT 2 rows.

    4 - Open the object entity--> java--> java class--> on the entity object class generate and Tick tick on the accessors and methods of data manipulation

    5 - Open the generated class to EntityImpl and go to the doDML method and write this code

      protected void doDML(int operation, TransactionEvent e)
      {
        if(operation == DML_INSERT)
        {
          SequenceImpl seq = new SequenceImpl("JOIN_SEQ", getDBTransaction());
          oracle.jbo.domain.Number seqValue = seq.getSequenceNumber();
          setJoinColumn(seqValue);
          insertSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        if(operation == DML_UPDATE)
        {
          updateSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        super.doDML(operation, e);
      }
    
      private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "Insert into table_name (COLUMN_1,COLUMN_2,COLUMN_3,JOIN_COLUMN, HIDDEN_COLUMN) values ('" + value1 + "','" + value2 + "','" + value3 + "','" + joinColumn + "', 1)";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
      private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "update table_name set column_1='" + value1 + "', column_2='" + value2 + "', column_3='" + value3 + "' where JOIN_COLUMN='" + joinColumn + "'";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
  • How to get the old data 6 months from the current date?

    Hi friends,

    I have a table which includes historical data, which are having more than 1 years old data. The historical table gets updated once a week. My requirement is that I should get the latest data from the week of each month for 6 months according to the current data. I use oracle 10g.

    Can you please someone help in this.

    Thanks in advance

    SELECT last_day (ADD_MONTHS (TRUNC (SYSDATE, 'mm'),-LEVEL))-7 start_dt.
    LAST_DAY (ADD_MONTHS (TRUNC (SYSDATE, 'mm'),-LEVEL)) end_dt
    OF THE DOUBLE
    CONNECT BY LEVEL<=>

    change as a result, I have provided you the start and end dates for your logic...

Maybe you are looking for

  • Photosmart D110A: Solutions Center HP

    I got HP Solution Center on my computer for at least 18 months.  All of a sudden, it doesn't work because it says that the device is not over.  I uninstalled and reinstalled.  Still the same message.  The printer works - wirelessly!  I know that it i

  • does anyone know how 2 uninstall an add-on called 'oneliner '?

    I installed an add-on re-startless recommended by lifehacker. It does not appear in the extensions, plug-ins, appearance or anywhere. I dislike it intensely, & want 2 get rid of it, but cannot. someone, help please? Thank you very

  • PSC 2510: PSC 2510 Windows 8.1 - new router - can't change network settings

    OK so I got a new router so the IP address has goen of 169.254. * to 192.168. *. The page configuration network bed 169.254.124.x as the IP address and wireless can be found as the SSIS is hpsetup. I connected the USB cable, downloaded the HP printer

  • Limit the visibility of music to the songs offline only?

    I use iPhone through my car stereo as a source of music. I could browse and select music stored on the iPhone via the interface of the car. I now use the Apple music. I don't listen to music through mobile data. Instead I sync/download albums selecte

  • envy5531: want 5531

    I have a new printer of e 5531.  In the box is a disc of 5530e-All-in-One series want to use to activate my printer.  The printer will not receive information from the drive so a printer useless.  How can I make the printer achievable?