Substring returns data and garbage

I have a line of xsl that uses a substring function like this:
<xsl:value-of select="substring(string(DepartureDay),7,2)"/>
DepartureDay is an element that looks like 20000515 (for 15 May 2000).
I try to extract the 15 from the string and I get it but I get as well some garbage after the 15 like this: 20X.X
This is just an example as the garbage varies in content and length every time I run the xslt.
Is this a bug of the Oracle parser or am i doing something wrong?
Thanks
null

Hi,
The XPath string function converts the number argument into a string containing some leading white spaces. So the substring does not work as you expected. You should use format-number function in XSLT for number-string conversion as noted in XPath: "The string function is not intended for converting numbers into strings for presentation to users."
Thanks,
Oracle XML Team

Similar Messages

  • Pause until return date and time

    I have a Motor vehicle Request list in SharePoint 2013 were users will log a vehicle request, in that list the is a departure date and time and return date and time.
    I want to pause the workflow until return date and time, I tried using the "Pause for" its just gave me an error tired the Pause until its just pause and don't continue
    Any solution for this
    Would Appreciate any help
    P.Michelle

    check this
    http://www.smellslikesharepoint.com/2012/06/26/sharepoint-2010-workflow-pause-until-date-and-time/
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/af5b8c79-f167-4780-8dba-d603b94896ff/workflow-stucks-in-progress-when-using-a-pause-until-date?forum=sharepointgeneralprevious

  • How to parse system date to return Date and in yyyy-MM-dd format?

    DateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd");
    java.util.Date date = new java.util.Date ();
    String dateStr = dateFormat.format (date);
    try{
    Date date2 = dateFormat.parse (dateStr);
    }catch(ParseException pe){
    pe.printStackTrace();
    Actually, After parsing the date from string, again it is converted into dfault format i.e. 21 Jan 00.00.00 etc...
    But I want this parsing date in yyyy-MM-dd format and again to return date.
    Can anybody tell me how to do this?

    DateFormat dateFormat = new SimpleDateFormat
    ("yyyy-MM-dd");
    java.util.Date date = new java.util.Date ();
    String dateStr = dateFormat.format (date);
    try{
    Date date2 = dateFormat.parse (dateStr);
    }catch(ParseException pe){
    pe.printStackTrace();
    Actually, After parsing the date from string, again
    it is converted into dfault format i.e. 21 Jan
    00.00.00 etc...
    But I want this parsing date in yyyy-MM-dd format and
    again to return date.
    Can anybody tell me how to do this?A Date object does not have a format, it represents a moment in time. You can use SimpleDateFormat to return a String representing that moment in time in many formats - this does not change the Date object to have that format (which it cannot since it does not contain a format).

  • Security deposit return date

    Hello everyone,
    I would like to know that in security deposit what is the relation between start date date and return date and also how return date is moved accordingly with start date ?
    Can any one guide me on these queries..??
    Best Regards,
    Shruti

    Shruti:
    The start date for a cash security is initialy populated at creation but is updated at time of payment (this setting can be turned off in configuration).  This field is meant to identify the date at which the deposit was received.
    The return date is also populated at creation.  Posting area 0800 controls the default value for the return date population.  The return date, having been set, can now be used in automatic deposit monitoring to determine when a deposit might be released/returned to the customer.
    regards,
    bill.

  • Choosing a value based on newest date, and newest value

    Good Afternoon,
    I'm in search of help on a statement Im trying to perform in a Query transform in my ETL. So this is the scenario. I have a Value called SGSGVL which is "CYW" and in our descriptions table for the VALUE CYW we have 3 different Descriptions like Cadium Yellow, Cadium Yellow Paint and CDM Yellow and the date the description was added. What I would like to do is say:
    Where in the description table = CYW, select the newest date and the most used value.
    I've been told I can use a MAX statement but Im unsure exactly how to perform this in the query transform. Can anyone help? It would be GREATLY appreciated!
    Thanks!

    You won't be able to do what you are asking in one query transform - it is complicated due the fact that you need your "max" to be based on something other than the column you want returned (date and count, versus the description). Essentially, what you need to do is:
    QUERY1: value, description, field named REC_CNT with mapping of count(*), field named MAX_DATE with mapping of max(date), group by value and description
    QUERY2: reads from QUERY1 --> value, field named MAX_REC which has a mapping such as: max(lpad(REC_CNT,'0',5) || '_' || to_char(date,'YYYYMMDD')), and group by value only
    QUERY3: also reads from QUERY1 --> value, description, field named THIS_REC which has mapping such as: lpad(REC_CNT,'0',5) || '_' || to_char(date,'YYYYMMDD'), no group-by
    QUERY4: joins QUERY2 and QUERY3 on QUERY2.MAX_REC = QUERY3.THIS_REC. Pull the value and description from QUERY3.
    Basically - QUERY2 gives you the list of records which are considered the max, and QUERY3 gives you the full list with the same column to be able to join on, so QUERY4 pulls the descriptions only for the max record.
    -Trevor

  • Function Module to get Date and Time out of Timestamp

    Hi,
    Source system timestamp field CREATED_TS of Type DEC-15
    BW PSA data in format 20.140.707.105.948
    In DSO, I have created two target InfoObjects; one for Date and one for Time.
    In transformation from PSA to DSO, in field level routine, I want to split timestamp into Date and Time.
    There is a function module CACS_TIMESTAMP_GET_DATE in source system but it is not available in BW. Another function module ADDR_CONVERT_TIMESTAMP_TO_DATE which is available in BW but returns only Date. 
    Does anyone know a function module in BW which takes Timestamp (PSA data in format 20.140.707.105.948) and returns Date and Time.
    Much better would be a FM which take timestamp and also Timezone  and returns Date and Time.
    Thanks
    Ahmad

    Timestamp to date time conversion (with time zone) is built into ABAP. Why use a function module?
    Read the ABAP help on CONVERT.

  • Getting Date and Time

    Hi Gurus,
    Issue: At present the Shipment Execution time is defaulting to Local Time but the requirement is to always populate Eastern Standard Time (EST). Right now if the shipment creates in US West coast, shipment Execution Date and Time populates with that local time but I need to populate EST.
    I need a function module which will take input as 'Time Zone' like EST and return Date and Time (OR) the input could be 'Country' and State and return the local time.
    Thanks in Advance.
    Regards,
    ananth.

    Here is your solution.
    The function module IB_CONVERT_INTO_TIMESTAMP is used to convert the time to the GMT. The input parameters are DATE, TIME and the TIMEZONE(user's time zone, default value SY-ZONLO). The output parameter is the timestamp in GMT.
    The function module IB_CONVERT_FROM_TIMESTAMP is used to get the time in required time zone. The input parameters for this are the timestamp obtained from the above function module and the time zone, to which the time needs to be converted.
    The output parameters are the date, time in the required time zone.

  • [ASK] How to get system date and substring / concate in data manager dynami

    Hello guys.
    I want to run package DM with the input have default value.
    The selection is look like this :
    Dimension : CATEGORY
    Source : PLAN_2011
    Destination : FORECAST_2011
    Dimension : TIME
    Source : 2011.JAN,2011.FEB,2011.MAR,2011.APR,2011.MAY,2011.JUN,2011.JUL,2011.AUG,2011.SEP,2011.OCT,2011.NOV,2011.DEC
    Destination : <same>
    How to get system date year and do the substring / concate ?
    So dimension category source will be PLAN_<YYYY>, destination = FORECAST_<YYYY>
    Dimension source = <YYYY>.JAN,<YYYY>.FEB,<YYYY>.MAR,<YYYY>.APR,<YYYY>.MAY,<YYYY>.JUN,<YYYY>.JUL,<YYYY>.AUG,<YYYY>.SEP,<YYYY>.OCT,<YYYY>.NOV,<YYYY>.DEC
    Depend on year system date.
    Thank you.

    Stuart,How are you storing OnSaleDate. If you are using OnSaleDate as an attribute dimension then you can write a Custom Defined Function to either:1- query your system for the current date and return the number of seconds that have elapsed since 1/1/1970. This is by definition the begining of the Epoch and how Essbase treats Attribute Dimensions of the Date type.public static long getDateInSeconds() {           Calendar cal = Calendar.getInstance();           return cal.getTime().getTime()/1000;}2- Write a Custom Defined Function that will accept the OnSaleDate and return the number of days sincepublic static double daysSince(double myDate) {     return (getDateInSeconds()-myDate )/86400;}

  • Date difference function that returns minutes between two dates and excludes weekends and holidays

    Is there a way to get this to work as a function? 
    Currently returns error "Select statements included within a function cannot return data to a client"
    CREATE FUNCTION [dbo].[WorkDays](@DateFrom datetime,@DateTo datetime)
    RETURNS int
    AS
    BEGIN
    --Working time
    DECLARE @WTFrom TIME = '8:00AM';
    DECLARE @WTTo TIME = '5:00PM';
    DECLARE @minCount BIGINT
    --Date ranges
    IF (DATEDIFF(HOUR, @DateFrom, @DateTo) > 12)
    BEGIN
    WITH CTE AS
    SELECT @DateFrom AS DateVal
    UNION ALL
    SELECT DATEADD(HOUR, 1, DateVal)
    FROM CTE
    WHERE DateVal < DATEADD(HOUR, -1,@DateTo)
    SELECT DATEDIFF(minute, MIN(CTE.DateVal), MAX(CTE.DateVal))
    FROM CTE
    WHERE (CAST(CTE.DateVal AS time) > @WTFrom AND CAST(CTE.DateVal AS time) < @WTTo) AND DATEPART(dw, CTE.DateVal) NOT IN (1, 7) AND NOT EXISTS (SELECT * FROM Holiday AS H WHERE H.holiday = CTE.DateVal)
    OPTION (MAXRECURSION 0);
    END;
    ELSE
    BEGIN
    WITH CTE AS
    SELECT @DateFrom AS DateVal
    UNION ALL
    SELECT DATEADD(MINUTE, 1, DateVal)
    FROM CTE
    WHERE DateVal < DATEADD(MINUTE, -1,@DateTo)
    SELECT DATEDIFF(minute, MIN(CTE.DateVal), MAX(CTE.DateVal))
    FROM CTE
    WHERE (CAST(CTE.DateVal AS time) > @WTFrom AND CAST(CTE.DateVal AS time) < @WTTo) AND DATEPART(dw, CTE.DateVal) NOT IN (1, 7) AND NOT EXISTS (SELECT * FROM Holiday AS H WHERE H.holiday = CTE.DateVal)
    OPTION (MAXRECURSION 0);
    END;
    END
    Thanks for your help.

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules (you do not). Temporal
    data should use ISO-8601 formats (you do not!). Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    We hate functions in SQL. This is a declarative language and you are using it like 1950's FORTRAN. We hate local variables (more FORTRAN!)
     The name of a function has to be either a known, common name, like “sine”, “cosine” etc. Or it is “<verb>_<object>”; you think a noun is a verb! Do you really need BIGINT? Why did you invite garbage data with it? Why do you think that SQL
    uses AM/PM? Have you never seen the TIME data type? 
    Think about “date_val” as a data element name. A date is a unit of temporal measurement on a calendar scale. This would be a “<something>_date” in a valid schema. 
    >> Is there a way to get this to work as a function? <<
    Probably, but why do it wrong?
    Build a calendar table with one column for the calendar data and other columns to show whatever your business needs in the way of temporal information. Do not try to calculate holidays in SQL -- Easter alone requires too much math.
    The julian_business_nbr is how SQL people do this. Here is the skeleton. 
    CREATE TABLE Calendar
    (cal_date DATE NOT NULL PRIMARY KEY, 
     julian_business_nbr INTEGER NOT NULL, 
    Here is how it works:
    INSERT INTO Calendar 
    VALUES ('2007-04-05', 42), 
     ('2007-04-06', 43), -- Good Friday 
     ('2007-04-07', 43), 
     ('2007-04-08', 43), -- Easter Sunday 
     ('2007-04-09', 44), 
     ('2007-04-10', 45); --Tuesday
    To compute the business days from Thursday of this sample week to next Tuesday:
    SELECT (C2.julian_business_nbr - C1.julian_business_nbr)
      FROM Calendar AS C1, Calendar AS C2
     WHERE C1.cal_date = '2007-04-05',
       AND C2.cal_date = '2007-04-10'; 
    See how simple it can be when you stop trying to write FORTRAN and think in sets? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Report Script returns no data and "java.io.FileNotFoundException" error

    When attempting to write to a new file (Eg: C:\TEST.txt), Report Script returns no data and "java.io.FileNotFoundException" error occurs.
    This error occurs only in Essbase 9.3.1.3 release, however it works fine in release 9.3.1.0.
    After running the report the script, it pops up the follwing message:
    "java.io.FileNotFoundException: ..\temp\eas17109.tmp (The system cannot find the file specified): C:\TEST.txt"
    When checked the TEST.txt, it was empty.

    Sorry folks, I just found out the reason. Its because there was no data in the combination what I was extracting.
    but is this the right error message for that? It should have atleast create a blank file right?

  • I purchased an iPad mini on October 10th.  I want to return it and get the new ipad mini retina when it comes out.  How do I do that if the new ipad mini release date isn't until "later in November", which is beyond the 14 days from my purchase date?

    I purchased an iPad mini on October 10th.  I want to return it and get the new ipad mini retina when it comes out. I am currently still within the 14 day return/exchange window but how can I exchange it if the new ipad mini release date isn't until "later in November", which would be beyond the 14 days from my purchase date?  If apple announces a new version of a product you just purchased but won't actually release it for more than 14 days, how can you possibly exchange the one you just bought?  Is my only option to return the one I bought on the 10th (so return by 10/24) and then not have an iPad until the new one is available for purchase?  Or would it make any sense to return the one I bought, get a new one, which would presumably have another 14 day return window, and then exchange THAT one for the new ipad mini w/ retina when it comes out (hopefully within that second 14 day window)?

    Call the apple store you got it from and ask them. Sometimes in the past they've extended the 'no questions asked return' but only Apple can tell you for sure.

  • My Macbook pro was stolen 09/12, the police just returned it to me. I want to remove all the data and start over. Format the drive's etc. I have windows 7 on 1 partion and mountain lion OSX on the apple partition. How is the best way to do this?

    My Macbook pro was stolen 09/12, the police just returned it to me. I want to remove all the data and start over. Format the drive's etc. I have windows 7 on 1 partion and mountain lion OSX on the apple partition. How is the best way to do this?

    Have a look here...
    what-to-do-when-your-hard-drive-is-full.html

  • In iPhoto 11 changing the Date and Time EXIF becomes Garbage?

    Hi- the new photo date I choose for a photo (say 1946) turns into garbage after saving - like 1165 or 1492- ( and Columbus would be suprised).
    Detail: About 5 years ago in Windows PC in  XP folders  I scanned old family pics into folder for 1946 and all was well= until few months back in 2011 I crossed over to Mac Book Air and  iPhoto 11.
    However iphoto  doesnt care for file name- Its sorts all in event date based on scan date- exif date-  embedded by the scanner when I did it. OK. Smarter.
    So to change its date I select each photo in iphoto11- then  select "change date" and changed the date what I want it to say (like   06/06/1946) - and saved .
    Problem. Now it has two dates against it - one date in year 1492 and the other in 1765- .
    I have tried changing the date differently using  the little Up or Down arrows, and its scrolls (eventually!) to 1946 -I  do a save..... and another crazy date turns up-
    Am guessing so its got to be a trick related to the " day counter"- mind you I dont see the pint of telling me that my photo is having its date changed by some quantity of thousands of days- Doh that sounds very Windows like.
    I must be doing it wrong.
    Any experts please?
    Thanks in advance !

    Thanks AppleMan1958, you're right.
    My view was set to Favorites and Unmarked so when I imported the video, rejected parts of it, and THEN changed the date I was unable to see that I wasn't changing the date on the rejected portion. I changed the view to All Clips (in the View menu) and then I could plainly see that the rejected clips still had the current date.

  • Get-Hotfix InstalledOn property not returning hotfix installed Date and Time on Windows Server 2008 SP2 but works on Windows Server 2008 R2 SP1

    Hi,
          I am working on a validation script to get the list of hotfixes installed on Domain Controllers every month as part of our monthly DC patching process. I have been successful in getting these details for DC's with (Windows Server 2008
    R2 SP1, Powershell v2.0) using the below command. 
    Get-HotFix -cn $computer | Select-Object PSComputerName,HotFixID,Description,InstalledBy,InstalledOn | where InstalledOn -ge (Get-Date -Day 1 -Format d) | FT -AutoSize
    I execute the above from a jump box with powershell v4.0 (Server 2008 R2)
    However, when I try the same command from the jump box to query DC's with (Server 2008 SP2, powershell v2.0). It doesn't return the InstalledOn date and time. It was giving error for the InstalledOn property and hence I renamed it to $_.InstalledOn. Now
    I don't get error but still no details displayed for InstalledOn property.
    I tried using the below, as could see on few forums that this might resolve the issue. I also tried removing the "where" part but still no installation date returned. 
    Get-HotFix -cn $computer | Select-Object HotFixID, Description, InstalledBy, @{l="InstalledOn";e={[DateTime]::Parse($_.psbase.properties["installedon"].value,$([System.Globalization.CultureInfo]::GetCultureInfo("en-US")))}}
    | where {$_.InstalledOn -ge (Get-Date -Day 1 -Format d)} | FT -AutoSize
    Have tried this locally on the 2008 SP2 DC but still not working. Please advise what is going wrong? 
    Note: If I execute the below command locally on the 2008 SP2 DC, I am getting the InstalledOn output. However, when executed from the jump box with powershell v4.0 (Server 2008 R2) to query
    the same 2008 SP2 DC, it just gives the prompt again without any error or output. This behavior is consistent for other 2008 SP2 DC's in the environment.
    Get-HotFix -cn $computer | Select-Object HotfixID,Description,InstalledBy,InstalledOn | where {$_.InstalledOn -ge (Get-Date -Day 1 -Format d)} | FT -AutoSize

    Hi jrv, I have already tried the Win32_QuickFixEngineering option, which doesn't work either. Apologies for not mentioning the workarounds that I have already tried.
    Get-Hotfix seems to be just a wrapper for Win32_QuickFixEngineering as per the below article. (http://technet.microsoft.com/en-us/library/hh849836.aspx)
    I have seen a mention of using the WU ActiveX control on few forums, but was too lazy to read it through.
    After rigorous testing, it makes me realize that somewhere the Get-Hotfix dates formatting\comparison isn't working. 

  • Using CRUD procedures to update data and ref cursors to return data

    Hi:
    I am currently evaluating Apex 3.x to replace an existing app that uses lots of procedures to update and return data.
    1. Is it possible to return data from a function that returns a cursor (or from a procedure that has an input/output ref cursor parameter for that matter) ? Example: Let's say I have the following function in a package:
    function get_data return sys_refcursor
    is
    l_cursor sys_refcursor;
    begin
    open l_cursor for select sysdate as field from sys.dual;
    return l_cursor;
    end;
    Can I add a page with a table that is populated based on this function? Based on my research it is not possible, but I want an APEX expert to confirm it
    2. The old application uses CRUD procedures to update date, that is for each table there are 3 procedures, insert update and delete. Question: is it possible to channel all the update, inserts and deletes through these procedures? Furthermore, in lots of cases I use sequences to populate the primary keys, and the new value is returned as output parameter. Can I retrieve the output value and use it maybe in the next page I am branching to?
    In the samples that I've seen the same form is used for insert and update. How do I distinguish between the two modes?
    3. Can you please point me to some samples that show how to do 1 & 2. The standard samples that I've seen use the automatic row processing.
    4. Could you please recommend some good books about Apex or HTML db? I found the documentation unintuitive. It is hard to picture quickly how things tie together by reading this documention. I wish the documentation was more task oriented and presented 'how to...' implement generic patterns used in web apps.
    Thank you in advance

    Hi guys
    Check out the last 2 posts in this thread for ideas on how to implement 1.
    Report on user data from LDAP
    Varad

Maybe you are looking for