Trying selelct A,B,C,D from dual

I want to create a sql statement where I select from dual letters
A THRU E. I want them to come back in one field.
I have done the following
select 'A' ,'B','C','D' FROM DUAL
but this brings them back in there own field.

This???
SQL> with t as (
   select 'A' col1 ,'B' col2,'C' col3,'D' col4,'E' col5 from dual)
select col1 || col2 || col3 || col4 || col5 new_col from t
NEW_C
ABCDE

Similar Messages

  • Generating XML from dual

    Hey Gurus,
    I'm trying to generate the following XML from dual, however, I keep getting an error message stating my top level is not defined. Any ideas? Thanks!
    <PUDOOUTPUT>
    <PKG>
    <SHIPMENTID>12345</SHIPMENTID>
    <ERROR>'NO DATA'</ERROR>
    <ERRORTEXT>'Error: Cannot find shipper alias in SPL_SHIPPER_ACCOUNTS.'</ERRORTEXT>
    </PKG>
    </PUDOOUTPUT>
    select xmlelement("PUDOOUTPUT",xmlelement("PKG",xmlelement("SHIPMENTID",i.shipmentid),
    xmlelement("ERROR",'NO DATA'),
    xmlelement("ERRORTEXT",'Error: Cannot find shipper alias in SPL_SHIPPER_ACCOUNTS.')))
    into p_wms_output
    from dual;

    Hi,I need to generate XML FIle.Since i m new to XML.
    I had toregister the valid schema in my DB now i want to generate the XML file and with the refernce to this schema that xml file should be validated one against that schema.
    things i hav done till now
    ->i hav registered the scehma
    and the sample XML file provided by client
    <?xml version="1.0"?>
    <MEDMLDATA xmlns="PhaseForward-MedML-Inform4">
    <!-- Insert Trial/Study Information -->
    <STUDYVERSION UUID="id"
    STUDYNAME="name"
    VERSIONDESCRIPTION="text" />
    <!-- Insert Site Personnel Information -->
    <USER USERNAME="mmeyer"
    USERTYPE = "SITE"
    ACTIVESTATE = "TRUE"
    DELETESTATE = "FALSE"
    FIRSTNAME = "Marianne"
    LASTNAME = "Meyer"
    DISPLAYNAME = "Marianne Meyer"
    TITLE = ""
    HOMESCREENURL = "./Custom/HomeDefault.html"
    PHONE = "(555) 555-1212"
    FAX = "(555) 555-1212"
    ALTPHONE = ""
    EMAIL = "[email protected]"
    ADDRESS = ""
    ADDRESS2 = ""
    CITY = ""
    STATE = ""
    ZIPCODE = ""
    COUNTRY = ""
    BEEPER = ""
    USERMUSTRESETPASSWORD = "FALSE"
    DESCRIPTION = ""
    PASSWORD="changeme"/>
    <USER USERNAME="john"
    USERTYPE = "SITE"
    ACTIVESTATE = "TRUE"
    DELETESTATE = "FALSE"
    FIRSTNAME = "John"
    LASTNAME = "Meyer"
    DISPLAYNAME = "John Meyer"
    TITLE = ""
    HOMESCREENURL = "./Custom/HomeDefault.html"
    PHONE = "(555) 555-1212"
    FAX = "(555) 555-1212"
    ALTPHONE = ""
    EMAIL = "[email protected]"
    ADDRESS = ""
    ADDRESS2 = ""
    CITY = ""
    STATE = ""
    ZIPCODE = ""
    COUNTRY = ""
    BEEPER = ""
    USERMUSTRESETPASSWORD = "FALSE"
    DESCRIPTION = ""
    PASSWORD="changeme"/>
    <!-- Insert Site Information -->
    <SITE NAME= "(01) Massachusetts General Hospital" MNEMONIC="01"
    ADDRESS = "1 Main Street"
    ADDRESS2 = ""
    CITY = "Boston"
    STATE = "MA"
    ZIPCODE = ""
    COUNTRY = "USA"
    PHONE = "(555) 555-1212"
    ALTPHONE = ""
    FAX = ""
    EMAIL = ""
    TIMEZONE="(GMT-05:00) Eastern Time (US & Canada)"
    SITEDATEFORMAT = "MONTH_DAY_YEAR"
    STARTDATE = "April 1, 2005">
    </SITE>
    <SITE NAME= "(02) Boston General Hospital" MNEMONIC="01"
    ADDRESS = "1 Main Street"
    ADDRESS2 = ""
    CITY = "Boston"
    STATE = "MA"
    ZIPCODE = ""
    COUNTRY = "USA"
    PHONE = "(555) 555-1212"
    ALTPHONE = ""
    FAX = ""
    EMAIL = ""
    TIMEZONE="(GMT-05:00) Eastern Time (US & Canada)"
    SITEDATEFORMAT = "MONTH_DAY_YEAR"
    STARTDATE = "April 1, 2005">
    </SITE>
    <!-- Insert SITE and User Mapping Information -->
    <SITEGROUP SITENAME="(01) Massachusetts General Hospital">
    <USERREF USERNAME="mmeyer"/>
    </SITEGROUP>
    <SITEGROUP SITENAME="(02) Boston General Hospital">
    <USERREF USERNAME="John"/>
    </SITEGROUP>
    <!-- Insert User ROle Information -->
    <RIGHTSGROUP GROUPNAME="CRA">
    <!-- Insert Rights -->
    <RIGHTREF RIGHT="Print"/>
    <RIGHTREF RIGHT="Monitor"/>
    <RIGHTREF RIGHT="Canned Reports"/>
    <RIGHTREF RIGHT="View CRF"/>
    <RIGHTREF RIGHT="View Signature History for CRF"/>
    <RIGHTREF RIGHT="View Signature History for CRB"/>
    <RIGHTREF RIGHT="Data Export Listings"/>
    <RIGHTREF RIGHT="Freeze a CRF"/>
    <RIGHTREF RIGHT="Unfreeze a CRF"/>
    <RIGHTREF RIGHT="Mark and Unmark a CRF as SVed"/>
    <RIGHTREF RIGHT="Freeze a CRB"/>
    <RIGHTREF RIGHT="Unfreeze a CRB"/>
    <RIGHTREF RIGHT="Change Query State from Candidate to Open"/>
    <RIGHTREF RIGHT="Change Query State from Candidate to Deleted"/>
    <RIGHTREF RIGHT="Change Query State from Answered to Closed"/>
    <RIGHTREF RIGHT="Change Query State from Open to Closed"/>
    <RIGHTREF RIGHT="Change Query State from Reissued Candidate to Closed"/>
    <RIGHTREF RIGHT="Enter Query in Candidate State"/>
    <RIGHTREF RIGHT="Enter Query in Open State"/>
    <RIGHTREF RIGHT="Re-issue Query in Candidate State"/>
    <RIGHTREF RIGHT="Re-issue Query in Open State"/>
    <RIGHTREF RIGHT="Navigate by Visit"/>
    <RIGHTREF RIGHT="Navigate by Form"/>
    <RIGHTREF RIGHT="Reordering of Patients"/>
    <!-- Insert Users for role -->
    <USERREF USERNAME="mmeyer"/>
    <USERREF USERNAME="john"/>
    </RIGHTSGROUP>
    </MEDMLDATA>
    now i need to generate XML based on the above SAMple XML file,can anybody tell me how to generate XML file based on this..and after generating it should be validated against the registerd schema.

  • Trying to get a date value from a string

    Hi All,
    I'm not sure I am doing this right, so I figured I would ask the experts...
    I have built a file upload page that is working the way I need it, but I have found that I need to determine the date from the uploaded file name. I tried to create a PL/SQL computation and do some substr / instr to the filename, but I'm not getting it as I get "ORA-01843: not a valid month" error. Here is the code I'm trying:
    declare
      v_underscore  integer;
      v_date            varchar2(15);  --have also tried using date datatype...
    begin
      v_underscore := INSTR(:P20_EXPRESS,'_',1,1);
      v_date := to_date(substr(:P20_EXPRESS,v_underscore + 1,6),'YYMMDD');
      return v_date;
    end;And here is a sample filename:
    F15047/proc_10607161001.csv
    Is this the best way to achive what I'm trying to do?
    Thanks,
    Corey

    Hi,
    v_underscore := INSTR(:P20_EXPRESS,'_',1,1);
    v_date := to_date(substr(:P20_EXPRESS,v_underscore + 1,6),'YYMMDD');What this is saying is:
    Get the position of the "_" character
    Move to the next character to the right (which is a "1" in your case)
    Get 6 characters (106071) from the string value
    Convert them to a date using the format 'YYMMDD'
    This results in:
    Year: 10
    Month: 60
    Day: 71
    Which of course is not valid.
    For example:
    select
      substr('F15047/proc_10607161001.csv', instr('F15047/proc_10607161001.csv', '_', 1, 1) + 1, 6)
    from
      dual;
    SUBSTR
    106071It looks like you want to move two positions to the right rather than a single position:
    select
      substr('F15047/proc_10607161001.csv', instr('F15047/proc_10607161001.csv', '_', 1, 1) + 2, 6)
    from
      dual;
    SUBSTR
    060716Hope that helps a bit,
    Mark

  • Delay due to selecting sysdate from  dual

    Our application accessing dummy table dual frequently for getting current date and time. But some times this could reduce our database performance.
    How could we overcome this problem.
    ASH report_
    Top Events_
    latch: library cache      29.87      "5015593920","214","0"      26.57      address      number      tries
    Top SQL Statements_
    0vnruqfxmtu6q     Select to_number(to_char(Sysdate, 'YYYYMMDD')) from dual

    orianmoon wrote:
    Thanks for your replies,
    Please check this below link which shows my database performance at the time of running a particular sql , which is selecting sysdate using table dual. It created Lbrary cache latch contention.
    http://arun-itadmin.blogspot.com/2010/12/oracle-performance-screen.html
    My question is
    Is this the problem of frequent usage of table dual or usage of 'sysdate' ?
    It there any way to get date and time other than using sysdate function?
    Edited by: orianmoon on Dec 8, 2010 9:42 PMI don't see anything there that points the finger at SELECT SYSDATE FROM DUAL;

  • Query from DUAL

    I am calling a Pl/sql function in a select query which has a statement as below
    SELECT SUBSTR(5/2,2,1) INTO m_delim FROM DUAL;
    The number of records returned from the calling select query is more 1 million.
    How much adversly the query from DUAL table affects the performance of the select query?

    user557052 wrote:
    I am calling a Pl/sql function in a select query which has a statement as below
    SELECT SUBSTR(5/2,2,1) INTO m_delim FROM DUAL;
    The number of records returned from the calling select query is more 1 million.
    How much adversly the query from DUAL table affects the performance of the select query?Even if you are selecting from dual, querying once would be enough based on your select statement.
    It does not seem like it is varying, you are trying to find the delimiter, which can be done once.
    Ss

  • How to calculate a string (select '1 + 1' from dual;)

    I have this system that gives me data (roughly a gig per hour) in the format:
    Time_idle
    13h 56m
    56m 23s
    24h 23m
    4h 3m
    4m 3s
    I have to translate it into date, or desimal hour so I can use it in calculations and SQL.
    How can I do this?
    I have tried the following:
    select RTRIM(REPLACE(REPLACE(REPLACE(REPLACE(time_idle,'h',''),'m','/60'),'s','/3600'),' ','+'),'+') from thedate where prosess = 1;
    and I then get:
    result:
    10+54/60
    14+12/60
    54/60+1/3600
    which is correct, if I could get Oracle to calculate the number sum instead of just providing me with the string value. How do I make Oracle calculate the value of the string?
    Or how can I use to_date function to translate the text into a date?
    Anyone know?
    BB

    Unfortunately this soultion breaks down when the time involved exceeds 24 hours. Try it for the given data sample 24h 23m ...
    SQL> select (to_number(to_char(to_date('24m 23m', 'HH24"h" MI"m" SS"s"'), 'HH24'))) +
      2   (to_number(to_char(to_date('24m 23m', 'HH24"h" MI"m" SS"s"'), 'MI'))/60) +
      3   (to_number(to_char(to_date('24m 23m', 'HH24"h" MI"m" SS"s"'), 'SS'))/3600) total
      4   from dual
      5  /
    select (to_number(to_char(to_date('24m 23m', 'HH24"h" MI"m" SS"s"'), 'HH24'))) +
    ERROR at line 1:
    ORA-01850: hour must be between 0 and 23
    SQL> Cheers, APC

  • To_date function from dual

    Hi All,
    i have issued SELECT TO_DATE('07:19:47', 'HH:MI:SS') FROM DUAL
    in toad, and got the below output.
    11/1/2007 7:19:47 AM
    Even sqlplus returns
    TO_DATE('
    01-NOV-07
    Can anyone explain why this wont show sysdate? thanks

    If I understand correctly, you're wondering why
    SELECT TO_DATE('07:19:47', 'HH:MI:SS') FROM DUALreturns a date of Nov. 1 instead of today (Nov. 2)
    Interesting - I get the same result on 10gR2. Selecting SYSDATE gives me back today's date. I tried Justin's suggestion to alter the NLS_DATE format (didn't see why RR would affect the day, but tried it anyway) but this did not affect the result.
    I think the default day the query is converting the date string to is somehow being evaluated one day behind, as sysdate
    sql>run
      1*  SELECT to_char(TO_DATE('07:19:47', 'HH:MI:SS'),'mm/dd/yyyy hh24:mi:ss') FROM DUAL
    TO_CHAR(TO_DATE('07
    11/01/2007 07:19:47.

  • Can I use dates from dual to fetch all he rows between that dates?

    I am trying to get the records that have expirations in the month of May
    What is the correct syntax to use the dates from dual to get all the rows that fall between two dates.
    I am stuck with this query..
    can any one look into it please..
    insert into RENEWALS_ALL_MAY
    select
    from
    ORIGINAL
    where
    (expiration_date between to_date(trunc(add_months (sysdate,3),'mm') from dual) and to_date(last_day(add_months (sysdate,3)) from dual))

    SQL Reference
    Supplied PL/SQL Packages and Types Reference
    For Oracle 9.2
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#80856
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/toc.htm
    For other versions see
    http://tahiti.oracle.com/

  • Error with select fnd_web_sec.URLEncrypt('hello', 'world') from dual;

    Hi Team
    WE have a EBS 11.5.10.2 with DB 11.1.0,7 on HPUX 11.23.
    And we have a error;
    APP:
    FRM-40735: ON_ERROR trigger raised unhandled exception ORA-01001
    SQL> select fnd_web_sec.URLEncrypt('hello', 'world') from dual;
    select fnd_web_sec.URLEncrypt('hello', 'world') from dual
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel
    Process ID: 10119
    Session ID: 978 Serial number: 7
    Regards,
    Guido

    Moderation:
    Stay with your original thread on this topic:
    https://forums.oracle.com/thread/2595095
    It is current and people have already tried to help you there.
    This new duplicate post is locked.

  • SELECT to_char(CURRENT_TIMESTAMP,'DD-MM-RRRR HH24:MI:SS') from dual

    Hi,
    I have a field with timestamp(6) and trying to write substitution variable for it using
         SELECT to_char(CURRENT_TIMESTAMP,'DD-MM-RRRR HH24:MI:SS') from dual
    sql works fine in sql workshop but not when i code it behind page im geting below error
    ORA-20505: Error in DML: p_rowid=5000005472, p_alt_rowid=CUS_ID, p_rowid2=1, p_alt_rowid2=CLO_ID. ORA-01830: date format picture ends before converting entire input string ORA-02063: preceding line from DBTEST_CDB
         Error     Unable to process row of table CDB_CNRCLV04
    i tried select sysdate from dual
    it worked fine but doesnt set time, time is set to 12:00:00 by default.
    can someone advice please
    Thanks

    currently selecting from table values for timestamp field arel ike
    02-NOV-07 11.23.45.550469
    07-JUL-07 09.02.42.730587
    07-JUL-07 09.02.42.730763
    07-JUL-07 09.02.42.730933
    07-JUL-07 09.02.42.731121
    02-NOV-07 11.24.00.077148
    10-AUG-07 17.24.28.325245
    20-MAY-08 00.00.00.000000
    23-MAY-08 16.00.00.000000
    thank you

  • Select sysdate from dual, why?

    I have been looking at the SQL that is generated during fetches, updates
    etc. Why is the SELECT SYSDATE FROM DUAL being executed prior to every sql
    statement being executed?
    If I had to guess I would say it has to do with locking or logging but
    don't really have a clue!
    I suppose the final question is ... how can I switch it off!
    Thanks in advance
    Matt

    Have not seen oracle just dropping connection. In any case if you are using
    oracle JDBC 2 it has error event which lets you handle error conditions plus
    PooledConnection.getConnection() raises exception if its underlying physical
    connection is dead so you can catch it and discard old PooledConnection (and
    do not return it to the pool) and create new one without error ever going to
    the user. No need for "select sysdate from dual" once in a while or god
    forbid on every getConnection() /* hope oracle handles it more efficiently
    */ I stress tested my pool implementation - running many threads on JDO
    reads and killing connections on server left and right and Kodo never saw
    killed connections - it all was handled within pool itself without anything
    like "select sysdate from dual". What I am trying to say is at least as far
    as Oracle JDBC concerned their PooledConnection takes care of this
    "Patrick Linskey" <[email protected]> wrote in message
    news:[email protected]...
    Matt,
    We issue this to validate that connections retrieved from the pool are,
    in fact, open. Oracle has a nasty habit of dropping connections (you'd
    be surprised with some of the ways that Oracle sucks...), so it tends
    to be good to do this check relatively frequently.
    The frequency at which it occurs depends on a number of factors. First,
    it depends on whether or not you are using a connection pool. I believe
    that if you do not use the conn pool, then we probably check every time
    you get a connection. Second, it depends on the setting of the
    com.solarmetric.kodo.impl.jdbc.ConnectionTestTimeout setting, which
    specifies how often to check connections for validity. I believe that
    it's a number in seconds, but I'm not 100% sure; the configuration
    section of our docs will have the right answer. Third, it depends on
    the setting of com.solarmetric.kodo.impl.jdbc.ConnectionRetainMode,
    which controls when we get connections and when we release them.
    Finally, you can turn it off altogether by setting the
    com.solarmetric.kodo.impl.jdbc.DBDictionaryProperties property to
    contain the string 'ValidateConnections=false', which will turn off
    connection validation altogether.
    -Patrick
    Patrick Linskey
    SolarMetric Inc.

  • Rip a single angle from dual-angle DVD

    I am trying to rip a single angle from a dual angle DVD we have produced. I don't want to transcode the footage, but rather just demux it to the two original elementary streams. I have tried using MPEGStreamclip, but it seems to interleave the two angles in the resulting MPEG. Anyone have any tricks to demuxing just a certain angle?

    Hi
    +1) I will get the most compression (lowest quality) if I burn it on a single layer DVD because there is less space available.+
    Not surely so. iDVD doesn't care about GBs at all - only movie duration time
    (including time for iDVD menues)
    iDVD 8 and 9 has three levels of qualities iDVD 6 has the two last ones
    for Single layer DVDs (DL - about double the time)
    • Professional Quality (movies up to 120 min.) - BEST
    • Best Performances (movies less than 60 min.) - High quality on final DVD
    • High Quality (in iDVD08) / Best Quality (in iDVD6) (movies up to 120 min.) - slightly lower quality than above
    So If Your movie is less than 120 minutes and You use a very simple menu eg "Brushed
    Metal" no animation or audio.
    Then I doubt that You'll get any better quality with DL-DVDs
    +2) If i use a dual layer DVD, the compression should be better because of the additional space.+
    Not if Your movie is less than 120 minutes. iDVD doesn't optimize after space.
    (Roxio Toast™ can do this as I understands it)
    +3) If i use a blu ray DVD and burner, I can create the least compression, possibly none (if I can reduce movie to 40gb from 41), therefore best quality (yes, I know it will only play on blu ray players).+
    No version of iDVD can address any Blue-Ray DVD burner AT ALL.
    (Roxio Toast™ can do this)
    Hopefully being of any help Yours Bengt W

  • Anonymous - SELECT user FROM DUAL;

    I am trying to populate a table field LAST_UPDATED_BY VARCHAR(15) through an APEX Form with the following valid trigger:
    CREATE OR REPLACE TRIGGER "bi_EMPLOYEES"
    BEFORE INSERT ON employees
    FOR EACH ROW
    BEGIN
    SELECT USER
    INTO :new.last_update_by
    FROM DUAL;
    END;
    The field gets populated with the value: ANONYMOUS after clicking the Apply Changes button. Can anyone tell me why?

    <<:new.last_update_by := NVL( v('APP_USER'), USER);>>
    Just to confirm, will this trigger statement also populate the DB USER on an import or insert when not using the APP?

  • When trying to sign in to iCloud from my PC I get the message "You can't sign in because of a server error"

    When trying to sign in to iCloud from my PC I get the message "You can't sign in because of a server error".
    This happens on both my Lap Top and Desk Top computers both running Windows 7.

    I also have the same problem. I've tried all fixes listed in other forums and nothing works. Running windows Vista 32 bit. Any working solutions yet? Tried every solution listed for the cmd prompt. Turned off antivirus and spyware. Rebooting about 100 times. Nothing works.

  • Yoga 3 Pro or Yoga 2 Pro? Opinions from dual owners please

    Hi,
    I'm tossing up between the Yoga 2 Pro and the Yoga 3 Pro.
    I like the design of the 3 very much, and the weight.
    I will run Ofiice apps, Photoshop CS6 on the road, and lightroom 5.7.
    Any pros and cons from dual users with experience of this software in daily use would be apprecited.
    Regards,
    David.

    I will be doing a video review on my experience soon but here are some points I can tell you already -
    1) It is a great travelling companion, movies, videos, songs, small gaming is all perfect.
    2) Battery life is really nice, I watched 3.5 hour long Lord of the rings and still had about 60% left
    3) Pretty light and rotates 360 degrees, very comfortable to use in any and every mode.
    4) Does not get hot, remains cool.
    5) Exquisite looks especially the Bright orange color, which is my fav.
    6) Screen is beautiful and everything is crisp (I use it at 1080p)
    7) Some apps are very useful like ShareIt, transfer data from android, iphone etc in seconds over a wifi network.
    8) Performance is good for browsing as well.
    9) Boots in 3-5 seconds
    10) Keyoard is backlit and very nice but shallow, trackpad is an absolute delight.
    2 finger taps, 2 finger swipes, 3 finger swipes, 2 finger zoom, 2 finger scrolling of pages, everything is smooth and responsive.
    11) Sound quality is awesome as well, very loud and clear. Enough bass to provide enjoyable experience.
    What you should not expect -
    1) Heavy graphics intensive tasks.
    2) Lags a bit on some web pages scrolling (NOT noticeable)
    3) Some software which are useless and can be uninstalled.
    I typed this whole post on my Yoga 3 Pro and it is a great for me to type on this beauty.
    Going to watch a movie now.
    Current System - Lenovo Y510P, GT755M SLI, 8GB RAM, 1TB HDD + 24GB SSD
    When your plans fail, your Real Story begins!!

Maybe you are looking for

  • Apple tv youtube ap for macbook.

    is there a youtube ap available for macbook. I want the same function as you have with the ipad, or iphone. It would be much easier to find youtube stuff by typing on the computer then using the single letter function on apple tv.

  • IDVD and severe limits

    Wow, talk about surprised. I just got an external DVD burner (should have bought the internal Superdrive, I know) for professional uses and so far can only see the limits of iDVD. My needs are simple - convert photography for commercial or bridal cli

  • Which is better for mbp 15" -- the 6X8 or 6X11 wacom intuos tablet???

    hey guys i have a 15 inch mac book pro im planning on getting a wacom intuos tablet which would be best for it and for the screen proportions -- the 6X8 or 6X11?? thankyou

  • Dockable Windows: New Features Guide for SAP PowerBuilder 12.6

    I copied the example in the SAP document: PowerBuilder-NewFeatures.pdf at page 21. 4.2.7 Opening Docked Windows and Tabbed Document Windows Sample code for opening docked windows and tabbed documents. Context Procedure 1. Create a window w_sheet_any

  • PreparedStatement set date sometimes sets the date one day behind

    I have a PreparedStatement that sometimes sets the date a day behind. I am saving to a MSSQL DB with a field datetime. I have two identical PreparedStatments, one for insert and one for update. When either is executed, it will sometimes set the date