request to retrieve the value of the column and use in the other rows of the table

Hi all

I have a table where I maintain pairs name / value of a particular job.  Now, I would like to see some of the values of the rows passed to other rows in a table for example

create job_name_value

(

VARCHAR2 (100) job_name,.

name varchar2 (100),

value varchar2 (100)

);

job_name name value
TRGJOB% FPATH/ USR/LOCAL/TRGJOB
TRGJOB% FDATECALDATE + 1
TRGJOB$FNAME1%%FPATH.mywatchfile1.%FDATE
TRGJOBFNAME2%%FPATH.mywathcfile2.%FDATE
TRGJOB% FNAME3%FPATH.mywatchfile3.%FDATE

can we write a sql query to produce output as below the objective is to use the value of fdate and fpath in the remaining lines. If there is no fdate and fpath then value should return such what or we need to use the stored procedure to achieve

/ usr/local/trgjob/mywatchfile1. CALDATE + 1

/ usr/local/trgjob/mywatchfile2. CALDATE + 1

/ usr/local/trgjob/mywatchfile3. CALDATE + 1

Hello

Since it cannot be '% FDATTE' or '% FPATH' (or both) then you need to replace each of them separately.  If the other does not, there 'replacement' will do nothing, but this will not affect the result of the other.

Here's a way to do it:

SELECT REPLACE (REPLACE (n.value

'% FPATH.'

p.value | '/'

)

, '% FDATE '.

d.value

) AS output_value

OF job_name_value n

LEFT OUTER JOIN job_name_value p ON p.name = '% f '.

LEFT OUTER JOIN job_name_value d ON p.name = '% FDATE '.

WHERE n.name AS '\%FNAME%' ESCAPE ' \'

;

I hope that answers your question.

If this isn't the case, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.

Report when the above query is to give erroneous results and explain, using specific examples, how to get the correct results of data provided in these places.  If you change the query at all, your postal code.

Always say what version of Oracle you are using (for example, 11.2.0.2.0).

See the FAQ forum: https://forums.oracle.com/message/9362002#9362002

Tags: Database

Similar Questions

  • I have a column with two values, separated by a space, in each line. How to create 2 new columns with the first value in a column, and the second value in another column?

    I have a column with two values, separated by a space, in each line. How do I create 2 new columns with the first value in one column and the second value in another column?

    Add two new columns after than the original with space separated values column.

    Select cell B1 and type (or copy and paste it here) the formula:

    = IF (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    shortcut for this is:

    B1 = if (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    C1 = if (Len (a1) > 0, Member SUBSTITUTE (A1, B1 & "", ""), "")

    or

    the formula of the C1 could also be:

    = IF (Len (a1) > 0, RIGHT (A1, LEN (A1) −FIND ("", A1)), "")

    Select cells B1 and C1, copy

    Select cells B1 at the end of the C column, paste

  • Recording on DVD - "Unable to retrieve the table of contents" error

    Hi all

    Whenever I try to record on a DVD a face "could not retrieve the table of contents.

    I tried to change the recording speed, but no use.

    When I go to properties of DVD and click on activate record it does not recognize the DVD or any CD in the drive.

    Please help

    Hello

    1. what software to use to burn cd/dvd discs? Try using Nero, Ashampoo burning studio, alcohol CD and DVD software of engraving,
    2. then, I advise you to use high quality as TDK or Verbatim media.

    3
    Go to Device Manager and remove the drive from the list of devices CD/DVD.
    Then access the registry and delete the Upperfilters and Lowerfilters completely from the following registry key values:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class {4D36E965-E325-11CE-BFC1-08002BE10318}

    Reboot the laptop and wait for the CD/DVD drive would appear once again

    If your problems persist, there may be a problem with your cd/DVD-ROM

  • How to make a percentage of the value of a column and then insert this value in a column

    The table below should be the result I want to achieve. This means according to what value is in Column1 which corresponds to the percentage and what value is in Column2. Column1 will make a percentage of Column2. Like 80% of 1000 = 800, what will change in Column2 of 2nd record.

    Currently my code only select the current record and insert another copy that will duplicate the same record. But now I need to calculate and replace the values in column 2 according to the perentage. I did not have my code select here because I'm afraid of you all will get confused. I only put my code insert here, pls tell me how to make the formula in the code for the percentage of Column2 thanks.

    Orginal 1st record->                                                 column1 column2 
                                                                          
    80   1000  

    Inserted copy records which is 2nd record
    (what I want to achieved)   column1 column2 
                                                                          
    80   800


    My codes

     INSERT INTO table1 (column1, column2) VALUES (tran.column1, tran.column2);

    Did it using this, thanks.

    INSERT INTO table1 (column1, column2) VALUES (tran.column1, tran.column2 * tran.column1 / 100 );

  • Dynamic alignment of the value of element column and report page

    Hi friends,

    I have an interactive report that contains the columns as

    < li > empno
    < li > name

    In the light of the foregoing, I 'empno' with an alignment of the left column and a 'name' with an alignment of the left column.

    It is possible to substitute the alignment of the data that we put into the report according to the value of the application as element

    If my application point is about US, so I need the alignment of the column 'empno' and 'Name' to the left, and if the value of point of my app's AR, I need the alignment of the column 'empno' and 'Name' to be right. What is possible to achieve dynamic alignment for the report data to two columns 'empno' and 'Name', according to the value of application page element.

    And also, in the case of the page element, I have a page element with a name of P1_NAME in which he has an alignment of the Horizontal/Vertical element on the left.

    I need to this alignment of the element of the page element behave dynamically according to the order of the day of the application page, as if the order of the day of the application page called WE then the alignment of the element of the page item must be left and if the order of the day of the application page called AR and then the alignment of the element of the page element has to be right.

    Is it possible to make some friends of my scenario two above. Kindly help me with this.

    Thanks in advance.

    Brgds,
    Mini

    Hey Mini,

    To change the alignment on the fly, you need a change in your IR and javascript.

    First change the columns that you want to change the alignment for. Add the following code in The HTML Expression in the column formatting part. (Detail of the column)

    #HERE _THE_COLUMN_NAME#
    

    Then you can change the easy alignment for these areas with the following code

    $(".align_style").css("text-align","left")
    

    This can be in a DA, or just on the loading of the page.

    Kind regards
    Kees Vlek
    -----
    Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66
    If the answer to question please change replied and mark the appropriate post as correct / helpful.

    Published by: kvlek on 7-mei-2013 14:47

  • How can I retrieve the Table columns

    Dear everybody

    List the texts listed both necessary and recommended to ICT218 in semester 2 2010. The first should have required with a way to make the distinction between necessary and recommended. Thank you


    Select Mt10, RequiredText, RecommendedReading, name
    Book TEACHINGPERIOD, UNITOffering U
    Where (Mt10 = "ICT218") and (name = "Semester2");


    It did not work because it was not successfully completed. I think he needs a join somewhere.

    UnitOffering Table

    UnitOfID UnitTitle the period Mt10
    Vet006 Intro to Vet Vet432 20/01/10
    Fundamental mathematics MA004 20/01/10 MA164
    LEA011 Intro to legal studies 20/08/10 LEA765
    ICT001 Databses 20/08/10 ICT218
    Hu002 Introduction to the history of 20/01/10 HI154
    Phy003 Introduction to the physical Phy005 20/02/10
    LAW154 Intro to law 20/08/10 Law001
    PSY154 Introduction to psychology 20/08/10 PSY001
    ICT009 Principles of Computer Science 20/08/10 ICT104
    Bio007 Introduction to biology 20/08/10 BIO457
    Intro to Met008 to Met432 of Metalogy 20/08/10

    TeachingPeriod Table
    Name year StartDate teaching period
    S1 2010 17/02/10 S12010
    Q1 2010 T12010 23/03/10
    S2 2010 08/08/10 S22010
    Su1 2010 08/01/10 Su12010
    Su2 10/08/10 2010, Su22010
    Q2 2010 10/08/10 T22010
    S1 2011 S12011 20/02/11
    S2 2011 07/20/11 S22011
    T1 2011 03/20/11 T12011
    Q2 2011 08/20/11 T22011
    SU1 2011 SU12011 20/02/11
    SU2 2011 08/20/11 SU22011

    The Book table

    Number ISBN BookTitle author survey recommended
    9780321523068 database systems Connolly and Begg Yes No 2009 BBN345
    Malloy and history of Australia 8734512367845 Martin Yes No ABD265 2005
    4589565321987 great minds like Sheena Smith Yes No 2003 CAR789
    7653457609825 biggest atoms Kevin Smith Yes No 2004 ADE498
    3178765145789 Anatomy animal Linda Pearce Yes No 2008 EAT543
    5234569012345 math great don't Ken Morgon No Yes 2006 FET987
    6124537890124 what metals can do Brian Deed No Yes 2007 GAT621
    1543278954326 weird biology Shaun don't diet No Yes 2002 ABC123
    2567458906276 largest technology Fran day Yes 2001 ACN456
    0125678432167 worldwide system clear legal no dawn No Yes 2000 ANB367
    0003456789079 not best databases Ken Murray No Yes 2002 BBN345

    Published by: user9164240 on 10/29/2010 02:05

    Hello

    That's why you need the actual table scripts, as we do not know what are the types of columns

    Try something like this

    SELECT U.UNITCODE, B.BOOKTITLE,BO.RECOMMENDEDTEXTNO, BO.REQUIREDBOOKNO, TP.NAME
    FROM BOOK B, TEACHINGPERIOD TP, UNITOFFERING U, BOOKORDER BO
    WHERE U.UNITCODE ='ICT218' AND TP.TEACHINGPERIODID = 'S22010' AND BO.UNITOFFERINGID = U.UNITOFFERINGID AND B.ISBNNUMBER = BO.ISBNNUMBER
    

    see you soon

    VT

  • Request to retrieve the serial number of Labview 8.5.1

    Salvation OR,.

    Recently, my laptop has ventilation due to the material error,

    at the moment I would install the software Labview in my new laptop computer.

    I noticed that the labview license can in fact be used for 3 PCs (not simultaneously)

    Yes, is there anywhere I can get the labview series/license number so that I can install on my new laptop?

    FYI, the portable ventilation totally cannot be power up at all.

    kindly guide me.

    previous info from laptop:

    LabVIEW 8.5.1

    Windows XP operating system

    Contact your local office of NOR. They would have a record of your serial numbers.

  • Request to retrieve the list of users who do not have an updated resource service

    I try to get the list of users who are not a particular resource put into service. I can't seem to find a table that links the object resource information and user information. I need to generate a CSV file. No matter who's done this before, or have any ideas. If so, any information would be very useful.

    Thank you

    Select * usr where usr.usr_key not in)
    Select usr.usr_key from usr, obi, obj, Ouedraogo, ost
    where oiu.usr_key = usr.usr_key
    and oiu.obi_key = obi.obi_key
    and obi.obj_key = obj.obj_key
    and obj.obj_name =: obj_name
    and oiu.ost_key = ost.ost_key
    and ost.ost_status not in ('revoked'))

    -Kevin

  • Retrieve the table

    Hello

    I want to know if there is a method to retrieve an array of backup rman without a copy of the database.

    Thanks for your help.

    Can only restore the tablespace or need double job with database?

    Yes, you can restore specific tablepspce by jumping the other tablespace by skip on clone cmd rman tablespace clause.

    http://docs.Oracle.com/CD/B19306_01/backup.102/b14194/rcmsynta028.htm
    http://dbarajabaskar.blogspot.in/2010/05/RMAN-duplicate-active-database-cloning.html
    As

    RUN
    {
      ALLOCATE AUXILIARY CHANNEL newdb1 DEVICE TYPE sbt;
      DUPLICATE TARGET DATABASE TO newdb
        DB_FILE_NAME_CONVERT=('/h1/oracle/dbs/trgt/','/h2/oracle/oradata/newdb/')
        UNTIL TIME 'SYSDATE-1'  # specifies incomplete recovery
        *SKIP TABLESPACE cmwlite, drsys, example   # skip desired tablespaces*
        PFILE = ?/dbs/initNEWDB.ora
        lOGFILE
          GROUP 1 ('?/oradata/newdb/redo01_1.f',
                   '?/oradata/newdb/redo01_2.f') SIZE 200K,
          GROUP 2 ('?/oradata/newdb/redo02_1.f',
                   '?/oradata/newdb/redo02_2.f') SIZE 200K
          GROUP 3 ('?/oradata/newdb/redo03_1.f',
                   '?/oradata/newdb/redo03_2.f') SIZE 200K REUSE;
    }
    
  • I have 10 devices all under the same identity of apple my partner can see all my contacts, call logs and use of all other web internet devices. How can I change this, to keep my contacts and call log on my phone only?

    I have 10 devices all under the same identity of apple my partner can view all my contacts and call logs and vice versa.

    The device can also see all internet pages use the devices, but mine isn't... How to get our contacts and call the newspapers private their own device and how can I get to keep an eye on web pages using my children? So how do for my phone, the master device / hand who is in control of access for all, because it has my info from apple id and card credit on all devices.

    Stop sharing an ID first. They are not meant to be shared. Then set the sharing of family. Each individual should have their own code.

  • How can I get firefox without using the heel. I just want to download once and use it on other computers

    I don't want to download the latest version of Firefox more than once. I want to download it and put my other computers. I have a limited download quota.

    The full Offline Installer is here:
    http://www.Mozilla.com/en-us/Firefox/all.html

  • I have laptop computer, the use of Firefox is great, but I want to get search Goggle ridoff in the middle of the screen and use Bing or others with better rules of confidentiality? How change the search bar of glasses in the middle of the screen?

    I don't like political new goggle, which begins in March 2012.
    I don't want to see in the middle of my search bar of glasses display only one option. How to change it to any other intelligent research, such as the top of the screen, I use BING, but it's a bit like small space to see what I typed.
    TY

    Hi larafox,

    Copy this address: https://duckduckgo.com/

    Open Tools (Alt + T) > general, paste the address copied in the box next to Homepage:, click on the box (above) next of when Firefox starts: replace the show my home page option, and then click OK below.

    General Panel

  • JavaScript question - accept user input and use them in other areas with case changed (i.e. in a field to uppercase and the other as capatilsed each)

    Hi ther,.

    Ive been away from Livecucle for quite awhile and I lost a handle on coding.

    I am tyring to get the data from that paid to be repeated also in two other areas with different formatting (in capital letters and capatilise each word)

    Therefore, if the user enters "james smith michael" in a named filed - say - fullanme - she could also be replicated in a fullnameCaps file - changed to uppercase in this area (i.e: JAMES MICHAEL SMITH) and - class fullnameCapsEach get out of James Michael Smith

    the other fields will be just hidden.

    I remembered hot change the entry to the ceilings in the entry field - xfa.event.change = xfa.event.change.toUpperCase () - but that only works in the entry field of course.

    I tried to set the fullnameCaps and the fullnameCapsEach to equal the rawvalue of the entry fullanme field and put the code of change in them - but that doesn't seem to be the answer!

    Someone out there you have nay of ideas?

    see you soon

    Hello

    Try this solution in the event of change of your input field:

    var str = xfa.event.newText, capsAll, capsFirst;
    
      capsAll = str.toUpperCase();
      capsFirst = str.toLowerCase().replace(/([^a-z]|^)([a-z])(?=[a-z]{1})/g, function(_, g1, g2) {
        return g1 + g2.toUpperCase();
        });
    
    fullnameCaps.rawValue = capsAll;
    fullnameCapsEach.rawValue = capsFirst;
    
  • Need help in selecting the color in the image and use it in other images.

    I have about 10 photos of a drawing/character but the color is not consistent. How to select a color in the first drawing and then use that same color in all the

    drawings so that he is there not differences in images?

    On one of the drawings, use the eyedropper tool.

    You can select the color of different sample sizes, 1-pixel average of 101 x 101.

    And then double-click the color in the Color Palette and add it to your color chart.

    Name your new shade.

    Voila.

  • Trying to change a query to return funds and no values only. XMLELEMENT and used UNPIVOT

    So I have a request to work but I want to change it to provide some totals and not only RAW files the request is lower with the changes that I've made being in RED:

    ----------

    DECLARE

    letexte CLOB.

    BEGIN

    with test_table as)

    SELECT VM_REPORT_DATE,Sum (Quantity) quantotal, point,

    (CASE point

    WHEN "VM_HOSTS_NUM" AND THEN "

    WHEN "VM_NUMBER" AND THEN "

    WHEN "VM_CPU_COUNT" AND THEN "

    WHEN "VM_PHYS_MEM" THEN "y_axis_2".

    WHEN "VM_VIRT_MEM" THEN "y_axis_2".

    WHEN "VM_VIRT_MEM" THEN "y_axis_2".

    WHEN "VM_TOTAL_DISK" THEN "y_axis_3".

    WHEN "VM_PROVISIONED_DISK" THEN "y_axis_3".

    ELSE 'y_axis.

    Wser END)

    ,

    (CASE point

    WHEN "VM_HOSTS_NUM" THEN "#FF0000".

    WHEN 'VM_NUMBER', THEN '#AA0000 '.

    WHEN "VM_CPU_COUNT" THEN "#770000".

    WHEN "VM_PHYS_MEM" AND THEN "#0000FF".

    WHEN 'VM_VIRT_MEM' THEN ' #0000AA '.

    WHEN "VM_VIRT_MEM" AND THEN "#000077 '."

    WHEN "VM_TOTAL_DISK" AND THEN "#00FF00".

    WHEN "VM_PROVISIONED_DISK" AND THEN "#00AA00.

    ELSE 'y_axis.

    Colorr END)

    of VM_CORE unpivot)

    ITEM quantity in (VM_HOSTS_NUM, VM_NUMBER, VM_PHYS_MEM, VM_VIRT_MEM, VM_CPU_COUNT, VM_TOTAL_DISK, VM_PROVISIONED_DISK)

    () where VM_REPORT_DATE > (SELECT ADD_MONTHS (TRUNC (SYSDATE),-1) from DUAL) Group of VM_REPORT_DATE, item)


    SELECT XMLSERIALIZE)

    CONTENT XMLELEMENT ('data', XMLAGG (XMLELEMENT ("series", xmlAttributes (point as "name", "Line" as the "type", wser as "y_axis", colorr as "color"),

    XMLAGG)

    XMLElement ("point", xmlAttributes (VM_REPORT_DATE as 'name',quantotal 'y')) order by VM_REPORT_DATE

    )

    ))

    )

    )

    in the Group test_table letexte by order of point by point.

    dbms_output.put_line (TheText);

    END;

    ----------

    Select 'WITH TABLE AS' returns that I wait for him.

    VM_REPORT_DATEQUANTOTALAGENDAWSERCOLORR
    20 OCTOBER 13 00:00:005224.39VM_VIRT_MEMy_axis_2#0000AA
    20 OCTOBER 13 00:00:001789VM_CPU_COUNT#770000
    20 OCTOBER 13 00:00:00153348.16VM_PROVISIONED_DISKy_axis_3#00AA00
    NOVEMBER 12-13 00:00:00829VM_NUMBER#AA0000
    20 OCTOBER 13 00:00:0042VM_HOSTS_NUM#FF0000
    20 OCTOBER 13 00:00:007343.09VM_PHYS_MEMy_axis_2#0000FF
    4 NOVEMBER 13 00:00:00822VM_NUMBER#AA0000
    4 NOVEMBER 13 00:00:005243.38VM_VIRT_MEMy_axis_2#0000AA
    NOVEMBER 12-13 00:00:00190985VM_TOTAL_DISKy_axis_3#00FF00
    27 OCTOBER 13 00:00:0042VM_HOSTS_NUM#FF0000
    27 OCTOBER 13 00:00:00832VM_NUMBER#AA0000
    27 OCTOBER 13 00:00:00153423.89VM_PROVISIONED_DISKy_axis_3#00AA00
    4 NOVEMBER 13 00:00:00190444.75VM_TOTAL_DISKy_axis_3#00FF00
    NOVEMBER 12-13 00:00:0042VM_HOSTS_NUM#FF0000
    20 OCTOBER 13 00:00:00836VM_NUMBER#AA0000
    20 OCTOBER 13 00:00:00185519.5VM_TOTAL_DISKy_axis_3#00FF00
    27 OCTOBER 13 00:00:007343.09VM_PHYS_MEMy_axis_2#0000FF
    4 NOVEMBER 13 00:00:0042VM_HOSTS_NUM#FF0000
    NOVEMBER 12-13 00:00:00155937.43VM_PROVISIONED_DISKy_axis_3#00AA00
    27 OCTOBER 13 00:00:00186059.75VM_TOTAL_DISKy_axis_3#00FF00
    4 NOVEMBER 13 00:00:007343.09VM_PHYS_MEMy_axis_2#0000FF
    4 NOVEMBER 13 00:00:00154795.62VM_PROVISIONED_DISKy_axis_3#00AA00
    27 OCTOBER 13 00:00:005215.39VM_VIRT_MEMy_axis_2#0000AA
    NOVEMBER 12-13 00:00:005270.38VM_VIRT_MEMy_axis_2#0000AA
    27 OCTOBER 13 00:00:001781VM_CPU_COUNT#770000
    4 NOVEMBER 13 00:00:001782VM_CPU_COUNT#770000
    NOVEMBER 12-13 00:00:007343.09VM_PHYS_MEMy_axis_2#0000FF
    NOVEMBER 12-13 00:00:001797VM_CPU_COUNT#770000

    However the overall query returns:

    Error report:

    ORA-00979: not a GROUP BY expression

    ORA-06512: at line 6

    00979 00000 - "not a GROUP BY expression"

    * Cause:

    * Action:

    6 is the line "with test_table as.

    You need to group by all the columns at the same level of aggregation, i.e. WSER and COLORR thus:

    SELECT XMLSERIALIZE (CONTENT

    XMLELEMENT ("data"

    XMLAGG)

    XMLELEMENT ("series"

    xmlAttributes)

    element in the form 'name '.

    , 'Line' as 'type '.

    , wser as "y_axis.

    , colorr have "color".

    )

    XMLAGG)

    XMLElement ("point"

    xmlAttributes)

    VM_REPORT_DATE as 'name '.

    , quantotal 'y '.

    )

    )

    order of VM_REPORT_DATE

    )

    )

    )

    )

    )

    from test_table

    Group by element, wser colorr

    ;

Maybe you are looking for