Need milli seconds part in XSLT Date Function  current-dateTime()

Hi All,
I am calling date function, current-dateTime() in XSL. The output format is 2012-04-05T16:38:01-07:00 (Without milli seconds)
How to get the milli seconds part...?
Regards,
Sudheer

Hi Arik....
At last i got it. :)
Followed the below steps.
Step1:
Created a String variable "currentDateTimeValue" in BPEL.
Step2:
I have used the below code in JavaEmbedding in BPEL.
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat();
//Date Pattern looks lil weird. But some Web service accepts only this format.
sdf.applyPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'-00:00'");//2012-04-14T16:24:00.578-00:00
String formattedDate = sdf.format(new java.util.Date());
addAuditTrailEntry("Formatted datetime string is: " + formattedDate);
setVariableData("currentDateTimeValue", formattedDate);
Step3:
Created a Simple XSD with an element "DateElement" of String type.
Step4:
Assigned "currentDateTimeValue" value to "DateElement" element, in Assign activity.
Step5:
Now added this DateElement in Transformation activity, as a second source variable. Mapped this data to the required target element in my XSL.
uh-huh I got the output...
Thanks a ton ARIK :D u r really helpful...
Regards,
Sudheer

Similar Messages

  • How to get accurate date on current-dateTime function?

    I am new to oracle ESB. Using a DBAdapter, was trying to populate a table row column with sysdate. So, used current-dateTime in xsl mapping. Works well, I can insert time, but this time is always 1 hour greater than current time. Is there something I need to do without substracting 1 hour from it?
    We have the server & the application running in the same time zone.
    Please suggest.

    ESB is always trouble when trying to debug these issues.
    If you go to enterprise manager. When you login you should see a link to oc4j_soa, select this. If not select home.
    Select the Administration tab.
    Select the Logger Configuration link.
    search on esb, make sure it is lower case.
    Find the entry oracle.tip.esb.server.service, make change the logging level to fine.
    This should display the variables being passed in the xml.log file.
    Is the time zone the same as the database?
    Its looking like you might have to raise a SR for this as the application should not be changing the time.
    cheers
    James

  • Help XSLT Data Mapper and Transformations

    Hi guys,
    I need help in oracle ESB (XSLT Data Mapper and Transformations). I need to use the XSLT Data Mapper and Transformations using Response XML to Request XML.
    Thanks
    Vyas

    The concept is the same as BPEL. Without going into too much detail have a look at the folowing tutorial.
    http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28212/buildendtoend.htm#BEICEFJD
    Near the bottom they show how to do transformations.
    cheers
    James

  • Current datetime in xslt

    Hi ,
    I want to get the current datetime during my xlst tranform. I used the below codes but can not get it .
    xslt 1.0
    <xsl:stylesheet ...
    xmlns:ex="http://exslt.org/dates-and-times" extension-element-prefixes="ex">
    <xsl:value-of select="ex:date-time()"/> ...
    </xsl:stylesheet>
    error i got: the function date-time() can not be found.
    xlst 2.0
    <xsl:value-of select="current-dateTime()"/>
    error i got : the function current-dateTime() can not be found.
    Does anyone know how i can solve this problem? Any example or suggestion is welcomed.
    Thanks in advance.
    Dennis

    If that piece of xslt has any chance to succeed, you have to do either one of the modification.
    [1] Either you change the version attribute to 2.0. Oracle xslt processor is one of the earliest to get xslt 2.0 support at the time it is still a working draft. I think current-dateTime() xslt 2.0 function should be supported.
    <xsl:stylesheet version="2.0"[2] There are quite a bit of oracle proprietary extensions there. Hence, if you understand the suggestion(s) all along, it should do the task without appealing to the other extensions which may have their own functions to get the current date-time. This is how you should do for a test, keeping the version="1.0" unchanged.
    <xsl:stylesheet version="1.0"
    xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
    xmlns:ns0="http://www.example.org"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    exclude-result-prefixes="xsl xsd ns0 xref xp20 bpws ora ehdr orcl ids hwf date ">
    <xsl:template match="/">
    ...etc
    <TimeStamp><xsl:value-of select="date:toString(date:new())"/></TimeStamp>
    ...etc
    </xsl:template>

  • Shuttle - how can I insert data in database from second part of shuttle ?

    I have read it: http://apex.oracle.com/pls/otn/f?p=35253:1:2820687553996558::NO but I don't understand shuttle.
    My shuttle name is 'P3_SHUTTLE'. I have created shuttle by clicking (Create Item -> Shuttle -> next -> etc.). In first part of shuttle I have all elements from some table in database. In second part of shuttle I have choiced elements from first part of shuttle (as in each normal simply shuttle). I would like insert elements from second part of shuttle when somebody clicked button (which I have created). I have created process for this button type PL/SQL anonymous block. In field source of this process I have written:
    DECLARE
    BEGIN
    FOR z in 1..htmldb_application.g_f02.count loop
    INSERT INTO books(id_book) VALUES(htmldb_application.g_f02(z));
    END LOOP;
    END;
    but it doesn't work (I don't know what is 'htmldb_application.g_f02.count' - it was in yours example).
    So I have tried:
    DECLARE
    BEGIN
    FOR z in 1..P3_SHUTTLE.pSQL_2.count loop
    INSERT INTO books(id_book) VALUES(P3_AKTORZY.pSQL_2(z));
    END LOOP;
    END;
    P3_SHUTTLE it is name of my shuttle
    but this code also doesn't work :( HELP please :(
    Edited by: user10728391 on 2008-12-19 01:17
    Edited by: user10728391 on 2008-12-19 01:18

    I have APEX 3.1.2.
    I have tried:
    DECLARE
    l_selected HTMLDB_APPLICATION_GLOBAL.VC_ARR2;
    BEGIN
    l_selected := HTMLDB_UTIL.STRING_TO_TABLE(HTMLDB_APPLICATION.G_F02(1));
    FOR I IN 1..l_selected.count
    LOOP
    INSERT INTO BOOKS (ID_BOOK) VALUES (l_selected(I));
    END LOOP;
    END;
    It doesn't work. I have and error: 'No data found'. But you have written about name attribute. In view of code my page with shuttle I have that code about second part of shuttle:
    <td class="shuttleSelect2">
    <select multiple="multiple" name="p_v03" size="10" id="P3_SHUTTLE_RIGHT" ondblclick="g_Shuttlep_v03.remove()">
    <option value="5">Aaa Aaa</option>
    <option value="2">Bbb Bbb</option>
    <option value="1">Eee Eee</option>
    </select>
    </td>
    So I have tried in above code use: HTMLDB_APPLICATION.G_p_v03 and HTMLDB_APPLICATION.p_v03 but I have an error:
    'G_P_V03' must be declared or 'P_V03' must be declared :(
    Edited by: user10728391 on 2008-12-19 02:35

  • Date function in XSLT

    Hi All,
    I am trying to use date function in XSLT, I am using the below code, please correct me if i am wrong
    <corecom:EffectiveDate>
    <xsl:value-of select='xp20:format-dateTime(ns0:Segment-DTM/ns0:Element-373,"[YYYY][M01][D01]")'/>
    </corecom:EffectiveDate>
    Regards
    Francis

    Hi Francis,
    It doesn't seem to be anything wrong with the code itself, but what's the content of ns0:Segment-DTM/ns0:Element-373 ???
    The xp20:format-dateTime function will work if the date on the first parameter is on ISO 8601 format...
    http://www.w3.org/TR/NOTE-datetime
    Examples
    1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.
    1994-11-05T13:15:30Z corresponds to the same instant.
    Cheers,
    Vlad

  • Need 'Creation Date' function in '09

    I'm looking for a formula that automatically generates the date in a cell, when data is entered in an adjacent cell. Currently, whenever data is entered into A1 for example, B2 displays the current date using the 'TODAY' function, but that will change to the current day automatically. I need it to show the day data was entered into A1, and stay that way. Any suggestions?
    Thanks!

    Here is the beast
    --[SCRIPT store_CreationDate]
    Enregistrer le script en tant qu'Application ou Progiciel : store_CreationDate.app
    déplacer l'application créée dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Placez le curseur dans la cellule que vous souhaitez alimenter.
    menu Scripts > Numbers > store_CreationDate
    La cellule pointée reçoit la chaîne saisie
    La cellule située à sa droite dans la ligne inférieure reçoit la date_heure de l'intervention.
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    +++++++
    Save the script as an Application or an Application Bundle: store_CreationDate.app
    Move the newly created application into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Put the cursor in the cell which must receive your entry.
    menu Scripts > Numbers > store_CreationDate
    The pointed cell receives the entered string.
    The cell on its right in the row below receive the current date_time.
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    Yvan KOENIG (Vallauris, FRANCE)
    16 février 2009
    property theApp : "Numbers"
    --=====
    on run
    set {rname, tName, sName, dName} to my getSelection()
    if rname is missing value then
    if my parleFrancais() then
    error "Pas de cellule sélectionnée !"
    else
    error "No selected cell !!"
    end if
    end if -- rname
    set twoNames to my decoupe(rname, ":")
    set {colNum1, rowNum1} to my decipher(item 1 of twoNames)
    if item 2 of twoNames = item 1 of twoNames then
    set {colNum2, rowNum2} to {colNum1, rowNum1}
    else
    set {colNum2, rowNum2} to my decipher(item 2 of twoNames)
    end if
    tell application (path to frontmost application as string)
    if my parleFrancais() then
    set rate to text returned of (display dialog "Contenu de la cellule…" default answer "blabla bla")
    else
    set rate to text returned of (display dialog "Cell's contents" default answer "blabla bla")
    end if
    end tell
    my doYourDuty(colNum1, rowNum1, tName, sName, dName, rate)
    end run
    --=====
    on doYourDuty(c, r, t, s, d, txt) (*
    c = columnIndex
    r = rowIndex
    t = table's name
    s = sheet's name
    d = document's name
    txt = new cell's contents *)
    local cdt
    set cdt to my cleanThisDate(current date) (* the new date_time as a clean date_time *)
    tell application "Numbers" to tell document d to tell sheet s to tell table t
    set value of cell r of column c to txt
    set value of cell (r + 1) of column (c + 1) to (cdt as text)
    (c+1) to put in the column on the right
    (r+1) to put in the row below *)
    end tell -- application …
    end doYourDuty
    --=====
    on cleanThisDate(dt)
    (* ugly code but once I got date_time with milliseconds so if necessary, I drop them *)
    local L
    set L to my decoupe(dt as text, ":")
    if (count of L) = 4 then
    set dt to date (my recolle(items 1 thru 3 of L, ":"))
    end if
    return dt
    end cleanThisDate
    --=====
    on getSelection()
    local mySelectedRanges, sheetRanges, thisRange, _, myRange, myTable, mySheet, myDoc, mySelection
    tell application "Numbers" to tell document 1
    set mySelectedRanges to selection range of every table of every sheet
    repeat with sheetRanges in mySelectedRanges
    repeat with thisRange in sheetRanges
    if contents of thisRange is not missing value then
    try
    thisRange as text
    on error errMsg number errNum
    set {_, myRange, _, myTable, _, mySheet, _, myDoc} to my decoupe(errMsg, quote)
    return {myRange, myTable, mySheet, myDoc}
    end try
    end if -- contents…
    end repeat -- thisRange
    end repeat -- sheetRanges
    end tell -- table of sheet of document of application
    return {missing value, missing value, missing value, missing value}
    end getSelection
    --=====
    on decipher(n)
    local colNum, rowNum, letters
    set letters to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    if (character 2 of n) as text > "9" then
    set colNum to (offset of (character 1 of n) in letters) * 64 + (offset of (character 2 of n) in letters)
    set rowNum to (text 3 thru -1 of n) as integer
    else
    set colNum to offset of (character 1 of n) in letters
    set rowNum to (text 2 thru -1 of n) as integer
    end if
    return {colNum, rowNum}
    end decipher
    --=====
    on decoupe(t, d)
    local L
    set AppleScript's text item delimiters to d
    set L to text items of t
    set AppleScript's text item delimiters to ""
    return L
    end decoupe
    --=====
    on recolle(L, d)
    local t
    set AppleScript's text item delimiters to d
    set t to L as text
    set AppleScript's text item delimiters to ""
    return t
    end recolle
    --=====
    on parleFrancais()
    local z
    try
    tell application theApp to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z = "Annuler")
    end parleFrancais
    --=====
    --[/SCRIPT]
    Yvan KOENIG (from FRANCE lundi 16 février 2009 17:23:29)

  • HT204365 Hi  I wonder if you could please assist me. I tried the online 'contact us" I  chose my iPad - but when I need to chose the second part - it does not give  me any options - hence I cannot go further?   My kindle does not want to open on my iPad.

    Hi
    I wonder if you could please assist me. I tried the online 'contact us" I
    chose my iPad - but when I need to chose the second part - it does not give
    me any options - hence I cannot go further?
    My kindle does not want to open on my iPad. When I touch it - a grey screen
    with kindle written in the middle appear for a few seconds. Then goes away.
    I have restarted the iPad - still the same? What else can I do?
    Thanks
    Maryna

    Judging by the reviews of the current version of the Kindle app you aren't the only one haveing problems with it - it looks like Amazon need to fix something with the app.
    Have you tried closing the Kindle app via the iPad's multitasking bar and seeing if it works when you re-open it ? Double-click the home button to open the taskbar, and then swipe or drag the Kindle app's screen from there up and off the top of the screen to close it, and click the home button to close the taskbar.
    You could also try deleting the app and redownloading it via the Purchased tab in the App Store app on it (you will then need to redownload your books in the app, assuming that it opens).

  • Print date with milli seconds

    I want to print the sysdate with milli seconds also
    Please help me

    Hi
    I also have come up with the same requierment. But we
    are not to use the SYSTIMESTAMP. Is it possible to
    get miliseconds info using SYSDATE only?
    I have tried to search on SQL User guide, they give
    their date and time element formats like 'mm/dd/rrrr
    hh24:mi;ss:ff' but the format mask :ff works only for
    the timestamp variable like SYSTIMESTAMP not for
    SYSDATE or date variables.
    Thanks
    regards
    AbhivyaktiHi,
    They are correct. Read a bit more about DATE and TIMESTAMP and you will clearly see why you can't have milliseconds on a simple DATE datatype.
    hth,
    Guido

  • Converting time stamp in SECONDS to a calendar date format.. problems

    Hello. I'm trying to convert a long interger that represents the number of SECONDS passed since the 1970 date
    the number was originally generated by php's mktime() function
    one of the numbers I have for example is this : 1126933200
    I haven't done the math but this is a date probably around september of 2005.. it's irrelevant anyhow.
    I want to convert this to a date format I can use in java. I've tried to create a new date like so :
    Date date = new Date(1126933200);
    I've also tried it with the calendar method like so :
    Calendar calendar = new GregorianCalendar();
    calendar.setTimeInMillis(1126933200);
    it was only then that I realized that both these methods require the number of MILLI seconds. So I tried doing a simple multiplication by 1000 on my original number and then I started getting a "integer number too large" error when trying to compile.
    so i'm kind of at a loss here.. i figure I could make a function myself that would divide my number in days of 86400 seconds.. and then i'd have to keep in mind the bisectal (sp) and the months with more and less days etc.. but i'm sure there must be an easier way.
    and i don't get why a method who's meant to receive a very long number is giving me an error when i try to give one to it.
    your help is appreciated as always. thanks

    Hello. I'm trying to convert a long interger that
    represents the number of SECONDS passed since the
    1970 date
    the number was originally generated by php's mktime()
    function
    one of the numbers I have for example is this :
    1126933200
    I haven't done the math but this is a date probably
    around september of 2005.. it's irrelevant anyhow.
    I want to convert this to a date format I can use in
    java. I've tried to create a new date like so :
    Date date = new Date(1126933200);
    I've also tried it with the calendar method like so
    Calendar calendar = new GregorianCalendar();
    calendar.setTimeInMillis(1126933200);
    it was only then that I realized that both these
    methods require the number of MILLI seconds. So I
    tried doing a simple multiplication by 1000 on my
    original number and then I started getting a "integer
    number too large" error when trying to compile.So you needed to add L to one of the numbers.
    Note you also need to define what timezone that seconds number represents.
    With Gregorian it is going to use the local timezone (the code here will anyways). The code using Date is using the UTC timezone.

  • Query to find the difference between the last date and the second to the last date

    Hi all,
    Hope all is well.
    I am working on the following problem because I am trying to improve my MS SQL skills. But I am stuck at the moment and I wonder if you could provide some assistance please. Here is the issue:
    Table 1: Dividends
    divId
    ExDate
    RecordDate
    PayDate
    Amount
    Yield
    symId
    1
    2013-02-19
    2013-02-21
    2013-03-14
    0.23
    0.00000
    3930
    2
    2012-11-13
    2012-11-15
    2012-12-13
    0.23
    0.00849
    3930
    3
    2012-08-14
    2012-08-16
    2012-09-13
    0.20
    0.00664
    3930
    4
    2012-05-15
    2012-05-17
    2012-06-14
    0.20
    0.00662
    3930
    5
    2012-02-14
    2012-02-16
    2012-03-08
    0.20
    0.00661
    3930
    6
    2011-11-15
    2011-11-17
    2011-12-08
    0.20
    0.00748
    3930
    7
    2011-08-16
    2011-08-18
    2011-09-08
    0.16
    0.00631
    3930
    8
    2011-05-17
    2011-05-19
    2011-06-09
    0.16
    0.00653
    3930
    9
    2011-02-15
    2011-02-17
    2011-03-10
    0.16
    0.00594
    3930
    10
    2010-11-16
    2010-11-18
    2010-12-09
    0.16
    0.00620
    3930
    11
    2010-08-17
    2010-08-19
    2010-09-09
    0.13
    0.00526
    3930
    12
    2010-05-18
    2010-05-20
    2010-06-10
    0.13
    0.00455
    3930
    13
    2010-02-16
    2010-02-18
    2010-03-11
    0.13
    0.00459
    3930
    Table 2: Tickers
    symId
    Symbol
    Name
    Sector
    Industry
    1
    A
    Agilent Technologies Inc.
    Technology
    Scientific & Technical Instruments
    2
    AA
    Alcoa, Inc.
    Basic Materials
    Aluminum
    3
    AACC
    Asset Acceptance Capital Corp.
    Financial
    Credit Services
    4
    AADR
    WCM/BNY Mellon Focused Growth ADR ETF
    Financial
    Exchange Traded Fund
    5
    AAIT
    iShares MSCI AC Asia Information Tech
    Financial
    Exchange Traded Fund
    6
    AAME
    Atlantic American Corp.
    Financial
    Life Insurance
    7
    AAN
    Aaron's, Inc.
    Services
    Rental & Leasing Services
    8
    AAON
    AAON Inc.
    Industrial Goods
    General Building Materials
    9
    AAP
    Advance Auto Parts Inc.
    Services
    Auto Parts Stores
    10
    AAPL
    Apple Inc.
    Technology
    Personal Computers
    11
    AAT
    American Assets Trust, Inc.
    Financial
    REIT - Office
    12
    AAU
    Almaden Minerals Ltd.
    Basic Materials
    Industrial Metals & Minerals
    I am trying to check the last date (i.e. max date) and also check the penultimate date (i.e. the second to the last date).  And then find the difference between the two (i.e. last date minus penultimate
    date).
    I would like to do that for each of the companies listed in Table 2: Tickers.  I am able to do it for just one company (MSFT) using the queries below:
    SELECT
    [First] = MIN(ExDate),
    [Last] = MAX(ExDate),
    [Diff] = DATEDIFF(DAY, MIN(ExDate), MAX(ExDate))
    FROM (
    SELECT TOP 2 Dividends.ExDate
    FROM Dividends, Tickers
    WHERE Dividends.symId=Tickers.symId
    AND Tickers.Symbol='MSFT'
    ORDER BY ExDate DESC
    ) AS X
    Outputs the following result:
    First
    Last
    Diff
    2012-11-13
    2013-02-19
    98
    But what I would like instead is to be able to output something like this:
    Symbol
    First
    Last
    Diff
    MSFT
    2012-11-13
    2013-02-19
    98
    AAN
    2012-11-13
    2012-12-14
    1
    X
    2012-11-13
    2012-12-14
    1
    Can anyone please let me know what do I need to add on my query in order to achieve the desired output?
    Any help would be greatly appreciated.
    Thanks in advance. 

    Could you try this?
    create table Ticker (SymbolId int identity primary key, Symbol varchar(4))
    insert into Ticker (Symbol) values ('MSFT'), ('ORCL'), ('GOOG')
    create table Dividend (DividendId int identity, SymbolId int constraint FK_Dividend foreign key references Ticker(SymbolId), ExDate datetime, Amount decimal(18,4))
    insert into Dividend (SymbolId, ExDate, Amount) values
    (1, '2012-10-1', 10),
    (1, '2012-10-3', 1),
    (1, '2012-10-7', 7),
    (1, '2012-10-12', 2),
    (1, '2012-10-23', 8),
    (1, '2012-10-30', 5),
    (2, '2012-10-1', 10),
    (2, '2012-10-6', 1),
    (2, '2012-10-29', 7),
    (3, '2012-10-1', 22),
    (3, '2012-10-3', 21),
    (3, '2012-10-7', 3),
    (3, '2012-10-12', 9)
    WITH cte
    AS (SELECT t.Symbol,
    d.ExDate,
    d.Amount,
    ROW_NUMBER()
    OVER (
    partition BY Symbol
    ORDER BY ExDate DESC) AS rownum
    FROM Ticker AS t
    INNER JOIN Dividend AS d
    ON t.SymbolId = d.SymbolId),
    ctedate
    AS (SELECT Symbol,
    [1] AS maxdate,
    [2] AS penultimatedate
    FROM cte
    PIVOT( MIN(ExDate)
    FOR RowNum IN ([1],
    [2]) ) AS pvtquery),
    cteamount
    AS (SELECT Symbol,
    [1] AS maxdateamount,
    [2] AS penultimatedateamount
    FROM cte
    PIVOT( MIN(Amount)
    FOR RowNum IN ([1],
    [2]) ) AS pvtquery)
    SELECT d.Symbol,
    MIN(MaxDate) AS maxdate,
    MIN(penultimatedate) AS penultimatedate,
    DATEDIFF(d, MIN(penultimatedate), MIN(MaxDate)) AS numberofdays,
    MIN(MaxDateAmount) AS maxdateamount,
    MIN(penultimatedateAmount) AS penultimatedateamount,
    MIN(MaxDateAmount) - MIN(penultimatedateAmount) AS delta
    FROM ctedate AS d
    INNER JOIN cteamount AS a
    ON d.Symbol = a.symbol
    GROUP BY d.Symbol
    ORDER BY d.Symbol
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers.
    Thanks!
    Aalam | Blog (http://aalamrangi.wordpress.com)

  • Help with Date function in sql query....

    My question I guess is really 2...I'm trying to use the date function as a comparison in my WHERE clause in my sql command.
    1. My date format is dd-MMM-yy eg. (01-Apr-06) ... my problem is the Apr is lower case where my field in the database is 01-APR-06 so when I compare 01-Apr-06 to 01-APR-06 is doesnt find any rows. Is there away that I can make the Apr all upper case so that it is APR.
    2. My second problem is getting this "date" field to work in my sql stmt I keep getting errors and it works fine if I take my attempts at trying to compare the date.
    --------------Date Code----------------------------------------------------------
    <%!
    String getFormattedDate(java.util.Date d)
    SimpleDateFormat simpleDate = new SimpleDateFormat("01-MMM-yy");
    return simpleDate.format(d);
    %>
    <%
    java.util.Date d = new java.util.Date();
    String dateString = getFormattedDate (d);
    %>
    ---------------------------Sql statment------------------------------------------
    ResultSet rset = stmt.executeQuery ("SELECT name " + " FROM table where rdate = '01-APR-06' order by name ");
    Currently Im just hard coding the date but I need to make it so it uses the date code...so....
    rdate should equal the date from the formatted date in upper case
    something like
    rdate = <%= dateString %>
    Thanks in advance for any ideas anyone may have...

    There are sql functions upper & lower.
    SELECT name  FROM table where upper(rdate) = '01-APR-06' order by name Or you could convert the date to a string, and use the toUpperCase & toLowerCase java.lang.String methods. It doesn't make much of a difference--do you want the java compiler to do the string conversion or the database?

  • IS_Data Insight View Data Function Limitation

    Hi Experts,
    Is there any limitation to view data of a table using View Data function in Data Insight module in Information Steward. I come across a strange issue with this, the details are explained below.
    I am trying to perform Data profiling on table, as part of this I imported table into a Data Insight project. When i tried to view data of a table using View Data function, it is showing blank like (0 from 998987). I am able able to see data in database and even in DS designer too.
    Then i created a view on top of this table by selecting all columns and tried to view data, again showed blank. Then i removed some columns in view and tried, now it showed data. The table contains 150 columns, I used around 110 columns in view.
    My question here is, is there any limitations in Data Insight for viewing data apart 500 records. Will View Data function consider the number of Rows or the size of data to display the data. If it consider these two, is there any option available in IS to control these two parameters i.e., increase / decrease the size or no of rows.
    If anyone come across with this issue, could you please help me if any solutions to fix this.
    Thanks,
    Ramakrishna Kamurthy

    Hello Rama,
    In IS 4.2 this limitation is actually stated.
    See here: IS_421_user_en.pdf in Related Information section pg 44 which states that:
    The software displays only 500 records when you view data from an SAP table. 
    Also more details available in section: 2.5.10.2 Limit of 500 records when viewing data from SAP tables.
    The software displays only 500 records when you view data from an SAP table.
    Views that contain SAP tables have the potential to be quite large, especially when they are joined with other SAP tables. The limit of 500 records when viewing data prevents your computer from hanging or never completing the task because the tables were too large.
    In addition to the 500 records limit, you can take steps to enhance performance in the following ways:
    ● Reduce the size of the file by mapping fields, join conditions, filters, and so on to limit the data in the table to information that you really need.
    ● Use SAP ABAP-supported functions in forming expressions in views. Using non-supported functions is allowed, but doing so may adversely affect performance.
    ● Use the View Data filter tools when you view and export data from SAP tables.
    With the 500 records limit for viewing SAP table data, there is a potential for no records showing up in the View Data window.
    This could happen, for example, when the view contains a child view, the child view contains one or more SAP tables, and a join is set up to join the entire data set.
    A message appears at the top of the View Data window that instructs you to export the data to an external source (text file, CSV, or Excel file) to view all of the records.
    I hope this is helpful.
    Mike

  • Date function in DI

    Hi all
    I need to get only date part of the a global value which is of DateTime type. I checked the DI functions, but couldn't find what I was looking for there. Date_part function returns part of the date value in int format, but I need it as a DateTime type but just without time part. I tested a few ways, but didn't work. For example I have '2009-05-01 12:58:00.000' , but I wan to have '2009-05-12' as a date.
    But how?
    Thank you.

    A variable of type datetime always has a time associated with it, but you can 'drop' the time component (i.e. set it to all zeros) using to_char.  For example:
    #Print Sysdate with associated time component
    print(sysdate());
    #Print sysdate with time dropped
    print(to_char(sysdate(),'YYYY.MM.DD'));

  • Need help in laoding flat file data, which has \r at the end of a string

    Hi There,
    Need help in loading flat file data, which has \r at the end of a string.
    I have a flat file with three columns. In the data, at the end of second column it has \r. So because of this the control is going to the beginning of next line. And the rest of the line is loading into the next line.
    Can someone pls help me to remove escape character \r from the data?
    thanks,
    rag

    Have you looked into the sed linux command? here are some details:
    When working with txt files or with the shell in general it is sometimes necessary to replace certain chars in existing files. In that cases sed can come in handy:
    1     sed -i 's/foo/bar/g' FILENAME
    The -i option makes sure that the changes are saved in the new file – in case you are not sure that sed will work as you expect it you should use it without the option but provide an output filename. The s is for search, the foo is the pattern you are searching the file for, bar is the replacement string and the g flag makes sure that all hits on each line are replaced, not just the first one.
    If you have to replace special characters like a dot or a comma, they have to be entered with a backslash to make clear that you mean the chars, not some control command:
    1     sed -i 's/./,/g' *txt
    Sed should be available on every standard installation of any distribution. At lesat on Fedora it is even required by core system parts like udev.
    If this helps, mark as correct or helpful.

Maybe you are looking for

  • Page Number Disappesrs when click on Reset button in Dynamic Form

    Dear all, In dynamic forms I have taken Page n of m field outside the content area in master pages.I have added the reset button in body pages of the form.In the pdf When I click on Reset button the page nos are disappearing along with the other data

  • SQL Worksheet Gets Slower and S.l..o...w....e.....r with Use

    Does anyone else notice the more you use SQL Worksheet, the slower it gets? The first time I start it up, it'll run a compile on an object super-fast. After running a dozen or more compiles and test scripts, I notice it's getting slower. Eventually,

  • Replace Non-Numeric Characters with a Numeric Character in a String

    Hi Guys, I need to replace all the non-numeric characters (including embedded blanks & hyphen) in a string to a numeric character '1'. The trailing blanks should not be replaced. e.g. "P22233344455566" should be changed to "122233344455566" &    "49-

  • How do i put my music in iCloud?

    I see no way to put my 4000 plus songs in the Cloud. So far, I'm sticking with Amazon's Cloud. Much more intuitive-and-easy to use. Plus ALL my music is stored FREE (over 20 GB). Apple has lost me here, unless I can easily upload my music. I only see

  • Cost Center -- Automatic Cost Allocation

    Hi at all, 1. We receive a monthly invoice for electricity etc. 2. We put the hole amount in one Cost Center. 3. At the end we allocate the amount manually to each relevant Cost Center/Department. From A $100.000 To S $50.000 To T $40.000 To Z $10.00