Basic PL/SQL help - student

I'm a graduate student just learning to grasp PL/SQL. Does anyone have any links to suggested sample PL/SQL programs? I've been tasked to do some Oracle spatial intersection queries. I have most of the actual commands down but could use some help tieing them around the PL/SQL language.
Many thanks.

Best place is the documentation ...
For pl/sql :
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
All the best for your baby-steps in pl/sql.

Similar Messages

  • Some basic(perhaps) SQL help please

    TABLE: LOGOS
    ID           VARCHAR2(40) PRIMARY KEY
    TITLE        VARCHAR2(100)
    FILE_NAME    VARCHAR2(100)
    RESOLUTION   NUMBER(3)
    FILE_TYPE    VARCHAR2(5)
    DATA:
    ID       TITLE   FILE_NAME            RESOLUTION   FILE_TYPE
    1001     pic1    horizon_main.jpg     72           jpg
    1002     pic1    chief_diary.jpg      300          jpg
    1003     pic2    no_image.jpg         300          eps
    1004     pic3    publications.jpg     72           jpg
    1005     pic3    chase_car.jpg        300          jpg
    1006     pic4    top_img.jpg          72           jpg
    RESULT SET:
    ID       TITLE   FILE_NAME            RESOLUTION   FILE_TYPE   ID       TITLE   FILE_NAME            RESOLUTION   FILE_TYPE
    1001     pic1    horizon_main.jpg     72           jpg         1002     pic1    chief_diary.jpg      300          jpg
    1003     pic2    no_image.jpg         300          eps
    1004     pic3    publications.jpg     72           jpg         1005     pic3    chase_car.jpg        300          jpg
    1006     pic4    top_img.jpg          72           jpgHopefully you can see what I am trying to do here. Basically where there are multiple rows for a particular TITLE (e.g. "pic1") then they should be returned side by side. The problem I am having is duplicity, i.e. I get 2 rows for "pic1" like this:
    ID       TITLE   FILE_NAME            RESOLUTION   FILE_TYPE   ID       TITLE   FILE_NAME            RESOLUTION   FILE_TYPE
    1001     pic1    horizon_main.jpg     72           jpg         1002     pic1    chief_diary.jpg      300          jpg
    1002     pic1    chief_diary.jpg      300          jpg         1001     pic1    horizon_main.jpg     72           jpgIt looks like it should be simple by my SQL brain isn't back in gear after the festive period.

    Maybe a slight modification, to remove the juxtaposed value from being displayed again:
    test@ORA92>
    test@ORA92> select * from logos;
    ID         TITLE      FILE_NAME            RESOLUTION FILE_
    WU513      pic1       horizon_main.jpg             72 jpg
    AV367      pic1       chief_diary.jpg             300 jpg
    BX615      pic2       no_image.jpg                300 eps
    QI442      pic3       publications.jpg             72 jpg
    FS991      pic3       chase_car.jpg               300 jpg
    KA921      pic4       top_img.jpg                  72 jpg
    6 rows selected.
    test@ORA92>
    test@ORA92> SELECT a.ID AS aid, a.title AS attl, a.file_name AS afn, a.resolution AS ares,
      2         a.file_type aft, b.ID AS bid, b.title AS bttl, b.file_name AS bfn,
      3         b.resolution AS bres, b.file_type bft
      4    FROM logos a, logos b
      5   WHERE a.title = b.title(+) AND a.ROWID < b.ROWID(+)
      6  /
    AID        ATTL       AFN                        ARES AFT   BID        BTTL       BFN                     BRES BFT
    WU513      pic1       horizon_main.jpg             72 jpg   AV367      pic1       chief_diary.jpg          300 jpg
    AV367 pic1 chief_diary.jpg 300 jpg
    BX615      pic2       no_image.jpg                300 eps
    QI442      pic3       publications.jpg             72 jpg   FS991      pic3       chase_car.jpg            300 jpg
    FS991 pic3 chase_car.jpg 300 jpg
    KA921      pic4       top_img.jpg                  72 jpg
    6 rows selected.
    test@ORA92>
    test@ORA92>
    test@ORA92> SELECT aid, attl, afn, ares, aft, bid, bttl, bfn, bres, bft
      2    FROM (SELECT a.ID AS aid, a.title AS attl, a.file_name AS afn,
      3                 a.resolution AS ares, a.file_type aft, b.ID AS bid,
      4                 b.title AS bttl, b.file_name AS bfn, b.resolution AS bres,
      5                 b.file_type bft, LAG (b.ID) OVER (ORDER BY 1) AS prev_id
      6            FROM logos a, logos b
      7           WHERE a.title = b.title(+) AND a.ROWID < b.ROWID(+))
      8   WHERE (prev_id IS NULL OR prev_id <> aid)
      9  /
    AID        ATTL       AFN                        ARES AFT   BID        BTTL       BFN                     BRES BFT
    WU513      pic1       horizon_main.jpg             72 jpg   AV367      pic1       chief_diary.jpg          300 jpg
    BX615      pic2       no_image.jpg                300 eps
    QI442      pic3       publications.jpg             72 jpg   FS991      pic3       chase_car.jpg            300 jpg
    KA921      pic4       top_img.jpg                  72 jpg
    test@ORA92>
    test@ORA92>cheers,
    pratz

  • Need Help With Basics of SQL

    Hey I'm trying to get a working understanding of some of the basics behind SQL, I've composed a few questions that I think may help me with this. Anyone that can help me with any of them will greatly help me thanks.
    1. How to create synonym for tables?
    2. How to describe the structure of tables?
    3. How to list the contents of tables?
    4. How to create a table named with the same structure as another table?
    5. How to copy rows with less than a certain criteria in value (e.g. Price<$5.00) into another table?
    6. How to change the data type to e.g. NUMBER(6)?
    7. How to add a new column named with data type e.g. VARCHAR2(10)?
    8. How to change a specific field within a table (e.g. For ORDER_NUMBER 12489, change the C_NUMBER to 315)?
    9. How to delete a specific row from a table?
    10. How to declare a column as the primary key of a table and call it e.g. PK_something?
    11. How to show certain columns when another column is less than a certain criteria in value (e.g. Price<$5.00)?
    12. How to show certain columns with another column having a certain item class e.g. HW or AP?
    13. How to list certain columns when another column e.g. price is between two values?
    14. How to list certain columns when another column e.g. price is negative?
    15. How to use the IN operator to find certain columns (e.g. first and last name of customers who are serviced by a certain ID)
    16. How to find certain columns when one of the columns begins with a particular letter (e.g. A)
    18. How to list the contents of the a table sorted in ascending order of item class and, within each item class, sorted in descending order of e.g. price?
    19. How to do a count of column in a table?
    20. How to sum a column and make rename is something?
    21. How to do a count of a column in a table (without repeats e.g. if a certain number repeats more than once than to only count it once)?
    22. How to use a subquery to find certain fields in columns when the another column’s fields values are greater than e.g. its average price?

    848290 wrote:
    Hey I'm trying to get a working understanding of some of the basics behind SQL, I've composed a few questions that I think may help me with this. Anyone that can help me with any of them will greatly help me thanks.To use the terminology you have in those questions, you must already have a basic understanding of SQL, so you have exposed yourself as not being the author of such questions.
    Please do not ask homework questions without having at least attempted to answer them yourself first and show where you're struggling.

  • PIVOT sql help

    Hi again
    I need some PIVOT sql help
    In this query:
    SELECT
    SUM([RATES]) as RATES
    ,SUM([CONVERSION])as CONVERSION
    FROM REPORTING
    outputs
    RATES CONVERSION
    23 234
    How would change this query to display a table like:
    Name Amount
    RATES 23
    CONVERSION 234
    Keep up the good work !

    nikos101 wrote:
    > How would change this query to display a table like:
    Do you *HAVE* to change the query... you could just display
    it in the
    desired format if that it the ultimate and only goal.
    <table>
    <tr>
    <td>name</td>
    <td>amount</td>
    </tr>
    <cfoutput query="sumQry">
    <tr><td>Rates</td><td>#rates#</td></tr>
    <tr><td>Conversion</td><td>#conversion#</td></tr>
    </cfoutput>
    </table>

  • Basic PL/SQL parser usage?

    First off, I have to say that the documentation (what little there is) for the pl/SQL XML parser is absolutely terrible. I've figured out the bulk of it through trial and error, and some examples, but I'm stuck on something very basic. How do I get the actual value from a node?<br>
    How would I get "PROC_CODE_GUID5" from this node? <f>PROC_CODE_GUID_5</f>.<br> I try to use xmldom.getNodeValue(nodename), but it never returns any value.

    Frank,
    I'm sorry you had to go through the pains of figuring it out. I have been working with XML for a year now and have created a great website to help newcomers get started without the pain. The website is www.webspedite.com/oracle. Let me know what you think.
    Regards,
    Jason M Cohen

  • SQL Help: Derive "new" columns based on condition

    Hello all,
    Can someone please help me with this ? I am trying to achieve this in a SQL ( not PL/SQL), if it can be done in two different steps, even that is fine too...
    Thanks in advance,
    Chandu
    SELECT * FROM
    SELECT 2765 BTCH_ID,'payroll' BTCH_NM,'payroll~EUR~EUR~DE'NEW_BTCH_NM,'1234'TMPLT_ID FROM DUAL
    UNION
    SELECT 2765,'payroll','payroll~USD~USD~US','1235' FROM DUAL
    UNION
    SELECT 2765,'payroll','payroll~USD~USD~US','1236' FROM DUAL
    UNION
    SELECT 2765,'payroll','payroll~GBP~GBP~GB','1237' FROM DUAL
    UNION
    SELECT 2766,'SALARY','SALARY~USD~USD~US','1238' FROM DUAL
    UNION
    SELECT 2766,'SALARY','SALARY~USD~USD~US','1239' FROM DUAL
    ) T_BATCH;For a "Batch-id" there exists multiple Transactions which are denoted by ( cr_crncy_cd , dr_crncy_cd , recvr_cntry_cd), and "NEW_BTCH_NM" column is basically a concatenation of "BTCH_NM" + above 3 columns ( with a ~)
    I am trying to derive two new columns 'SEQ' & 'Output_Batch_name'
    SEQ column:
    For every batch_id, the first row will be assigned by sequence.nextval.
        For all transactions within BTCH_ID,
                       all the rows with same NEW_BTCH_NM, share the same sequence number
                        if different, then SEQ.nextval for all distinct rows
    Output_BTCH_NM:
       for a given batch_id,
             if the NEW_BTCH_NM is the same for all transactions ( batch_id 2766 in the below example) , 
                             then Output_BTCH_NM = BTCH_NM should be marked for All transactions which belong to this Batch_id,
            Else
                Output_BTCH_NM = New_BTCH_NM
         END if
    Expected OUTPUT
    *BTCH_ID     BTCH_NM             NEW_BTCH_NM          TMPLT_ID     SEQ         Output_BTCH_NM*
    2765       payroll                payroll~EUR~EUR~DE     1234         1          payroll~EUR~EUR~DE
    2765       payroll                payroll~GBP~GBP~GB     1237         2          payroll~GBP~GBP~GB
    2765       payroll                payroll~USD~USD~US     1235         3          payroll~USD~USD~US
    2765       payroll                payroll~USD~USD~US     1236         3          payroll~USD~USD~US
    2766       SALARY                SALARY~USD~USD~US     1238         4          SALARY
    2766       SALARY                SALARY~USD~USD~US     1239         4          SALARYEdited by: user10711957 on Sep 25, 2010 4:37 PM

    Can someone please help me with this ? I am trying to achieve this in a SQL ( not PL/SQL), if it can be done in two different steps, even that is fine too...
    Thanks in advance,
    Chandu
    SELECT * FROM
    SELECT 2765 BTCH_ID,'payroll' BTCH_NM,'payroll~EUR~EUR~DE'NEW_BTCH_NM,'1234'TMPLT_ID FROM DUAL
    UNION
    SELECT 2765,'payroll','payroll~USD~USD~US','1235' FROM DUAL
    UNION
    SELECT 2765,'payroll','payroll~USD~USD~US','1236' FROM DUAL
    UNION
    SELECT 2765,'payroll','payroll~GBP~GBP~GB','1237' FROM DUAL
    UNION
    SELECT 2766,'SALARY','SALARY~USD~USD~US','1238' FROM DUAL
    UNION
    SELECT 2766,'SALARY','SALARY~USD~USD~US','1239' FROM DUAL
    ) T_BATCH;For a "Batch-id" there exists multiple Transactions which are denoted by ( cr_crncy_cd , dr_crncy_cd , recvr_cntry_cd), and "NEW_BTCH_NM" column is basically a concatenation of "BTCH_NM" + above 3 columns ( with a ~)
    I am trying to derive two new columns 'SEQ' & 'Output_Batch_name'
    SEQ column:
    For every batch_id, the first row will be assigned by sequence.nextval.
        For all transactions within BTCH_ID,
                       all the rows with same NEW_BTCH_NM, share the same sequence number
                        if different, then SEQ.nextval for all distinct rows
    Output_BTCH_NM:
       for a given batch_id,
             if the NEW_BTCH_NM is the same for all transactions ( batch_id 2766 in the below example) , 
                             then Output_BTCH_NM = BTCH_NM should be marked for All transactions which belong to this Batch_id,
            Else
                Output_BTCH_NM = New_BTCH_NM
         END if
    Expected OUTPUT
    *BTCH_ID     BTCH_NM             NEW_BTCH_NM          TMPLT_ID     SEQ         Output_BTCH_NM*
    2765       payroll                payroll~EUR~EUR~DE     1234         1          payroll~EUR~EUR~DE
    2765       payroll                payroll~GBP~GBP~GB     1237         2          payroll~GBP~GBP~GB
    2765       payroll                payroll~USD~USD~US     1235         3          payroll~USD~USD~US
    2765       payroll                payroll~USD~USD~US     1236         3          payroll~USD~USD~US
    2766       SALARY                SALARY~USD~USD~US     1238         4          SALARY
    2766       SALARY                SALARY~USD~USD~US     1239         4          SALARY

  • Misc Basic PL/SQL Application Design/Programming Questions 101 (101.1)

    ---****** background for all these questions is at bottom of this post:
    Question 1:
    I read a little on the in and out parameters and that IN is "by reference" and OUT and IN-OUT are by value. To me "by reference" means "pointer" as in C programming. So it seems to me that I could call a function with an IN parameter and NOT put it on the right side of an assignment statement. In other words, I'm calling my function
    get_something(IN p_test1 varchar2) return varchar2;
    from SP1 which has a variable named V_TEST1.
    So.... can I do this? (method A):
    get_something(V_TEST1);
    or do I have to do this (method B):
    V_TEST1 := get_something(V_TEST1);
    Also, although this may muddy the thread (we'll see), it seems to me that IN, since its by reference, will always be more efficient. I will have many concurrent users using this program: should this affect my thinking on the above question?
    -- ******* background *******
    So Far:<< I've read and am reading all over the net, read and reading oracle books from oracle (have a full safari account), reading Feurstein's tome, have read the faq's here.
    Situation Bottom Line:<< Have an enormous amount to do in a very little time. Lots riding on this. Any and all pointers will be appreciated. After we get to some undetermined point I can re-do this venture as a pl/sql faq and submit it for posting (y'alls call). Some questions may be hare brained just because I'm freaking out a little bit.
    Situation (Long Version):<< Writing a pl/sql backend to MS Reporting Services front end. Just started doing pl/sql about 2 months ago. Took me forever to find out about ref-cursor as the pipe between oracle and all client applications. I have now created a package. I've been programming for 20 years in many languages, but brand new to pl/sql. However, pl/sql sql has freed me from myriad of limitations in MS RS's. My program is starting to get big (for me -- I do a lot in a little) pks is currently 900 lines with 15 functions so far. Currently SP (pls) is back up to 800 lines. I get stuff working in the sp then turn it into a function and move it to the package.
    What does application do?:<<<< Back End for MS Reporting Services Web front end. It will be a very controlled "ad-hoc" (or the illusion of ad-hoc) web interface. All sql queries are built at run-time and executed via "open ref cusor for -- sql statement -- end;" data returned via OUT ref_cursor. Goal is to have almost 100% of functionality in a package. Calling SP will be minimalist. Reporting Services calls the SP, passes X number of parameters, and gets the ref_cursor back.
    Oracle Version: 10.2 (moving to 11g in the next 3 months).Environment: Huge DW in a massively shared environment. Everything is locked down and requires a formal request. I had to have my authenticated for a couple dbms system packages just to starting simple pl/sql programs.

    Brad Bueche wrote:
    Question 1:
    I read a little on the in and out parameters and that IN is "by reference" and OUT and IN-OUT are by value. To me "by reference" means "pointer" as in C programming. So it seems to me that I could call a function with an IN parameter and NOT put it on the right side of an assignment statement. The IN parameter is not passing by reference. It is passing by value. This means variable/value of the caller used as parameter, is copied to the (pushed) stack of code unit called.
    An OUT parameter means that the value is copied from the called unit's stack to the caller (and the current value of the caller's variable is overwritten).
    To pass by reference, the NOCOPY clause need to be used. Note that is not an explicit compile instruction. The PL/SQL engine could very well decide to pass by value and not reference instead (depending on the data type used).
    Note that the ref cursor data type and the LOB data types are already pointers. In which case these are not passed reference as they are already references.
    The NOCOPY clause only make sense for large varchar2 variables (these can be up to 32KB in PL/SQL) and for collection/array data type variables.
    As for optimising PL/SQL code - there are a number of approaches (and not just passing by reference). Deterministic functions can be defined. PL/SQL code can be written (as pipelined tables) to run in parallel using the default Oracle Parallel Query feature. PL/SQL can be manually parallelised. Context switches to the SQL engine can be minimised using bulk processing. Etc.
    Much of the performance will however come down to 2 basic issues. How well the data structures being processed are designed. How well the code itself is modularised and written.

  • Installer failed to initialize... unable to install CS 5.5 - PLEASE HELP Student in finals week!

    Problem:  “Installer failed to initialize.  Please download Adobe Support Advisor to detect the problem”
    Background:  Windows 8 became corrupt and I had to perform a full Windows Recovery (the “Remove everything and reinstall Windows” type).
    Current Situation:  I am a Senior in College, have Summer finals this week, my Senior project due, I am behind on my job design work, and I am going crazy because I can’t find anything/anyone to help me.
    Set Up:  Lenovo Y410P, Windows 8.1, CS 5.5 Design Standard Student-Teacher Edition (Yes, I have the media and product code/license key, as I purchased a valid copy in my university student store).
    Here’s what I have done over and over again for the last SIX WEEKS!
    1. Attempts to install from the original install DVD result in the following error, “Installer failed to initialize.  Please download Adobe Support Advisor to detect the problem”
    2. [I click] Get “Adobe Support Advisor”
    3. [I see mssg] The Adobe Support Advisor has been discontinued.. The tool has been replaced with [unnamed/unlinked] improved installation support mechanisms…
    4. [I Run] “AdobeCreativeCloudCleanerTool” (see results below)
    Note:  I cannot run Windows Uninstall because, following Windows Restore, Windows doesn’t recognize that CS5.5 has been installed.  I do still see the following folders in Windows explorer, but Adobe Support says "don't attempt to manually remove folders";
          C:\Program Files (x86)\Common Files\Adobe\
               \Adobe
               \Adobe PCD
               \Adobe Photoshop CS5.1
               \Adobe Application Manager
               \Adobe CerativeCloudCleaner Tool
               \backup…
    [Contents of]  Adobe Creative Cloud Cleaner Tool .txt
    [Fri Jul 11 22:50:30 2014] ---------------------------------------------------------
    [Mon Aug 04 22:58:11 2014] ---------------------------------------------------------
    [Mon Aug 04 22:58:11 2014] *=*=*=*=*=*=*=*=* :: Start Session :: *=*=*=*=*=*=*=*=*=*
    [Mon Aug 04 22:58:11 2014] ---------------------------------------------------------
    [Mon Aug 04 22:58:11 2014] Win OS Version: 6.2
    [Mon Aug 04 22:58:11 2014] Cleaner Tool version                              : 2.0.0.0
    [Mon Aug 04 22:58:11 2014] Cleanup source directory     : C:\Program Files (x86)\Common Files\Adobe\AdobeCreativeCloudCleanerTool
    [Mon Aug 04 22:58:11 2014] [AdobeProgramFiles]                            : C:\Program Files (x86)\Adobe
    [Mon Aug 04 22:58:11 2014] [AdobeProgramFiles_x64]  : C:\Program Files\Adobe
    [Mon Aug 04 22:58:11 2014] [AdobeCommon]                                    : C:\Program Files (x86)\Common Files\Adobe
    [Mon Aug 04 22:58:11 2014] [AdobeCommon_x64]                          : C:\Program Files\Common Files\Adobe
    [Mon Aug 04 22:58:11 2014] [UserRoamingAppData]                       : C:\Users\Kaylene\AppData\Roaming
    [Mon Aug 04 22:58:11 2014] [UserLocalAppData]                               : C:\Users\Kaylene\AppData\Local
    [Mon Aug 04 22:58:11 2014] [StartMenu]                                                              : C:\ProgramData\Microsoft\Windows\Start Menu\Programs
    [Mon Aug 04 22:58:11 2014] [System32Folder]                                   : C:\WINDOWS\system32
    [Mon Aug 04 22:58:11 2014] [SharedApplicationData]      : C:\ProgramData
    [Mon Aug 04 22:58:32 2014] ---------------------------------------------------------
    [Mon Aug 04 22:58:32 2014] *=*=*=*=*=*=*=*=* :: Start Session :: *=*=*=*=*=*=*=*=*=*
    [Mon Aug 04 22:58:32 2014] ---------------------------------------------------------
    [Mon Aug 04 22:58:32 2014] Win OS Version: 6.2
    [Mon Aug 04 22:58:32 2014] Cleaner Tool version                              : 2.0.0.0
    [Mon Aug 04 22:58:32 2014] Cleanup source directory     : C:\Program Files (x86)\Common Files\Adobe\AdobeCreativeCloudCleanerTool
    [Mon Aug 04 22:58:32 2014] [AdobeProgramFiles]                            : C:\Program Files (x86)\Adobe
    [Mon Aug 04 22:58:32 2014] [AdobeProgramFiles_x64]  : C:\Program Files\Adobe
    [Mon Aug 04 22:58:32 2014] [AdobeCommon]                                    : C:\Program Files (x86)\Common Files\Adobe
    [Mon Aug 04 22:58:32 2014] [AdobeCommon_x64]                          : C:\Program Files\Common Files\Adobe
    [Mon Aug 04 22:58:32 2014] [UserRoamingAppData]                       : C:\Users\Kaylene\AppData\Roaming
    [Mon Aug 04 22:58:32 2014] [UserLocalAppData]                               : C:\Users\Kaylene\AppData\Local
    [Mon Aug 04 22:58:32 2014] [StartMenu]                                                              : C:\ProgramData\Microsoft\Windows\Start Menu\Programs
    [Mon Aug 04 22:58:32 2014] [System32Folder]                                   : C:\WINDOWS\system32
    [Mon Aug 04 22:58:32 2014] [SharedApplicationData]      : C:\ProgramData
    [Mon Aug 04 22:58:45 2014] Language selected: English
    [Mon Aug 04 22:58:45 2014] Displaying the Adobe End User License Agreement
    Gen_WWCombined-en_US-20121017_1230
    [Mon Aug 04 22:58:45 2014] Please enter (y) for Yes or (n) for No. ... >>
    [Mon Aug 04 22:59:12 2014] Choose from one of the following options to clean up :
    [Mon Aug 04 22:59:12 2014] 1. All
    [Mon Aug 04 22:59:12 2014] 2. Adobe Flash Player 10.2
    [Mon Aug 04 22:59:12 2014] 3. Creative Cloud 2014 , Creative Cloud & CS6 Products
    [Mon Aug 04 22:59:12 2014] 4. Creative Cloud 2014 only
    [Mon Aug 04 22:59:12 2014] 5. Creative Cloud only
    [Mon Aug 04 22:59:12 2014] 6. CS6 only
    [Mon Aug 04 22:59:12 2014] 7. CS5-CS5.5-CS6
    [Mon Aug 04 22:59:12 2014] 8. CS5-CS5.5
    [Mon Aug 04 22:59:12 2014] 9. CS3, CS4
    [Mon Aug 04 22:59:12 2014] 10. Adobe Id credentials
    [Mon Aug 04 22:59:12 2014] 11. Quit
    [Mon Aug 04 22:59:12 2014] Choice :>
    [Mon Aug 04 22:59:32 2014] User selected: CS5-CS5.5
    [Mon Aug 04 22:59:32 2014] Executed the command : call copy /Y "C:\Program Files (x86)\Common Files\Adobe\caps\pdb.db" "C:\Program Files (x86)\Common Files\Adobe\backup20140804T225932\pdb.db"
    [Mon Aug 04 22:59:32 2014] Executed the command : call copy /Y "C:\Program Files (x86)\Common Files\Adobe\caps\Media_db.db" "C:\Program Files (x86)\Common Files\Adobe\backup20140804T225932\Media_db.db"
    [Mon Aug 04 22:59:32 2014] DB does not exist at: C:\Program Files (x86)\Common Files\Adobe\caps\pdb.db
    [Mon Aug 04 22:59:32 2014] DB does not exist at: C:\Program Files (x86)\Common Files\Adobe\caps\Media_db.db
    [Mon Aug 04 22:59:32 2014] List of products installed on this machine
    [Mon Aug 04 22:59:32 2014] Listing products for cleanup:
    [Mon Aug 04 22:59:32 2014] Please enter the option number of the product you wish to remove; enter (q) to quit ... >>
    [Mon Aug 04 22:59:50 2014] response 1
    [Mon Aug 04 22:59:50 2014] Are you sure you want to clean all the listed products and associated files?
    [Mon Aug 04 22:59:50 2014] Type (y) to confirm and remove or (n) to quit ... >>
    [Mon Aug 04 22:59:55 2014] Please wait for Adobe Creative Cloud Cleaner Tool to finish........
    [Mon Aug 04 22:59:55 2014] User selected: 'Clean All'
    [Mon Aug 04 22:59:55 2014] *-*-*-*-*-*-* Start removing product : ALL *-*-*-*-*-*-*
    [Mon Aug 04 22:59:55 2014] *-*-*-*-*-*-* Finished removing product : ALL *-*-*-*-*-*-*
    [Mon Aug 04 22:59:55 2014] Action : Created the C:\Program Files (x86)\Common Files\Adobe\backup20140804T225932 folder as backup of PDB and MediaDB for this session.
    [Mon Aug 04 22:59:55 2014] LOG FILE SAVED TO: C:\Users\Kaylene\AppData\Local\Temp\Adobe Creative Cloud Cleaner Tool.log
    [Mon Aug 04 22:59:55 2014] Adobe Creative Cloud Cleaner Tool completed successfully
    [Mon Aug 04 22:59:55 2014]
    [Mon Aug 04 22:59:55 2014] *-*-*-*-*-*- ::START:: - SUMMARY OF Warnings -*-*-*-*-*-*
    [Mon Aug 04 22:59:32 2014] DB does not exist at: C:\Program Files (x86)\Common Files\Adobe\caps\pdb.db
    [Mon Aug 04 22:59:32 2014] DB does not exist at: C:\Program Files (x86)\Common Files\Adobe\caps\Media_db.db
    [Mon Aug 04 22:59:55 2014] *-*-*-*-*-*- :: END :: - SUMMARY OF Warnings -*-*-*-*-*-*
    [Mon Aug 04 22:59:55 2014] ---------------------------------------------------------
    [Mon Aug 04 22:59:55 2014] *=*=*=*=*=*=*=*=* :: End Session :: *=*=*=*=*=*=*=*=*=*=*
    [Mon Aug 04 22:59:55 2014] ---------------------------------------------------------

    \Users\[user name]\AppData\Local\Temp\ PDApp .log  file contents  (Here it is, not sure what to do with it, do you?)...
    8/4/2014 22:47:03 [INFO] Setup - Build Version - 2.0.242.0
    8/4/2014 22:47:03 [INFO] Setup - Logging Level verbosity Set  to 4
    8/4/2014 22:47:03 [INFO] Setup - Start Adobe Setup
    8/4/2014 22:47:03 [INFO] Setup - TimeLog: Bootstrapper Start
    8/4/2014 22:47:03 [INFO] Setup - TimeLog: Start initial checks
    8/4/2014 22:47:04 [INFO] Setup - Dictionary Path: E:\Adobe CS5_5\resources\Dictionary\en_US\stringTable.zdct
    8/4/2014 22:47:06 [INFO] PIM - Trying to access xml at path:E:\Adobe CS5_5\resources\setup.xml
    8/4/2014 22:47:07 [INFO] PIM - XML is valid
    8/4/2014 22:47:07 [WARN] PIM - Failed to find Node
    8/4/2014 22:47:07 [INFO] Setup - Found 3 packages in setup manifest
    8/4/2014 22:47:07 [INFO] PIM - Build Version - 2.0.242.0
    8/4/2014 22:47:07 [INFO] PIM - Logging Level verbosity Set  to 4
    8/4/2014 22:47:07 [INFO] Utilities - Folder does not exist
    8/4/2014 22:47:07 [INFO] PIM - Build Version - 2.0.242.0
    8/4/2014 22:47:07 [INFO] PIM - Logging Level verbosity Set  to 4
    8/4/2014 22:47:07 [INFO] PIM - CREATE PIM Instance ...
    8/4/2014 22:47:08 [INFO] Utilities - File does not exist
    8/4/2014 22:47:08 [INFO] Utilities - File does not exist
    8/4/2014 22:47:08 [INFO] PIM - trying to createOrUpdatePIMDbSchema.
    8/4/2014 22:47:09 [INFO] PIM - SUCCESS Created Tables.
    8/4/2014 22:47:09 [INFO] PIM - PIM Database is Up To Date.
    8/4/2014 22:47:09 [INFO] PIM - Updater Inventory location:E:\Adobe CS5_5\resources\updaterinventory.dll
    8/4/2014 22:47:09 [INFO] PIM - trying to createOrUpdatePIMDbSchema.
    8/4/2014 22:47:09 [INFO] PIM - Current db schema version on machine 1.
    8/4/2014 22:47:09 [INFO] PIM - Current db schema version to install 1.
    8/4/2014 22:47:09 [INFO] PIM - PIM DB Schema is up to date. Current schema version is 1.
    8/4/2014 22:47:09 [INFO] PIM - PIM Database is Up To Date.
    8/4/2014 22:47:09 [INFO] PIM - Trying to access xml at path:E:\Adobe CS5_5\packages\core\PDApp.pimx
    8/4/2014 22:47:09 [INFO] PIM - XML is valid
    8/4/2014 22:47:09 [WARN] PIM - Failed to find Node
    8/4/2014 22:47:10 [INFO] PIM - PackageCheck: Package id E09D47A9-4501-43C1-A50B-E264DB5E498D is a old Package, new is installed on the system. Size required: 924792
    8/4/2014 22:47:10 [INFO] PIM - Trying to access xml at path:E:\Adobe CS5_5\packages\UWA\UWA.pimx
    8/4/2014 22:47:10 [INFO] PIM - XML is valid
    8/4/2014 22:47:10 [WARN] PIM - Failed to find Node
    8/4/2014 22:47:10 [INFO] PIM - PackageCheck: Package id CC1D48BA-E659-42D4-9511-F208F19C3EDC is a old Package, new is installed on the system. Size required: 2335009
    8/4/2014 22:47:10 [INFO] PIM - Trying to access xml at path:E:\Adobe CS5_5\packages\DWA\DWA.pimx
    8/4/2014 22:47:10 [INFO] PIM - XML is valid
    8/4/2014 22:47:10 [WARN] PIM - Failed to find Node
    8/4/2014 22:47:10 [INFO] PIM - PackageCheck: Package id 4F576A64-1680-4E79-B4A2-CFAC1A841C06 is a old Package, new is installed on the system. Size required: 3525373
    8/4/2014 22:47:10 [INFO] PIM - Trying to access xml at path:E:\Adobe CS5_5\packages\LWA\LWA.pimx
    8/4/2014 22:47:11 [INFO] PIM - XML is valid
    8/4/2014 22:47:11 [WARN] PIM - Failed to find Node
    8/4/2014 22:47:11 [INFO] PIM - PackageCheck: Package id D2E20EE6-5E36-40A4-8CB2-EC0C2E0B6912 is a old Package, new is installed on the system. Size required: 6359429
    8/4/2014 22:47:11 [INFO] PIM - PackageCheck: Extra Package id CEF79D2D-B768-4000-890A-749307FC1A88 found in ACF. Size required: 2716397
    8/4/2014 22:47:11 [INFO] PIM - PackageCheck: Extra Package id CF544A33-B3C5-41EB-9A35-FF71EF87BD9D found in ACF. Size required: 237125
    8/4/2014 22:47:11 [INFO] PIM - PackageCheck: Extra Package id E4D5C1B1-86EE-4912-BC83-DCF49C6DA758 found in ACF. Size required: 5275810
    8/4/2014 22:47:11 [INFO] PIM - PackageCheck: Extra Package id 678DA613-34E3-4532-B6D4-E2C1D3D44A22 found in ACF. Size required: 6006309
    8/4/2014 22:47:11 [INFO] PIM - PackageCheck: Extra Package id EC6B3460-5E27-4FD6-80F5-1EA03E45A6DA found in ACF. Size required: 5110
    8/4/2014 22:47:11 [INFO] PIM - pim_haveEnoughDiskSpaceToInstallPackages reqSize ... 30123889
    8/4/2014 22:47:11 [INFO] Setup - TimeLog: End initial checks
    8/4/2014 22:47:11 [INFO] Setup - TimeLog: Begin Installing
    8/4/2014 22:47:11 [INFO] Setup - Start Installing core package - E:\Adobe CS5_5\packages\core\PDApp.pimx
    8/4/2014 22:47:11 [INFO] PIM - START installPackage at file E:\Adobe CS5_5\packages\core\PDApp.pimx
    8/4/2014 22:47:11 [INFO] PIM - Trying to access xml at path:E:\Adobe CS5_5\packages\core\PDApp.pimx
    8/4/2014 22:47:11 [INFO] PIM - XML is valid
    8/4/2014 22:47:11 [WARN] PIM - Failed to find Node
    8/4/2014 22:47:11 [INFO] PIM - srcPath :C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\/core/ destPath :C:\Users\Kaylene\AppData\Local\Adobe\OOBE\PDApp/core/
    8/4/2014 22:47:11 [INFO] PIM - Function :copyPrimitive
    8/4/2014 22:47:11 [INFO] Setup - Finished Installing core package - E:\Adobe CS5_5\packages\core\PDApp.pimx, Return status: 0
    8/4/2014 22:47:11 [INFO] Setup - Start Installing package - E:\Adobe CS5_5\packages\UWA\UWA.pimx
    8/4/2014 22:47:11 [INFO] PIM - START installPackage at file E:\Adobe CS5_5\packages\UWA\UWA.pimx
    8/4/2014 22:47:11 [INFO] PIM - Trying to access xml at path:E:\Adobe CS5_5\packages\UWA\UWA.pimx
    8/4/2014 22:47:11 [INFO] PIM - XML is valid
    8/4/2014 22:47:11 [WARN] PIM - Failed to find Node
    8/4/2014 22:47:11 [INFO] PIM - srcPath :C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\/UWA/ destPath :C:\Users\Kaylene\AppData\Local\Adobe\OOBE\PDApp/UWA/
    8/4/2014 22:47:11 [INFO] PIM - Function :copyPrimitive
    8/4/2014 22:47:12 [INFO] Setup - Finished Installing package - E:\Adobe CS5_5\packages\UWA\UWA.pimx
    8/4/2014 22:47:12 [INFO] Setup - Start Installing package - E:\Adobe CS5_5\packages\DWA\DWA.pimx
    8/4/2014 22:47:12 [INFO] PIM - START installPackage at file E:\Adobe CS5_5\packages\DWA\DWA.pimx
    8/4/2014 22:47:12 [INFO] PIM - Trying to access xml at path:E:\Adobe CS5_5\packages\DWA\DWA.pimx
    8/4/2014 22:47:12 [INFO] PIM - XML is valid
    8/4/2014 22:47:12 [WARN] PIM - Failed to find Node
    8/4/2014 22:47:12 [INFO] PIM - srcPath :C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\/DWA/ destPath :C:\Users\Kaylene\AppData\Local\Adobe\OOBE\PDApp/DWA/
    8/4/2014 22:47:12 [INFO] PIM - Function :copyPrimitive
    8/4/2014 22:47:12 [INFO] Setup - Finished Installing package - E:\Adobe CS5_5\packages\DWA\DWA.pimx
    8/4/2014 22:47:12 [INFO] Setup - Start Installing package - E:\Adobe CS5_5\packages\LWA\LWA.pimx
    8/4/2014 22:47:12 [INFO] PIM - START installPackage at file E:\Adobe CS5_5\packages\LWA\LWA.pimx
    8/4/2014 22:47:12 [INFO] PIM - Trying to access xml at path:E:\Adobe CS5_5\packages\LWA\LWA.pimx
    8/4/2014 22:47:12 [INFO] PIM - XML is valid
    8/4/2014 22:47:12 [WARN] PIM - Failed to find Node
    8/4/2014 22:47:12 [INFO] PIM - srcPath :C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\/LWA/ destPath :C:\Users\Kaylene\AppData\Local\Adobe\OOBE\PDApp/LWA/
    8/4/2014 22:47:12 [INFO] PIM - Function :copyPrimitive
    8/4/2014 22:47:14 [INFO] Setup - Finished Installing package - E:\Adobe CS5_5\packages\LWA\LWA.pimx
    8/4/2014 22:47:14 [INFO] PIM - srcPath :C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\/P7/ destPath :C:\Users\Kaylene\AppData\Local\Adobe\OOBE\PDApp/P7/
    8/4/2014 22:47:14 [INFO] PIM - Function :copyPrimitive
    8/4/2014 22:47:16 [INFO] PIM - srcPath :C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\/D6/ destPath :C:\Users\Kaylene\AppData\Local\Adobe\OOBE\PDApp/D6/
    8/4/2014 22:47:16 [INFO] PIM - Function :copyPrimitive
    8/4/2014 22:47:16 [INFO] PIM - srcPath :C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\/DECore/ destPath :C:\Users\Kaylene\AppData\Local\Adobe\OOBE\PDApp/DECore/
    8/4/2014 22:47:16 [INFO] PIM - Function :copyPrimitive
    8/4/2014 22:47:17 [INFO] PIM - srcPath :C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\/P6/ destPath :C:\Users\Kaylene\AppData\Local\Adobe\OOBE\PDApp/P6/
    8/4/2014 22:47:17 [INFO] PIM - Function :copyPrimitive
    8/4/2014 22:47:19 [INFO] PIM - srcPath :C:\Program Files (x86)\Common Files\Adobe\OOBE\PDApp\/IPC/ destPath :C:\Users\Kaylene\AppData\Local\Adobe\OOBE\PDApp/IPC/
    8/4/2014 22:47:19 [INFO] PIM - Function :copyPrimitive
    8/4/2014 22:47:19 [INFO] Utilities - File does not exist
    8/4/2014 22:47:20 [INFO] Setup - TimeLog: End Installing. Now launching PDApp
    8/4/2014 22:47:21 [FATAL] Setup - Adobe Application Manager executable does not exist at the location: C:\Users\Kaylene\AppData\Local\Adobe\OOBE\PDApp\core\PDApp.exe
    8/4/2014 22:47:21 [FATAL] Setup - Unable to launch PDApp. File missing
    8/4/2014 22:57:44 [INFO] PIM - PIMSqlite closeDB status 0
    8/4/2014 22:57:44 [INFO] PIM - PIMSqlite closeDB status 0
    8/4/2014 22:57:44 [INFO] PIM - FREE PIM Instance ...
    8/4/2014 22:57:44 [INFO] Setup - cleanUSF: Deleting Path C:\Users\Kaylene\AppData\Local\Adobe\OOBE\PDApp
    8/4/2014 22:57:44 [INFO] Setup - Setting current directory to C:\Users\Kaylene\AppData\Local\Adobe\OOBE
    8/4/2014 22:57:44 [ERROR] Setup - Error in deleting folder C:\Users\Kaylene\AppData\Local\Adobe. Error Code:145
    8/4/2014 22:57:44 [INFO] Setup - End Adobe Setup. Exit code: 1

  • XML - PL/SQL help

    Hello,
    I am having a query as a part of my procedure block that extracts the following xml and stores it into a variable that is of xmltype:
    <FeatureRoot>
    <Feature>
    <FeatureName>qaz</FeatureName>
    <FeatureAction>Add</FeatureName>
    </Feature>
    <Feature>
    <FeatureName>wsx</FeatureName>
    <FeatureAction>Remove</FeatureAction>
    </Feature>
    </FeatureRoot>
    Now what i want to do is loop through this variable (which is of xmltype) and print the values of the tags <FeatureName> and <FeatureAction> for every Feature.
    (ie)
    qaz Add
    wsx Remove
    Can you please tell me how i can loop through to extract the values?
    Many Thanks,
    Kalyani

    user11912174 wrote:
    Hello,
    Thank you. The solutions may hold good on a normal context. What my problem is I want to run a loop through an anonymous block in pl/sql where I am already using a cursor where each record contains an xml value as above. So i need to be extracting for each run in a cursor. So i need to be extracting the <FeatureName> and <featureaction> values in each cursor run. Any help on this?
    ThanksCan you not incorporate it as part of the cursor itself?
    It can return the values as part of the data from the cursor rather than using PL/SQL extracts on the XML to do it.
    SQL> ed
    Wrote file afiedt.buf
      1  with myxml as
      2    (select xmltype('<FeatureRoot>
      3                       <Feature>
      4                         <FeatureName>qaz</FeatureName>
      5                         <FeatureAction>Add</FeatureAction>
      6                       </Feature>
      7                       <Feature>
      8                         <FeatureName>wsx</FeatureName>
      9                         <FeatureAction>Remove</FeatureAction>
    10                       </Feature>
    11                     </FeatureRoot>') myxml from dual union all
    12     select xmltype('<FeatureRoot>
    13                       <Feature>
    14                         <FeatureName>aaa</FeatureName>
    15                         <FeatureAction>Add</FeatureAction>
    16                       </Feature>
    17                       <Feature>
    18                         <FeatureName>bbb</FeatureName>
    19                         <FeatureAction>Remove</FeatureAction>
    20                       </Feature>
    21                     </FeatureRoot>') from dual)
    22  select extractvalue(VALUE(t),'/Feature/FeatureName') featurename
    23  ,      extractvalue(VALUE(t),'/Feature/FeatureAction') featureaction
    24  from   myxml x
    25* ,      table(xmlsequence(extract(x.myxml,'/FeatureRoot/Feature'))) t
    SQL> /
    FEATURENAME     FEATUREACTION
    qaz             Add
    wsx             Remove
    aaa             Add
    bbb             Remove
    SQL>

  • Some SQL Help for a Complete Beginner

    ...........

    Use ROLLUP then
    SQL> select id,
      2         case when grouping(id)=1 and grouping(pro_name)=1 then 'Total' else pro_name end pro_name
      3         sum(quantity) quantity
      4    from product
      5   group by rollup(id, pro_name)
      6  having (grouping(id)=0 and grouping(pro_name)=0)
      7      or (grouping(id)=1 and grouping(pro_name)=1)
      8  /
    ID    PRO_NAME               QUANTITY
    11011 Socket Type 3                20
    11110 Wrench Type 2                44
    11111 Bolt Type 1                  40
    22022 Hammer                       30
    22220 Wrench Type 3                44
    22222 Bolt Type 2                  40
    33330 Wrench Type 4                44
    33333 Bolt Type 3                  40
    44440 Nut Type 1                   80
    44444 Bolt Type 4                  40
    55550 Nut Type 2                   80
    55555 Nail Type 1                 400
    66660 Nut Type 3                   80
    66666 Nail Type 2                 400
    77770 Nut Type 4                   80
    77777 Nail Type 3                 400
    88880 Socket Type 1                20
    88888 Nail Type 4                 400
    99990 Socket Type 2                20
    99999 Wrench Type 1                44
          Total                      2346
    21 rows selected.Your price field is CHAR data type. You cant use it with quantity field which is a NUMBER data type.
    The basic structure of your table is wrong you need to modify it.
    Edited by: Karthick_Arp on May 8, 2009 11:47 PM

  • Complex SQL help for a

    I do not know if this is the right place for thius type of post. If it is not please advise where the right place is.
    I need help generating a report, hopefully with SQL in 8.1.7
    SQL Statement which produced the data below the query :
    SELECT CHANGE.change_number, CHANGE.route_date as DATE_TO_CCB, nodetable.description AS Approver_required, (TRIM(BOTH ',' FROM CHANGE.PRODUCT_LINES)) AS PRODUCT_LINES /*, PROPERTYTABLE.VALUE as PRODUCT_LINES */
    FROM CHANGE, signoff, workflow_process, nodetable /*, PROPERTYTABLE */
    WHERE ( (CHANGE.ID = signoff.change_id)
    AND (CHANGE.process_id = signoff.process_id)
    AND ((nodetable.id = signoff.user_assigned) or (nodetable.id=signoff.user_signed))
    AND (CHANGE.process_id = workflow_process.ID)
    AND (CHANGE.ID = workflow_process.change_id)
    AND (CHANGE.workflow_id = workflow_process.workflow_id)
    AND (SIGNOFF.SIGNOFF_STATUS=0 )/* in (0, 2, 3)) */ /* 0=request needs attention, 2=request approved, 3=request rejected */
    AND (SIGNOFF.REQUIRED=5 or SIGNOFF.REQUIRED=1) /* 1=Approver 5= Ad Hoc Approver */
    AND (CHANGE.IN_REVIEW=1)
    AND (CHANGE.RELEASE_DATE IS NULL)
    AND (CHANGE.CLASS != '4928')
    /* AND (PROPERTYTABLE.PROPERTYID IN (SELECT TRIM(BOTH ',' FROM CHANGE.PRODUCT_LINES) FROM CHANGE)) */
    order by change.route_date desc
    **** Results **********
    CHANGE_NUMBER|DATE_TO_CCB|APPROVER_REQUIRED|PRODUCT_LINES
    C02190|11/14/2008 3:34:02 PM|Anurag Upadhyay|270354,270362|
    C02190|11/14/2008 3:34:02 PM|Dennis McGuire|270354,270362|
    C02190|11/14/2008 3:34:02 PM|Hamid Khazaei|270354,270362|
    C02190|11/14/2008 3:34:02 PM|Mandy York|270354,270362|
    C02193|11/14/2008 3:05:18 PM|Hamid Khazaei|274279,266339,266340,266341|
    C02193|11/14/2008 3:05:18 PM|Rob Brogle|274279,266339,266340,266341|
    C02193|11/14/2008 3:05:18 PM|Xavier Otazo|274279,266339,266340,266341|
    C02193|11/14/2008 3:05:18 PM|san|274279,266339,266340,266341|
    C02194|11/14/2008 2:51:34 PM|Diana Young|271503|
    C02194|11/14/2008 2:51:34 PM|Carl Krentz|271503|
    C02194|11/14/2008 2:51:34 PM|Dennis Yen|271503|
    C02194|11/14/2008 2:51:34 PM|Gordon Ries|271503|
    C02194|11/14/2008 2:51:34 PM|Sunil Khatana|271503|
    M00532|11/13/2008 1:34:42 PM|Dennis Yen|270356,270354,270360,274279,266339,266340,266341,276780,260784|
    M00532|11/13/2008 1:34:42 PM|Jin Hong|270356,270354,270360,274279,266339,266340,266341,276780,260784|
    M00532|11/13/2008 1:34:42 PM|Sunil Khatana|270356,270354,270360,274279,266339,266340,266341,276780,260784|
    Each value in the numeric comma delimited string has a corresponding ID for the actual test string value in another table as shown below.
    PROPERTYID|VALUE
    260775|product 1
    260776|Product 2
    260777|Product x
    260778|Product y
    260779|Internal
    260780|ORCA
    260781|Tiger
    260782|Orange product
    260783|Restricted
    260784|Product zz
    266259|Product YYY
    266260|Hercules
    266261|Tangerine
    *****Desired output****
    CHANGE_NUMBER|DATE_TO_CCB|APPROVER_REQUIRED|PRODUCT_LINES
    C02190|Nov/14/2008 03:34:02 PM|Anurag Upadhyay, Dennis McGuire, Hamid Khazaei, Mandy York|Product Y,Product 1
    C02193|Nov/14/2008 03:05:18 PM|Hamid Khazaei, Rob Brogle, Xavier Otazo, san|Hercules,Apple,Product 3,Product zz
    C02194|Nov/14/2008 02:51:34 PM|Diana Young, Carl Krentz, Dennis Yen, Gordon Ries, Sunil Khatana|Product 2
    M00532|Nov/13/2008 01:34:42 PM|Dennis Yen, Jin Hong, Sunil Khatana|Product 1,Product 4,product yy,product YYY,ORCA,Tiger,Orange product,Restricted

    Hi,
    Here's how you can do it in Oracle 8.1.
    To get the individual sub-strings from product_lines, join your current result set to this "counter table"
    (   SELECT  ROWNUM  AS n
        FROM    all_objects
        WHERE   ROWNUM <= 10 -- upper bound on number of items
    )  cntrIf you don't know the worst case of how many items might be in product_lines, it's a little more complicated:
    (   SELECT  ROWNUM  AS n
        FROM    all_objects
        WHERE   ROWNUM <= 1 +
                SELECT  MAX ( LENGTH (product_lines)
                            - LENGTH (REPLACE (product_lines, ','))
                FROM    table_name
    )  cntrJoin this to the existing result set like this
    WHERE   ...
    AND     INSTR ( product_lines || ','    -- one extra comma added
                  , 1
                  , n
                  ) > 0When you do the join, you will have
    one copy of all the rows with one item in producgt_lines,
    two copies of all the rows with two items in producgt_lines,
    three copies of all the rows with three items in producgt_lines,
    and so on.
    When a row has been copied, each copy will have a different value of cntr.n.
    To extract the n-th substring from product_lines:
    SELECT  ...
            SUBSTR ( product_lines
                   , INSTR ( ',' || product_lines,   ',',   1,   n)
                   , ( INSTR (product_lines || ',',   ',',   1,   n)
                     - INSTR (',' || product_lines,   ',',   1,   n)
                   )  AS product_lines_itemWhen you have derived this column, you can join to the table with the translations
    WHERE  TO_NUMBER (product_lines_item) = propertyidTo combine these rows into one row with a comma-delimited list, GROUP BY all the columns you want to select except the property_value ('produc 1', 'tangerine', etv.), and SELECT:
    LTRIM ( MAX (CASE WHEN n =  1 THEN ',' || property_value END) ||
            MAX (CASE WHEN n =  2 THEN ',' || property_value END) ||
            MAX (CASE WHEN n = 10 THEN ',' || property_value END)
          )I don't know a good way to re-combine the rows in Oracle 8 without assuming some limit on the number of items. I assumed there would never be more than 10 in the example above. You can say 20 or 100, I suppose, if you want to. If you guess too high, everything will still work: the query will just be slower.
    This is a just one example of why packing several values into a single column is a bad idea.

  • SQL Help

    Please help ...
    Data Sample:
    A1 B1C1 D1
    01 A 06/30/2008 1
    01 B 06/10/2008 1
    01 C 06/09/2008 1
    01 D 06/09/2008 1
    02 A 06/20/2008 1
    02 C 06/20/2008 1
    03 A 06/20/2008 1
    04 A 06/10/2008 2
    04 B 06/10/2008 1
    04 C 06/09/2008 1
    04 C 06/09/2008 1
    Output Should be:
    01 A 06/30/2008 1
    02 A 06/20/2008 1
    02 C 06/20/2008 1
    03 A 06/20/2008 1
    04 A 06/10/2008 2
    Rules:
    - Top D1 should be selected.
    - If there are tie in D1 per A1, should be looking for C1 for the latest date
         - if there are tie for the D1 and C1 per A1 this data should be selected
         - if there are only one D1 which is the latest then inly 1 record will be selected.

    Hi,
    try this:
    SQL> with t as ( -- "sample data"
      2  select '01' a1, 'A' b1, to_date('06/30/2008','mm/dd/yyyy') c1, 1 d1 from dual union all
      3  select '01', 'B', to_date('06/10/2008','mm/dd/yyyy'), 1 from dual union all
      4  select '01', 'C' , to_date('06/09/2008','mm/dd/yyyy'), 1 from dual union all
      5  select '01', 'D' , to_date('06/09/2008','mm/dd/yyyy'), 1 from dual union all
      6  select '02', 'A' , to_date('06/20/2008','mm/dd/yyyy'), 1 from dual union all
      7  select '02', 'C' , to_date('06/20/2008','mm/dd/yyyy'), 1 from dual union all
      8  select '03', 'A' , to_date('06/20/2008','mm/dd/yyyy'), 1 from dual union all
      9  select '04', 'A' , to_date('06/10/2008','mm/dd/yyyy'), 2 from dual union all
    10  select '04', 'B' , to_date('06/10/2008','mm/dd/yyyy'), 1 from dual union all
    11  select '04', 'C' , to_date('06/09/2008','mm/dd/yyyy'), 1 from dual union all
    12  select '04', 'C' , to_date('06/09/2008','mm/dd/yyyy'), 1 from dual
    13  ) -- "end sample data"
    14  select a1, b1, c1, d1
    15    from (select a1, b1, c1, d1,
    16                 max(c1) over(partition by a1) mxc1,
    17                 max(d1) over(partition by a1) mxd1,
    18                 min(d1) over(partition by a1) mind1
    19            from t)
    20   where 1 = case when mind1 = mxd1 then
    21                  case when c1 = mxc1 then 1 end
    22                 else case when d1 = mxd1 then 1 end
    23                 end
    24  /
    A1 B1 C1                  D1
    01 A  6/30/2008            1
    02 A  6/20/2008            1
    02 C  6/20/2008            1
    03 A  6/20/2008            1
    04 A  6/10/2008            2

  • SQL help please. !!!!!!!!!!

    hi
    i need some help on the following problem. let's say i have a sql select that return the following rows
    ME
    EL
    EO
    FA
    these are 4 rows of data returned by executing "select column1 from myTable where somecondition = true". however, i need to display these results as follow
    MW,EL,EO,FA
    which is just one row and they are concatenated as one result. is there any way to modify the sql to do it? your help is much appreciated. thanks

    hi
    i need some help on the following problem. let's say i
    have a sql select that return the following rows
    ME
    EL
    EO
    FA
    these are 4 rows of data returned by executing "select
    column1 from myTable where somecondition = true".
    however, i need to display these results as follow
    MW,EL,EO,FA
    which is just one row and they are concatenated as one
    result. is there any way to modify the sql to do it?
    your help is much appreciated. thanksit would be easier if you ahead know how many rows you going to get...
    select
    "row1" = select blah from table where blah = '1',
    "row2" = select blah from table where blah = '2',
    "row3" = select blah from table where blah = '3',
    "row4" = select blah from table where blah = '4'
    from table
    make sure the sub select must return one record only...

  • SQL help: Selecting tickets with no open tasks

    Hi Gurus,
    I'm new to SQL. I need your help in a script where I need to fetch the tickets with no open tasks.
    Say, following is the Task table
    Table: Task
    | ticketid | taskid | taskstatus |
    | 1 | 1 | O |
    | 1 | 2 | O |
    | 1 | 3 | O |
    | 2 | 4 | C |
    | 2 | 5 | C |
    | 3 | 6 | C |
    | 3 | 7 | O |
    The query should return the ticketid(s) with all its taskstatus = 'C'.
    Any help would be highly appreciated.
    Thanks

    Hi Surya,
    Here's an Oracle style example (Sorry, I just can't do that ansi stuff)
    SQL> with ticket as (select 1 ticketid, 'C' reason from dual union all
                    select 2 ticketid, 'O' reason from dual union all
                    select 3 ticketid, 'O' reason from dual union all
                    select 4 ticketid, 'C' reason from dual)
    ,taskstatus as (select 1 taskstatusid, 'O' taskstatus from dual union all
                    select 2 taskstatusid, 'C' taskstatus from dual union all
                    select 3 taskstatusid, 'P' taskstatus from dual union all
                    select 4 taskstatusid, 'F' taskstatus from dual union all
                    select 5 taskstatusid, 'O' taskstatus from dual union all
                    select 6 taskstatusid, 'C' taskstatus from dual union all
                    select 7 taskstatusid, 'P' taskstatus from dual union all
                    select 8 taskstatusid, 'F' taskstatus from dual)
          ,task as (select 1 ticketid,  1 taskid, 2 taskstatusid from dual union all
                    select 1 ticketid,  2 taskid, 3 taskstatusid from dual union all
                    select 1 ticketid,  3 taskid, 4 taskstatusid from dual union all
                    select 1 ticketid,  4 taskid, 4 taskstatusid from dual union all
                    select 2 ticketid,  5 taskid, 1 taskstatusid from dual union all
                    select 2 ticketid,  6 taskid, 1 taskstatusid from dual union all
                    select 2 ticketid,  7 taskid, 1 taskstatusid from dual union all
                    select 3 ticketid,  8 taskid, 2 taskstatusid from dual union all
                    select 3 ticketid,  9 taskid, 2 taskstatusid from dual union all
                    select 3 ticketid, 10 taskid, 6 taskstatusid from dual union all
                    select 4 ticketid, 11 taskid, 2 taskstatusid from dual union all
                    select 4 ticketid, 12 taskid, 6 taskstatusid from dual union all
                    select 4 ticketid, 13 taskid, 4 taskstatusid from dual union all
                    select 4 ticketid, 14 taskid, 8 taskstatusid from dual)
    select a.ticketid, c.taskstatus
      from  task a, ticket b, taskstatus c
    where a.ticketid = b.ticketid
       and c.taskstatusid = a.taskstatusid
       and (c.taskstatus = 'C' or c.taskstatus = 'F')
       and b.reason = 'C'     
       and not exists (select null
                         from task a1, taskstatus c1
                        where a1.ticketid = a.ticketid
                          and c1.taskstatusid = a1.taskstatusid
                          and (c1.taskstatus = 'O' or c1.taskstatus = 'P'))
    order by 1,2
      TICKETID T
             4 C
             4 C
             4 F
             4 F
    4 rows selected.Please note, how I made test data, that way is much more helpful than your tables
    Regards
    Peter

  • SQL HELP , URGENT PLEASE

    Hi,
    I want some help in writing a SQL Query .Its besically a hierarchical query. Let me lay down the table structure first to explain my requirements better.
    PORP_TABLE(NODE_LEVEL int, WBS_ID int, WBS_NUMBER varchar(60), LFT int,RGT int)
    SELECT NODE_LEVEL, WBS_ID, LFT,RGT FROM PROPOSAL_WBS PW WHERE PROPOSAL_REV_ID = 7000
    (SAMPLE DATA)
    NODE WBS
    LEVEL WBS_ID NUMBER LFT RGT
    0 7055 ROOT 1 24
    1 7056 1 2 5
    1 7088 2 6 9
    2 7057 1.1 3 4
    2 7089 2.1 7 8
    2 7091 3.1 11 14
    2 7103 3.2 15 16
    2 7105 4.1 19 20
    1 7090 3 10 17
    3 7092 3.1.1 12 13
    1 7104 4 18 23
    2 7106 4.2 21 22
    ALLOCATION_DETAIL( WBS_ID int, COST_ID int, PERIOD Date, AMOUNT Float)
    sample data
    WBS_ID , COST_ID , PERIOD , AMOUNT
    7057 100 01-jan-2005 5000
    7057 100 01-feb-2005 2000
    7057 100 01-mar-2005 1000
    7057 100 01-apr-2005 6000
    7057 100 01-may-2005 3000
    7057 100 01-jun-2005 45000
    7106 100 01-mar-2005 8000
    7106 100 01-apr-2005 7000
    7106 100 01-may-2005 9000
    Now the PORP_TABLE has got the parents and childs. Only the leaf nodes in the hierarchy has the values stored in the ALLOCATION_DETAIL table. Now here is the scenario
    In the example 7055 is the root WBS . The Leaf WBS are the one with max extension in the wbs number ( in this case it is 1.1, 2.1, 3.1.1, 3.2, 4.1 and 4.2)
    Now the Starting period for each leaf node in the ALLOCATION_TABLE could be differrent . What that means is WBS 1.1 could start in Jan -2003 and WBS 3.1 Could be Jul-2005 . So the ending perios are also differrent for differrent WBS . Some can span 2 years some can 5 years.
    So how to write a query so it retrieves the value for all the Wbs starting from the MIN ( PERIOD ) upto the MAX(PERIOD), and it should roll up also. Now there is No connect by Prior or any analytic functions available for this . THIS NEEDS TO BE DONE ONLY THROUGH TRADITIONAL SQL STATEMENT . And NO DB FUNCTIONS CAN BE USED .
    Now if the WBS is a parent node then it should have the sum of all its child nodes for the COST category.
    SO THE RESULT SET SHOULD BRING LIKE THIS
    WBS_NUMBER, PERIOD_NUMER, COST_CATEGORY , AMOUNT
    ROOT
    1
    1.1
    2
    2.1
    3
    3.1
    3.1.1
    3.2
    4
    4.1
    4.2
    ......

    Hi,
    <br>Read String Aggregation Techniques</br>
    <br>HTH,</br>
    <br>Nicolas.</br>

Maybe you are looking for

  • Where do I enter name address phone etc to transfer to a form

    downloaded autofill and am trying to set up form to transfer data simply to a form that appears on internet. I have to imput all data with airlines when I I purchase on line. Sometimes I purchase 7 tickets with freq. flyer numbers and bynthe time I a

  • PDF File Management

    At work we were recently told we had to submit all our documents to another department in PDF format. We have Acrobat Pro 8 to create and combine the PDF documents as needed. However, we manage about 20,000 case files per year, and several different

  • No internet access, ping general failure, no IP address after SOFTWARE updates to Windows 7 on 15th April,2015

    Hi , I using windows 7 Home premium, and OS got updated yesterday night. Then on wards, i am unable to access internet and while pinging, its giving "General Failure". Why its happened? Is something wrong in the latest Windows 7 update? How to resolv

  • How to combine Digital Output, a delay and Analog Input in a fast loop

    I need to develop a process loop that runs at least at 250 Hz that performs a Digital output, than a delay of 50 microseconds and than an analog input of all the channels. All will be done using ATI MIO 64E3 card. Of course, the acquired data will be

  • 10.6.4 Update Browser issues

    Since the 10.6.4. update FireFox has not worked properly, which I must use for my work. Also, the sound during an Adobe Connect meeting created a terrible echo--I checked, I was the only one with the issue-- I have reinstalled FireFox--not luck--toda