[8i] need help for updating/fixing work table

I work in an old database:
Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
PL/SQL Release 8.1.7.2.0 - Production
CORE 8.1.7.0.0-Production
AMT for HP - UX: 8.1.7.2.0 - Production Version
NLSRTL Version 3.4.1.0.0 - Production

I'm trying to fix a work schedule, and I'm not exactly sure how do. I am accustomed to querying data, do not make changes to the data...

Some examples of data:
CREATE TABLE     test_cal
(     clndr_dt     DATE     NOT NULL
,     work_day     NUMBER(3)
,     clndr_days     NUMBER(6)
,     work_days     NUMBER(5)
);

INSERT INTO     test_cal
VALUES     (TO_DATE('12/30/2010','mm/dd/yyyy'), 254, 11322, 7885);
INSERT INTO     test_cal
VALUES     (TO_DATE('12/31/2010','mm/dd/yyyy'), 255, 11323, 7886);
INSERT INTO     test_cal
VALUES     (TO_DATE('01/01/2011','mm/dd/yyyy'), 0, NULL, NULL);
INSERT INTO     test_cal
VALUES     (TO_DATE('01/02/2011','mm/dd/yyyy'), 0, NULL, NULL);
INSERT INTO     test_cal
VALUES     (TO_DATE('01/03/2011','mm/dd/yyyy'), 1, NULL, NULL);
INSERT INTO     test_cal
VALUES     (TO_DATE('01/04/2011','mm/dd/yyyy'), 2, NULL, NULL);
INSERT INTO     test_cal
VALUES     (TO_DATE('01/05/2011','mm/dd/yyyy'), 3, NULL, NULL);
INSERT INTO     test_cal
VALUES     (TO_DATE('01/06/2011','mm/dd/yyyy'), 4, NULL, NULL);
INSERT INTO     test_cal
VALUES     (TO_DATE('01/07/2011','mm/dd/yyyy'), 5, NULL, NULL);
INSERT INTO     test_cal
VALUES     (TO_DATE('01/08/2011','mm/dd/yyyy'), 0, NULL, NULL);
INSERT INTO     test_cal
VALUES     (TO_DATE('01/09/2011','mm/dd/yyyy'), 0, 11332, 7895);
INSERT INTO     test_cal
VALUES     (TO_DATE('01/10/2011','mm/dd/yyyy'), 6, 11333, 7896);
Note: 2010-12-31 is the last time that I am 100% sure that the data in the table are good. After that, clndr_days and work_days are absent or at least in the case of work_days, are not correct No.

It is a question of both parties, since I need to set the clndr_days and the work_days. (You can fix probably both with a single statement, but I broke it into two to start, to simplify it for me).

I show only 12 days in my sample data, but really, the table stretches in a number of years and pass another 5 years.

PART 1: determination of clndr_days

I've implemented this request:
SELECT     clndr_dt
,     work_day
,     work_days
,     clndr_days
,     min_clndr_day + r_num     AS clndr_days_test
FROM     (
     SELECT     t.*
     ,     MIN(clndr_days)     OVER(ORDER BY clndr_dt)     AS min_clndr_day
     ,     ROW_NUMBER() OVER(ORDER BY clndr_dt)-1     AS r_num
     FROM     test_cal t
     WHERE     clndr_dt     >= TO_DATE('12/31/2010','mm/dd/yyyy')
     )
;
Who gives the right clndr_days (like clndr_days_test), but I don't know how to get that in the table.

It does not work:
UPDATE     test_cal
SET     clndr_days     =     (
                    SELECT     min_clndr_day + r_num
                    FROM     (
                         SELECT     t.*
                         ,     MIN(clndr_days)     OVER(ORDER BY clndr_dt)     AS min_clndr_day
                         ,     ROW_NUMBER() OVER(ORDER BY clndr_dt)-1     AS r_num
                         FROM     test_cal t
                         WHERE     clndr_dt     >= TO_DATE('12/31/2010','mm/dd/yyyy')
                         ) c
                    WHERE     c.clndr_dt     = ???  -- how do I make this equal whatever the clndr_dt is for the record I'm updating?
                    )
WHERE     clndr_dt     >      TO_DATE('12/31/2010','mm/dd/yyyy')
and I don't know how to operate...


PART 2: Fixing work_days

Then, I can't set up a query for work_days.

That's what I have so far, but it does not work quite right, and then it must also be as well an UPDATE statement:
SELECT     clndr_dt
,     work_day
,     work_days
,     clndr_days
,     min_work_day + r_num     AS work_days_test --this isn't right, when work_day is 0 work_days_test should be the previous work_day not the minimum work_day
FROM     (
     SELECT     t.*
     ,     MIN(work_days)     OVER ( ORDER BY clndr_dt)     AS min_work_day
     ,     CASE
               WHEN     work_day     <> 0
               THEN     ROW_NUMBER()     OVER ( PARTITION BY     CASE
                                                  WHEN     work_day <> 0
                                                  THEN     1
                                                  ELSE     2
                                             END
                                     ORDER BY     clndr_dt
                                   )
               ELSE     0
          END               AS r_num
     FROM     test_cal t
     WHERE     clndr_dt     >= TO_DATE('12/31/2010','mm/dd/yyyy')
     )
;
(When I tried to use LAG, that did not work either, because you can have more than 1 non consecutive working day and so it only works for the first day of non-working to have the correct work_days, and then it is to be wrong again)

That's what I want my table to look like in the end:
CLNDR_DT                   WORK_DAY       WORK_DAYS CLNDR_DAYS_TEST
------------------- --------------- --------------- ---------------
12-31-2010 00:00:00         255.000       7,886.000    11,323.000
01-01-2011 00:00:00            .000       7,886.000    11,324.000
01-02-2011 00:00:00            .000       7,886.000    11,325.000
01-03-2011 00:00:00           1.000       7,887.000    11,326.000
01-04-2011 00:00:00           2.000       7,888.000    11,327.000
01-05-2011 00:00:00           3.000       7,889.000    11,328.000
01-06-2011 00:00:00           4.000       7,890.000    11,329.000
01-07-2011 00:00:00           5.000       7,891.000    11,330.000
01-08-2011 00:00:00            .000       7,891.000    11,331.000
01-09-2011 00:00:00            .000       7,891.000    11,332.000
01-10-2011 00:00:00           6.000       7,892.000    11,333.000
(Sorry for all the additional decimals)

Published by: user11033437 on January 11, 2012 13:40

Hello

Thanks for posting the CREATE TABLE and instructions INSERT, the desired output that is very clear, and your attempts; It's all very useful. It would also be useful to explain how you get the desired based on the sample results. There's always a chance, a person could get by chance good results for the wrong reasons with the small set of sample data, but allows you to get complete wrong results with your data would cause.
It seems that clndr_days is the total number of days elapsed since some point of conventional departure (perhaps when the company started), and that work_days is the total number of days of work to a starting point. It seems that work_day is 0 when the day is not a working day, and otherwise, the total number of working days so far in the calendar year. Is this fair?

You said the data after December 31, 2010 is not reliable. Did you mean that two columns (clndr_days and work_days) are not reliable, but the rest of the data is reliable? In other words, are you sure there is only one line a day even after that 2010 and the work_day column is accurate? If so, you can do this:

UPDATE       test_cal     m
SET       (clndr_days, work_days) =
(
     SELECT     MIN (clndr_days) + COUNT (*) - 1          -- clndr_days
     ,     MIN (work_days)  + COUNT ( CASE
                                           WHEN  work_day > 0
                                AND   clndr_dt > TO_DATE ('12/31/2010', 'MM/DD/YYYY')
                                THEN  1
                            END
                             )               -- work_days
     FROM     test_cal
     WHERE     clndr_dt     BETWEEN     TO_DATE ('12/31/2010', 'MM/DD/YYYY')
                    AND     m.clndr_dt
)
WHERE     clndr_dt     > TO_DATE ('12/31/2010', 'MM/DD/YYYY')
;

You are right: it is possible to set the two columns at the same time.

It's a shame that you are using Oracle 8.1. The command MERGE, which was new in Oracle 9.1, is much clearer and more effective. If you could use MERGE, you can essentially use the code you have posted in the middle of a MERGE statement.

Education of UPDATE above assumes that, for the incorrect days, clndr_days and work_days will be never less than the last exact value. If this is not the case, the solution is a bit more complicated. You can avoid this problem and to make the statement faster too, by simply hard-code the last exact value of clndr_days and work_days in the UPDATE statement, where I used min. (this looks like a situation where the efficientcy is not a big problem, however. "You'll probably never make this exact UPDATED once again, so if it runs in 1 second or 10 minutes maybe not much of importance.)

Sorry, I don't have an Oracle 8 database to test this. It works in Oracle 9.2, and I do not think that it uses all the features that are not available to the point 8.1.

Tags: Database

Similar Questions

  • Need help to update to work with the new vSphere environment 6

    I have a great powershell script some time ago, I created to clone our production servers in a development environment and configure them for use in isolated vShield development networks.

    We have recently updated our environment vSphere vSphere 6 and changed architecture autour 5.

    Previously with vSphere 5 we had a unique vCenter server that managed our two datacenters by itself.

    With the new design of vSphere 6, we have a PSC and VCSA server to each data center in one area of SSO.

    The first thing I did with my script of cloning is up-to-date reference vcenter for a table of two servers, so I connect to two VCs at the same time.

    This allows me to see and manage the two vCenters virtual computer guests, so get - vm strives to see the comments of the source.

    However, the problem is that when I try to clone a virtual machine from one data center to another, the command fails because it can't find the virtual machine to clone.

    # Virtual Centre server or VM host to connect to
    $aryVIServer = @("vc01.domain.com", "vc02.domain.com")
    
    # Load VMware environment
    Set-PowerCLIConfiguration -DefaultVIServerMode Multiple -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
    $VIServer = Connect-VIServer $aryVIServer
    
    # Server cluster group to deploy to
    $strVMCluster = "Bubbles"
    
    # Define name of new server including environment prefix
    $vmName = "$($envPrefix)-$($CloneServer)"
    
    # Select Host with least memory consumption
    $selectedHostObj = Get-VMHost -Location $strVMCluster | Sort-Object -Property MemoryUsageGB | Select-Object -First 1
    
    # Select folder to place VM guest into
    $folderObj = Get-Datacenter -Cluster $strVMCluster | Get-Folder $selectedBubble
    
    # Select datastore with most available space
    $selectedDatastoreObj = Get-DataStore -VMHost $selectedHostObj | Sort-Object -Property FreeSpaceGB -descending | Select-Object -First 1
    
    # Clone new VM from running Server
    $newVM = New-VM -Name $vmName -VM $CloneServer -VMHost $selectedHostObj -Datastore $selectedDatastoreObj -DiskStorageFormat "Thin" -Location $folderObj -Confirm:$false
    

    He used to work very well when there was a single VC but of course does not now with two.

    So far, the only difference is the change in VCs. We always use the same exact 5.0 running ESXi hosts to the same place in separate data centers.

    Oh and I'm now using powercli 6.3 R1 instead of 5.5 R1.

    I look forward to this type of procedure should work fine, and I just need a different command for virtual machine cloning now?

    Well, I have solved the first problem according to them here:

    Re: Impossible to deploy VM model on different vCenter Server (in the same domain of SINGLE sign-on)

    However, now I can't run Invoke VMScript without getting an error that the proxy authentication is required.

    If I remove all my proxy settings in Internet Explorer, then it connects fine but this script must be run by a number of engineers without being dependent on their proxy settings are disabled.

    I can programmatically change the settings of proxy at the beginning of the script, but nothing not preventing to change those back if they use their browser and break execution of the halfway of script.

    Never had any problems with the Proxy settings before and I didn't know any other messages that have directly relevant air.

    Anyone know of a way to avoid this?

  • Need help for Solitaire at work

    Hey people I just got a new computer and it won't let me start a solitare game.  The game is listed in the games, but I have to do something wrong. I tried to click the icon of solitaire, but it just opens a plate cookie instead of throwing the game. Help, please

    Hi Roadking95,

    Thank you for visiting Windows Vista Microsoft answers forum.

    The game of the Inbox that's loner is not installed properly on the computer.

    To correctly install the games from the Inbox on the computer, follow these steps:

    1. on the Start Menu, select Control Panel. In Control Panel, select "programs". Then select "Turn Windows features on or off".

    2. cut the games by clicking on the box next to games. This will remove the check from the box.  Select 'OK '. Select restart to reboot your system.

    3. on the Start Menu, select Control Panel. In Control Panel, select "programs". Then select "Turn Windows features on or off".

    4. turn on the games by clicking on the box next to games. This will add the control to the Toolbox.  Select 'OK '. Choose "Restart" to reboot your system.
    The games should now run correctly on the Start Menu.

    For reference, you can visit the link for the following Article:
    http://support.Microsoft.com/kb/972035

    Please let us know if it helps.

    Thank you and best regards,
    David

  • Need help for optical safety circuit.

    I buy these parts and prototype with real components, but since I multisim, I thought it would be nice to create the circuit and maybe work through issues I can practically.

    I need a circuit that takes 120 VCA, generates 5 VDC and 1.5Vdc power of optical transmitter and receiver.  I actually use a data port because he has great range and is pretty cheap.  Rather than send the binary code well I just send a light stead that is broken or not broken through doors and windows in my house.  Then the receiver sees this as an entry and order a relay.

    I tried several voltage regulators that come with multisim, but I get an error of execution of my circuit.  Really I can't the 120 VAC to power levels necessary for the functioning of the optics.

    Otherwise I might want to run on a system 120Vdc with battery backup, so throw a 120Vdc up to 20 v DC switching power supply - but I have not found a SMP in the library which takes 120 as input and as output 20.

    Basic plan: 120VAC source-> transform to 24Vac-> Full bridge rectifier to ~ 20 v DC-> voltage capacitor filter on the input of two voltage regulators (1 to 5 VDC, 1 to 1.5Vdc) - then circuit since the two power supply of the transmitter and the receiver.

    I just need help for 5V and 1.5V, from there, I know that the real world circuit will work component tests already carried out.  Thanks for reading.

    I didn't Multism so I can't advise you on the compatible models. I ran the model on semiconductors with slight modifications of format on my SPICE simulator based on Berkeley Spice 3f5. I had to change the format of model resistance semiconductors appeal but has not changed any values.

    The output of your power supply circuit 3 (with 5 V, not the 1.5 V regulator regulator) was 4.99995 V.

    There are a few messages about changing templates published for compatibility Multisim woth. You can search those to see if there are any suggestions on what you'll need to fix in the model.

    Lynn

  • I need help to update my computer (error code: 80070424)

    original title: I need help to update my computer

    I could not update my computer for more than a year. I searched for the cause of this and have been unsuccessful. Whenever I click search for updates, it gives me errors, and then I click on get help with errors and tried troubleshooting but have not been able to solve my problem. Lately, he has been interfering with the update or install new programs. Now I can't update my Itunes or Ipod. I can't upgrade to Windows 7. I can ' t use microsft word because everytime I try to install or update these things, it won't let me. I've been putting off not to worry so much about the updates, but they have reached a limit, when my computer became difficult to use. The error code is 80070424.

    Restore the system to factory settings.  Install applications from their media keys/serial numbers and product, that you put aside.  Restore your data from backup.

  • need help to update OSX version 10.8.5 MacBook; 2.9 GHz intel core 17, 8 GB 1600 MHZ; confuses greatly - I'm not technical

    need help to update OSX version 10.8.5 MacBook; 2.9 GHz intel core 17, 8 GB 1600 MHZ; confuses many - I'm technically phobic since getting warnings about the updates of other users.

    Here is how to upgrade to the latest version of OSX which is El Capitan.

    http://www.Apple.com/OSX/how-to-upgrade/?CID=WWA-us-KWG-Mac

  • I need help for the upgrade of my current system.

    I need help for the upgrade of my current system.

    I have SBS 2008 with (Exch 2007, SQL 2005, Sharepoint, backupexec 2010 for sbs) licenses.

    I want to make the larger environment using the following:

    (1) apply Virtualization

    (2) apply to the failover process (clustering)

    "(3) the environment must support adding server terminal server, ERP server, exchange server, domain controller, backup manager.

    Storage 4) that supports Raid (1 and 5)

    UTM excellent 6) that supports (SSL VPN, VPN Global)

    suitable backup solution 7)

    (8) good antivirus for clients

    my questions:

    (1) can you provide me with a good design for this environment

    (2) should I choose what operating system:

    Microsoft datacenter or company

    I know datacenter provide us the unlimited VM but needs per processor license

    so if I have two Grouped servers I want to buy 4 licenses

    and just 4 VMs per company license... to say that we have two servers and maintain 8 vms so wat happened if 1 goes down... How can I migrate the 4 virtual machines on the server failed to another server group... ? should I buy enterprise license?

    (3) if I get the SAN storage for data... How can I save this storage... should I get another SAN?

    (4) how can I upgrade SBS stad single server (windows standrad) without losing the licenses as Exch 2007, SQL 2005, sharepoint.is it a must to buy an edition full std server or there is a way to upgrade (license wise, I mean)?

    (5) what about win2k8 license for VM:

    lets say we have physical that has windows license so that enough to have windows for VM or should I buy windows for VM licenses?

    (6) can I use backExec license for SBS with windows 2008 standard

    (7) who better to virtualization AMD or INTEL

    (8) hyper V or VMware?

    (9) what of Microsoft data protection Manager... is this good?

    (10) what virtual machine manager? What are the benefites keys

    Thanks in advance

    Hello AnasAI,

    You can find the Server forums on TechNet support, please create a new post at the following link:

    http://social.technet.Microsoft.com/forums/en/category/WindowsServer/

  • I need help for activation of the real administrator account.

    I have a problem with Adobe reader 9 standard, Adobe customer service asked the unhide real administrator account before you can continue to help me.

    I need help for that.

    http://www.Vistax64.com/tutorials/67567-administrator-account.html

    http://www.howtogeek.com/HOWTO/Windows-Vista/enable-the-hidden-administrator-account-on-Windows-Vista/

    Read the above info.

    See you soon. Mick Murphy - Microsoft partner

  • I need help for my reader to USB drive on my windows 10 ACER?

    I need help for my reader to USB stick on my chrome windows 10 plug ins acer. Can you help me?

    What Adobe application that you use?

    This is the Adobe Media Encoder forum, and you did not mention anything on this subject. If you can let us know what Adobe application, you need help, we can help you make the right forum.

    Thank you

    Regalo

  • Hello, I need help for cancel the payment on my adobe account.

    Hello, I need help for cancel the payment on my adobe account. I'm from Peru, Im paying a monthly fee as a student. Help, please...

    Cancel your membership creative cloud

  • Hello, need help for Adobe Reader DC playing animation files that are specified in the pdf output by script Latex Beamer. My Adobe Reader DC refuse to open any format that I gave him.  Thank you very much

    Hello, need help for Adobe Reader DC playing animation files that are specified in the pdf output by script Latex Beamer. My Adobe Reader DC refuse to open any format that I gave him.  Thank you very much

    Hey ihorl18351266,

    Please note that you can open PDF files using only the CD player. Any other format will not be supported by the software.

    Kind regards

    Ana Maria

  • I need help, Photoshop update on creative cloud. It says error and will not tell me why I can not download

    I need help, Photoshop update on creative cloud. It says error and will not tell me why I can not download

    Hey King,

    Try to download the app from the link below:

    Direct download links of Adobe CC 2015: 2015 creative cloud release | ProDesignTools

    You can also view error download or update Adobe Creative Cloud applications

    Kind regards

    Sheena

  • I need help for my printer/scanner/copier to work with my computer

    I have a problem for my computer to connect with my printer/scanner/copier.  I need help!

    Hi GraceEverts,

    ·         What exactly happens when you try to connect printer/scanner/copier to work with my computer?

    ·         You receive an error message?

    ·         What is the brand and model of the printer/scanner/copier?

    I suggest to check the following items and check if it helps.

    To add a printer attached to your computer

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/sag_setup_indirect_printer.mspx?mfr=true

     

    To install new or updated printer drivers to update

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/print_drivers_install_updatew.mspx?mfr=true

     

    Resources for the resolution of the printer in Windows XP problems

    http://support.Microsoft.com/kb/308028

     

    Printer in Windows problems

    http://Windows.Microsoft.com/en-us/Windows/help/printer-problems-in-Windows

     

    To install a scanner or digital camera

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/scanner_camera_add.mspx?mfr=true

    Hope this information helps.

  • I Iconia Tab A500, running 3.0, need help for upgrade by using a microsd card, got Acer download update

    I Iconia Tab A500 running 3.0, need help update, I downloaded the entire updaes list in the supprt of acer, all versions, 3.0, 3.1, 3.2 and 4., I read on the acer support somewhere I can use a microSD card to update my device, as acer provides automatically, when I try it says 'poor network connection '. moving instead of anthoer. ", I have to update all the updates that are listed, or can I only update, using the 4. 0? to get the last known update. I also downloaded, 'Documents, applications, drivers, patches and O.S... How do I intsaller all these updates, I think that running the lowest version available, please help me... Thank you in advance.

    There are some instructions step by step on the site, but basically you check out the file "update.zip" download, copy to the root of a FAT32 formatted microSD card, then start in recovery mode (press one of the volume buttons [which it depends if you are landscape or portrait mode] and hold, then the power press and hold). From there, you can choose to update in the zip file it finds on the map.

    It is important before you have the correct version of the update, it's different for different regions of the world, and you will not be able to upgrade the (for example) Brazil version from the US site.

  • Need help for query flat_file type clobdata oracle table data.

    Hi Sir,

    I need help to query oracle table flat file data having given clob type.
    Oracle Version:
    
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE     10.2.0.1.0     Production"
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    
    
    Source table
    
      CREATE TABLE order_details 
       (     QUEUE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, 
         LINE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, 
         CHAR_DATA CLOB, 
         OPTIMISTIC_LOCK_KEY NUMBER(20,0)
       ) 
    COLUMN FOR CHAR_DATA FLAT_FILE
    EU,6067AT,AT10,000000402004,NexiumGERDManagementProject,Z435,,ZZ29,NIS-GOLD,AT
    EU,6067AT,AT10,000000402038,NIS-OEU-ARI-2007/1,Z450,,ZZ29,NIS-OEU-ARI-2007/1,AT
    EU,6067AT,AT10,000000402039,SymbicortNISinCOPD,Z450,,ZZ29,NIS-REU-DUM-2007/1,AT
    EU,6067AT,AT10,000000402040,D1443L00044SeroquelXRRuby,Z450,,ZZ29,D1443L00044,AT
    EU,6067AT,AT10,000000402041,NIS-GEU-DUM-2008/1,Z450,,ZZ29,NIS-GEU-DUM-2008/1,AT
    EU,6067AT,AT10,000000402042,SonstigeAktivitätenLCM,Z450,,ZZ29,.,AT
    EU,6067AT,AT10,000000402134,D1680L00002Saxagliptin,Z450,,ZZ29,D1680L00002,AT
    EU,6067AT,AT10,000000402199,SeroquelWaveNIS,Z450,,ZZ29,NIS-NEU-DUM-2009/1,AT
    EU,6067AT,AT10,000000402313,SeroquelExtra(D1443L00082),Z450,,ZZ29,D1443L00082,AT
    EU,6067AT,AT10,000000402517,AtlanticD5130L00006(AZD6140),Z450,,ZZ29,D5130L00006,AT
    EU,6067AT,AT10,000000554494,ArimidexSt.Gallen(13+2),Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554495,ArimidexASCO(5delegates),Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554496,ArimidexSanAntonio6delegates,Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554497,ArimidexBreastCancerSummit(13+2),Z130,,ZZ09,,AT
    EU,6067AT,AT10,000000554498,ArimidexEIH(15delegates),Z130,,ZZ09,,AT
    EU,6067AT,AT10,000000554499,ArimidexNIFA(200delegates),Z135,,ZZ09,,AT
    EU,6067AT,AT10,000000554500,ArimidexNIFAworkshops(8x25),Z135,,ZZ09,,AT
    EU,6067AT,AT10,000000554501,ArimidexPraktischeGyn.Fortbildung,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554502,ArimidexAGO,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554503,ArimidexHämato/OnkologieKongress,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554504,ARIMIDEXGYNäKOLOGENKONGRESS,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554505,ArimidexChirurgenkongress,Z147,,ZZ09,,AT
    EXPECTED RESULTS:
    AFFIRM_CODE COMPANY_CODE INTERNAL_ORDER_CODE INTERNAL_ORDER_DESC ENIGMA_ACTIVITY             SUB_ACTIVITY_CODE IN_AFF_IND ORDER_TYPE EXTERNAL_ORDER COUNTRY        
    EU          6067AT       AT10                 000000402004       NEXIUMGERDMANAGEMENTPROJECT     Z435           NULL        ZZ29       NIS-GOLD        AT             
    EU          6068AT       AT11                 000000402005       NEXIUMGERDMANAGEMENTPROJECT     Z435           NULL        ZZ29       NIS-GOLD        AT             

    Sorry, my bad. Without database at hand, I'll try 'baby steps' (borrowed from Frank) so you don't confuse it with errors that I might add (happens far too often already, but at least you won't "swallow" as forum members think is one of the main goals of this fighter - help her learn - providing not only the proverbial fish.)
    Search the Forum - your problem is one of its best sellers. Watching {message identifier: = 10694602} ("split string into" was the key word used in research) you can try something as

    select table_row,
           level clob_row,
           regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) the_line
      from (select to_char(queue_seqnum)||':'||to_char(line_seqnum) table_row,
                   char_data
              from order_details
           )
     connect by regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) is not null
            and prior char_data = char_data
            and prior table_row = table_row
            and prior sys_guid() is not null
    

    to get all the s the_lineall CLOB and after that the use of the example even to get your columns of each the_line.

    Concerning

    Etbin

    Edited by: Etbin on 3.2.2013 09:01

    .. .but I m connected to do things according to the instructions, I can't do something.

    Used to happen to me too and I did as told to the but only after explaining any disadvantages, I was aware of in time. The last sentence is usually: "O.K. now be just and Don't come back with that kind of thing when it turns out that this isn't the right thing."
    rp0428 post - something to remember.

Maybe you are looking for