To_number() with format pattern and nvarchar2

Hi,
I've had a problem with converting a number in US format in to a number. Due to the settings of our Oracle we have German locale settings. Thus I use the NLS format parameters in the to_number function. It works pretty well if I set the number string directly into the function call. However it did not work a the column of type nvarchar2 (which is actually permitted according to the documentation). This simple statement shows the problem:
alter session set NLS_NUMERIC_CHARACTERS = ',.';
DECLARE
evalue NVARCHAR2(20);
evalue2 NUMBER(25, 15);
BEGIN
SELECT '5.124' INTO evalue FROM dual;
SELECT to_number(evalue,
'9G990D9999999999999999999',
'NLS_NUMERIC_CHARACTERS = ''.,''') s
INTO evalue2
FROM dual;
dbms_output.put_line(evalue2);
END;
It gives me an ORA-01722 invalid number. It can be fixed by changing the column to e.g. VARCHAR(20) or just use an cast before passing to the to_number()
DECLARE
evalue NVARCHAR2(20);
evalue2 NUMBER(25, 15);
BEGIN
SELECT '5.1234' INTO evalue FROM dual;
SELECT to_number(cast(evalue as varchar2(20)),
'9G990D9999999999999999999',
'NLS_NUMERIC_CHARACTERS = ''.,''') s
INTO evalue2
FROM dual;
dbms_output.put_line(evalue2);
END;
I played around with the number and found out that the specified NLS_NUMERIC_CHARACTERS is not applied when the column type is NVARCHAR2 and is still trying to convert it using the session's locale settings.
Does anybody know if this is fixed already in a later version?
System: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit
Kind regards,
Mario

Hi,
It seems to work if you first make it a char before the to_number :DECLARE
evalue NVARCHAR2(20);
evalue2 NUMBER(25, 15);
BEGIN
SELECT '5.124' INTO evalue FROM dual;
SELECT to_number(to_char(evalue),          <--- to_char added here
'9G990D9999999999999999999',
'NLS_NUMERIC_CHARACTERS = ''.,''') s
INTO evalue2
FROM dual;
dbms_output.put_line(evalue2);
END;
/

Similar Messages

  • Problem with Format Masks and Computations

    (I did a quick search on this, but didn't notice another thread on the topic. If there is already one I apologize.)
    We are using APEX version 2.2.1.00.04.
    I had an editable item that had the 999G990D00 format mask. In a computation I used that item and another item (that didn't have a format mask) to calculate a third item. The item I was trying to compute would not populate. It really had me stumped, so I went so far as to completely delete the fields and re-construct everything. When I did so the computation worked. That is until I put the format mask on the item again. I removed the format mask and the computation now works.
    Is this a known issue? Is it a bug? Am I doing something wrong?
    Thanks, Tony

    Tony,
    As Patrick mentioned, all variables in Apex are strings. Whenever you do something with them that effectively requires something other than a string value the database does an implicit type conversion. This often works, but not in cases where the db doesn't know how to do the conversion. For example, if your default database date format is dd-mon-yyyy and you have a string 10/09/2007 the database won't have any idea how to convert it to a date. That same is true for number formats.
    In your case, you used the number format mask in apex to convert a number to a string witht the given format. Apex does not do anything to convert it back to a number when you submit the page (unless you use the built in row processing). If you want to do anything with it as a number, you need to change it back with the to_number function. The second parameter is the format mask of the string you are passing in.
    Hope this helps,
    Anton

  • Problem with format mask and currency

    Hi,
    I am trying to apply a format mask to a report column.
    I want my format to be: 4500 ==> $4,500.00
    I have tried to apply: FML999G999G999G999G990D00, and i get #4,500.00
    Do i have to set a currency parameter somewhere for this format mask to work?
    I have done a select * from nls_database_parameters:
    NLS_LANGUAGE AMERICAN
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET US7ASCII
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    Thanks in advance,
    Immanuel

    Immanuel,
    Here's what I believe is going on:
    1) Your database character set is US7ASCII. US7ASCII cannot store a '£' character.
    2) Although the real NLS_CURRENCY symbol for NLS_TERRITORY UNITED KINGDOM is '£', it's displaying a converted character of '#', due to the above reason.
    3) The currency symbol from the format mask is determined by your NLS_TERRITORY (and hence, your NLS_CURRENCY) settings for the session.
    4) Your application is most likely setup to run with an application primary language of English United Kingdom. Thus, your application will always set NLS_TERRITORY to UNITED KINGDOM.
    To get your desired result, either:
    1) Change your application primary language to en-us
    or simpler yet
    2) Hard-code the $ sign in your format mask.
    Joel

  • Argentina - EBS with format AUZUG and UMSATZ (using MultiCash program)

    Hi,
    We are mapping the external transaction types while configuring EBS with AUZUG and UMSATZ format for our client.
    Does anybody have a document explaining the external transaction types in case of UMSATZ format, based on which we can define the posting rules for these three digit transaction types in Table T028B?
    For e.g
    As in BAI format
    "399" is a Credit belonging to a "miscellaneous credit".....with that information I can map it accordingly in table To28B.
    The same information I require for Multicash - UMSATZ format. What does "N24" or "959" codes mean (or a document defining Argentine Bank - Transaction codes), based on which I will map in SAP?
    Thanks
    Shweta Pethe

    HEllo,
    I'd suggest you to check with your bank in argentina if they can provide you a list of the transaction types they're currently using. Sometimes the transactions vary from one bank to another ( even in BAI format ).
    Regards,
    REnan

  • Issue with Formatted Search and Sales BOM

    Good afternoon,
    One of our customers uses a Formatted Search on the Sales Order row to lookup the Project Code stored against the Item.
    This works very well, except for when a Sales BOM is selected.  I assume the FS lookup is working correctly, but the screen is quickly refreshed to list all the component items related to the BOM.  This process appears to overwrite the contents of the Project field.
    We wish to keep this functionality, but retain the FS lookup results in the Project column.  Could the order of the process be changed so that the BOM refresh occurs prior to the FS lookup.
    Thanks
    Greig
    Edited by: Greig Burrows on Jul 21, 2010 5:57 PM

    Hi,
    For metadata, which metadata are you not seeing? Are they custom properties within the PDF, and have you checked if you have crawled properties matching these?
    I know there's issue with last modified on PDF's (http://sharepointfieldnotes.blogspot.no/2013/05/understanding-and-getting-sharepoint.html) 
    Thanks,
    Mikael Svenson
    Search Enthusiast - SharePoint MVP/MCT/MCPD - If you find an answer useful, please up-vote it.
    http://techmikael.blogspot.com/
    Author of Working with FAST Search Server 2010 for SharePoint

  • Duplicating Object Style with Formatted Paragraph and Formatted Rectangle.

    Hey,
    I am trying to duplicate an object style but I am not sure if I set it up correctly.
    I have a rectangle object with strokes and applied fx effects to corners, gradient feather, transparency.
    I also have a text frame where there is a header paragraph format and a drop cap paragraph format for the main text.
    Rather than going through this process again, I thought creating a object style would save time but how do I group these two frames (rectangle shape and text frame) and apply an object style? I am only allowed to apply an object style individually to either the text frame or the rectangle object. It also doesn't help when I try to create a rectangle frame around the previous two items.

    Okay so I try to revise my process and used only one object style. I'm almost there but I'm still running into issues.
    1. I created a text frame and applied two paragraph styles to the text (header and drop cap). 
    2. Next, while selecting the text frame i applied a fill with transparency and corner option effects.
    3. Then with the text frame selected I created an object style and made sure the paragraph style is turned on, with the paragraph style set to "header" and checked the apply next style (so that the drop cap style will be applied as well).
    However, when I finish all these steps and try to apply it to a new text frame without any formatting, it sets all the text to "header" style without applying the dropcap style. I don't get why I can't apply multiple paragraph styles into the object style. I have to manually select the paragraph and apply the drop cap style which changes my default object style to become Object Style 1+ due to override (which is fine but even when I right click and choose redefine style, it does not nothing)

  • Computer Freezes with dotted pattern and flashing

    I came back to my computer after 30 minutes away from it, and it had frozen with no ability to change applications, websites, screens, windows etc. The screen was locked and flashing bright colors, with an odd dot pattern over the screen. I restarted by manually holding the start button on the computer tower.
    The seemingly identical thing also happened yesterday, which I also restarted manually. Any ideas on the problem here or potential fixes?

    I'm on a MacPro desktop from early 2008.  This is what I found on my screen.  This is taken from an iPhone (the dots may be hard to see but they show up on the right side of the image:
    I'm running 10.7.5
    Procssor - 2.8 GHz Quad-Core Intel Xeon
    Memory 4 GB 800 MHz DDR2 FB-DIMM
    Graphic NVIDIA GeForce 8800 GT 512 MB
    Display 23" DVI
    My memory is something I have been working on...  It is nearly full only 46.21 GB free out of 999.35 GB.
    Need any other info?

  • What software should I leed to open attachments with format pps and wmv Thanks Jorge 07

    I Pad

    You don't need any additional software or an app to open/view a PPS file included as an email attachment.
    Copied from this link.
    http://www.apple.com/ipad/specs/
    Mail Attachment Support
    Viewable document types: .jpg, .tiff, .gif (images); .doc and .docx (Microsoft Word); .htm and .html (web pages); .key (Keynote); .numbers (Numbers); .pages (Pages); .pdf (Preview and Adobe Acrobat); .ppt and .pptx (Microsoft PowerPoint); .txt (text); .rtf (rich text format); .vcf (contact information); .xls and .xlsx (Microsoft Excel).
    WMV is a closed/proprietary Microsoft format. There are some 3rd party apps via the iTunes app store that provide for viewing a WMV file included as an email attachment. One is called OPlayer.

  • Formatting DATEs with FORMAT clause and not with "to_date()" ?

    Well I know I could format a DATE inline with the to_date() function.
    But is there a way to format it in a separate FORMAT clause similar to
    numbers?
    If yes how would a format of
    dd.mm.yyyy
    or
    yyyy.mm.dd hh:mm:ss
    look like?

    user559463 wrote:
    Ok, again I am searching something like
    COLUMN "expiry" FORMAT "YYYY.MM.DD HH:MM:SS"No, it can only be done via TO_CHAR or NLS_DATE_FORMAT. I think you should read SQL*Plus COLUMN command.
    SY.

  • Intercompany payment run ( F110 ) with format LUX_VIR2000 and REMADV creat.

    Hi
    I would like about little support.  I work with the payment run for intercompany payments (  F110 ) with payment format LUX _VIR2000.  After successfully generated DME  Payment Advice Note ( IDOC with Message REMADV ) is not created. 
    Do you know what  could be possible error ?
    Thank you in advance for your help
    BR
    Wojciech

    help required for this question
    Thanks
    Rajanikanth

  • Trouble with reminders syncing and iCloud

    I couldn't get Reminders to sync with iCal via USB/iTunes. So I thought maybe Apple, despite making everything syncable via iTunes in the past, had broken with this pattern and made it so Reminders only works through iCloud. (Is this true? I hope not.) So I turned on iCloud for Calendars, which led to my iCal to-dos getting synced to my iPod, but my iPod Reminders still aren't synced with iCal. So that's one problem I'm trying to solve. Furthermore, now I can't seem to turn *off* iCloud without losing all my calendars. Is Apple trying to force me to use iCloud forever now, just because I gave it a test run? I guess I can export all my calendars, turn off iCloud, then re-import, but it seems like it shouldn't be that hard. Am I missing something? Any thoughts or advice on any of these issues would be appreciated.

    I finally found another thread that answers part of my question: https://discussions.apple.com/message/16339884#16339884. Apparently Reminders syncing is allowed only through iCloud.

  • Unable to create Instance with Object Editor and Attachment Pattern

    Hi Experts,
    I created a simple entity service with some attributes and a document reference.
    I also configured an object editor pattern and assigned a attachment pattern. The created object editor works as long as I don't attach a file. But if I attach a file and want to save it I get an error message "cannot create"
    In the default log.trc I have some entries
    Cannot read associated instance with MOF ID 105D8E0C4F02D45AFFD5B9D6A09EFB7A of MOF Layer 2 for (6DC24B80F6004CDBF4FA6C560AEDD33C,<null>)
    and
    refPackageM1(com.sap.ip.bi.sdk.dac.olap.query) failed RepositoryDBMemory. Using generic one.
    I configured the j2ee engine according the tutorial "Integrating KM with CAF UI Patterns"
    So what is wrong?
    Best regards Manuel

    Hi,
    From the stacktrace I assume that the following happens (please correct me, if I'm wrong):
    <b>*</b> Some time based event mechanism sends an event to your custom event handler code. That code is execute in some system context.
    <b>*</b> Your handler uses the RF API to create a collection. All this is perfectly OK. Here my assumptions end, the next steps are solid facts.
    <b>*</b> Within the RF all property filters are informed that a resource is about to be created. One of the filters is trying to obtain a lock from a system provided Locking Service.
    <b>*</b> That service refuses to grant the lock, telling that system users are not allowed to do so.
    Most proably you cannot do anything to solve this problem by yourself. When I ran into the same Exception once, I could avoid to have my code run in a system thread. Well you might try to do the same.
    Otherwise please open a customer message and complain about the restiction in the locking behaviour.
    Best regards,
    Michael

  • Format external HD for use with Mac Network and PC

    System config: Home network: Mac Pro & MacBook Pro connected via AirPort Extreme. Both run OS X 10.5.6. The Mac Pro also runs Windows XP Pro. Work computer: Dell, Latitude D830 running Windows XP Pro.
    Situation: I have a Western Digital WDMT5000TN 500GB Portable HD, (FireWire 800 & USB). The WDMT5000TN came formatted Mac OS Extended, which, as I suspected, could neither be read nor written to in XP. I reformatted the drive NTFS in XP Pro. This worked well with XP but was read only in OS X.
    Ideally, I would like to format the drive so that it is both read/write capable with both OS X & XP Pro and handle file transfers in excess of 100 MB. If this is not possible my second choice would be to have the drive read/write OS X & read only XP, given that I upload mostly in the Apple domain & would be able to perform backups of it’s contents using Time Machine with OS X.
    If anyone has a formatting recommendation or related information that may help I would appreciate your insight. Thank you.

    Two basic options:
    1. Format the drive FAT32 (MS-DOS) which is read/write on both Windows and OS X.
    2. Leave the drive formatted NTFS and install software on OS X to enable read/write access. The options are: a.) Paragon NTFS for Mac OS X - 6.5.1; b.) MacFuse and NTFS-3G 2009.2.1u1; and, c.) NTFS for Mac 1.0.

  • Importing WORD text files with formatting and Text Flow issues IDCS3

    I am a designer who has used ID since it first came out, but have not been utilizing the larger document capabilities lately as I've been working in large format graphics (like really large, so if you have questions on that I can answer!). I am working on a new magazine and the copy is in WORD. I want to know the best way to bring in the text and keep the italic and bold formatting. The WORD docs have no style format done by the writers, so therefore changing the styles to my styles in the custom import section doesn't work. I tried making a character style sheet with no font chosen just "italics", but didn't work. I still was unable to make a paragraph style on top of it.
    If anyone has a good methodology for bringing in WORD text and keeping it's attributes while applying ID style sheets please help!
    Also with text flow, I have always had an issue with ID with not creating more pages to keep the flow going. In a test I just did I placed the text, but it did not create any new pages. I know there's a way to make that work, but spell it out for me like I'm a person losing their mind which seems to be the case!
    Thank you in advance to the person who can give me advice!

    What for settings do you have on the importoptions when bringing in Word? Keep formatting or loose formatting? And if loose formatting: is Keep local formatting on or off?

  • Need help with adding formatted text and images to Crystal Report?

    Here's my scenario:
    I have a customer statement that's generated as a crystal report and that has a placeholder for advertisement. The advertisement is mixture of formatted text and images. Until now we only had one advertisement that was always used on the report. The new requirement is that we would have a pool of hundreds of advertisements and would need to display one specific advertisement on the customer statement based on various marketing criteria. They key is that the advertisement content will be determined programmatically and cannot be hardcoded into the report. I'm using Crystal2008 with .net SDK.
    Here are the solutions I thought of, but I'm still rather lost and would appreciate your help/opinion.
    1) Pass HTML or RTF to the report
    Not really sure if this is possible and how to get it done. Also how would I pass in images? Would display formatting be reliable when exporting to PDF?
    2) Create each add as a subreport and append it programatically
    I actually have this working, but I only know how to append a new section to the end of the report and then load the subreport to the section. I have no other controll of the placement. Is there a way to dynamically load a subreport to a predefined section in the main report? How about adding a dummy subreport in the main report as a placeholder and then replacing it with a different subreport? How could I do this?
    3) Pass an Image to the report
    I would create each advertisement as an image and then would somehow add the image to the report. How would I load the image and control the placement? Could I somehow define a placeholder for the image in the main report-maybe a dummy image to be replaced?
    Thank you.

    Hello Pavel,
    I would got the third way.
    You can use dynamic images in your report.
    Just by changing the URL to the image the image can be changed.
    Please see the [Crystal Manual|http://help.sap.com/businessobject/product_guides/cr2008/en/xir3_cr_usergde_en.pdf] and search for images.
    or directly here
    [Setting a Dynamic Graphic Location Path on an Image Object|https://boc.sdn.sap.com/node/506]
    [Dynamic image and HTTP://|https://boc.sdn.sap.com/node/3646]
    [codesample for .NET|https://boc.sdn.sap.com/node/6000]
    Please also use
    [Crystal Reports 2008 SDK Documentation and Sample Code|https://boc.sdn.sap.com/developer/library/CR2008SDK]
    [Crystal Reports 2008 .NET SDK Tutorial Samples|https://boc.sdn.sap.com/node/6203]
    Hope this helps
    Falk

Maybe you are looking for

  • Ovi Chat account unavailable?

    I have the Ovi Chat Account configured on my N900. It doesn't work any more since yesterday. Seems to be confirmed by a few other users. Any official statement from Nokia about this? Like "server under maintenance" or thelike? Or did they simply shut

  • Garageband running extremely slow

    Hi Guys, I am hoping someone can help.  I am on a Mac OS X 10.7 and using Garageband 6.0.4.  I have started experiencing problems the last few days.  Its basically always playing catch up, for instants if I press record, its starts recording but when

  • How to hide slides for a presentation?

    I am going to give a presentation that needs to have some slides hidden but at the same time available if i wish to use them. The idea is to have an omitted slide with the possibility of using it while i am doing the presentation. In power point you

  • Only half of photos in library load to iphoto 2

    I've done a library rebuild and it hasn't helped. I can see the iphoto library in my finder, and it looks like they are all there, but they are not loading. The last photo is dated 10/21/04. Should I try importing those photos again? Isn't that kind

  • SUS survey send working funny and BP transfer so two questions

    Hi all When a vendor registers via the weblink a BP is create is SUS client.  This is fine.  However, my system for some reason is sending the survey without me having to click on Send Survey Pre-select vendors.  I only want the survey to send once I