Convert number field to nvarchar2

How??? I tried using the to_char and convert functions but I keep getting a 'character set mismatch'...

Try using the "TRANSLATE ... USING" It converts text into the character set specified for conversions between the database character set and the national character set.
The text argument is the expression to be converted.
Specifying the USING CHAR_CS argument converts text into the database character set. The output datatype is VARCHAR2.
Specifying the USING NCHAR_CS argument converts text into the national character set. The output datatype is NVARCHAR2.
This function is similar to the Oracle CONVERT function, but must be used instead of CONVERT if either the input or the output datatype is being used as NCHAR or NVARCHAR2.
Example
The examples below use the following table and table values:
CREATE TABLE t1 (char_col CHAR(20),
nchar_col nchar(20));
INSERT INTO t1
VALUES ('Hi', N'Bye');
SELECT * FROM t1;
CHAR_COL NCHAR_COL
Hi Bye
UPDATE t1 SET
nchar_col = TRANSLATE(char_col USING NCHAR_CS);
UPDATE t1 SET
char_col = TRANSLATE(nchar_col USING CHAR_CS);
SELECT * FROM t1;
CHAR_COL NCHAR_COL
Hi Hi

Similar Messages

  • How to convert number field into time

    Hi
    I have made a form for storing of private dialed calls from different extensions. To store call duration i have assigned a number field which is storing following type of data
    1.34
    1.19
    37.29
    1.47
    In above mentioned data decimals are seconds and left side is minutes.
    Now the requirement is that if second is > 30 then 1 minute should be added in minutes else 30 seconds should appear instead of original seconds.
    Please Help!

    >
    To store call duration i have assigned a number field which is storing following type of data
    In above mentioned data decimals are seconds and left side is minutes.
    >
    Please provide info about the form in which you RECEIVE the data. Do you receive the data in MM.SS format like you say you are storing it?
    If not, why are you storing it this way?
    Unless you have some reason to STORE the data differently just store it the way you got it. That way you won't lose any precision and you can manipulate it any way you need to for display purposes.
    If you receive START_TIME and END_TIME then store both of those. Don't calculate and store duration; you will lose END_TIME and if you later need to calculate duration to a different precision you won't be able to.
    Where is the data being stored? Oracle?
    Write a simple function to convert a duration to minutes and seconds using the '>30' rule you have. Then if the rule changes you can write a new function or modify the existing one and the data itself doesn't have to change.

  • How convert number field (floating) to text

    I have this field number. When I use function Cstr or ToText, alway display on reporte on floating format. Ex. 5e+018. How I do display real number 512121221458478514.

    Hi,
    I had a similar issue before. So i discussed that in the same forum, Here is the conclusion i got.
    Crystal reports is built with C++ and the numeric field type used is limited to 15 digits plus 1 for the sign of the number.
    Only option is to use a stored procedure and break that field into 2 parts and put them back together in a text object by
    dropping the fields in next to each other.
    And here is the LInk: Decimal Value is not displaying properly.
    Regards,
    Salah

  • Convert number(16,5) field to a number(13,1) field with an Expression

    Hi everybody,
    is it possible to convert a number field with scale (16,5) to a number field with scale (13,1) ?
    Can i use an expression ?
    Any help would be appreciated.
    Greetings

    I do not think you will required any transformation
    directlly assign the number(16,5) to number(13,1) and as max value for number(16,5) =99999999999.99999
    that will be always less then max value for number(13,1) 999999999999.9
    Cheers
    Nawneet

  • Problem in converting number to character

    Hi All,
    In my report there is number field called <?LINE_TOT_AMOUNT?>. In the next line i want to display that amount in words. I tried using
    <?xdofx:to_char(LINE_TOT_AMOUNT)?>
    but the output is same as the <?LINE_TOT_AMOUNT?>. Can any one help in solving this?

    look at TO_CHAR (number)
    if LINE_TOT_AMOUNT is number then to_char(LINE_TOT_AMOUNT) in string
    it's not display that amount in words
    it's only format row
    if you wnat to convert number to words
    plz see Re: Conversion of number to word

  • Convert a field to_number and use formatmask

    I like to convert a field into a number SRW.Set_field(0, to_number(:fieldname));
    as well create this mask 'N.NNN.NNN.NNN.NNN.NNN'
    SRW.SET_FORMAT_MASK('N.NNN.NNN.NNN.NNN.NNN'); or SRW.ATTR.FORMATMASK := 'N.NNN.NNN.NNN.NNN.NNN';
    All this srw doesn't work, why?

    The field doesn't have a datatype. The field's datatype is picked up from the column that is its source. Therefore, the datatype of a field is fixed at runtime and can't be changed.
    The srw.set_field_number() built-in only sets the value of a field, it doesn't change the field's type. If the datatype of the source column for a field was not "number" then the above call would have no effect.
    Likewise, the srw.set_format_mask() built-in only effects fields whose datatype is number.
    It sounds like what you're doing is trying to display both Character and Number values in a single field. The only way to do this with a single field is to base the field on a character column and do the formatting either in the SQL or PL/SQL that is the source of the column. This will limit you to the format masks available in both SQL or PL/SQL.
    Another way of doing it is to create 2 fields. One for the number value and one for the character value. Place the fields on top of each other and use format triggers to display one or the other. You can then use the srw.set_format_mask() against the number field if required.

  • Check number field coming in blank

    I am new to this forum, and I am searching but canu2019t find a solution.
    I have a database, which contains a field called u201CCheck Nou201D, which contains the check numbers as well as type of payment received from a contributor.
    So, if the contributor paid which a check, then the check number is there, but if they paid by money order, pay pal or cash, then those terms are there.
    The problems is when I bring the data into CR, it is only bringing over the check numbers, as number.
    Now, I wrote a formula to convert the numbers to text, but it still is not reading the literal data, u201Cmoney order, pay pal or cashu201D.
    The formula that I wrote is:
    If {2009.CHECK_NO} = 0.00 Then
    "*CASH*"
    Else
    ToText ({2009.CHECK_NO},0,"")
    and believe, it or it works, u2018cause the check numbers come in great.
    I called tech support up and they told me something about marking the field as u201Calphanumericu201D, and to look to the forum for a solution, or else pay $195 per incident for tech support.
    I figure this must be a common occurrence, u2018cause all organizations maintain some type of check register, and there are times, now a days when pays with something other than a check, e.g. wire transfer, debit card, etc.., and if that literal text is in the check number field, Iu2019d like to bring it over as such.
    Thx in advance for answering my question.

    Here is the formula I have in my CR report:
    ToText ({Sheet1_.F3},0,"")
    and here is the result I get:
    Check No     
    4204     
    6008     
    448     
    2079     
    13495     
    1216     
    369     
    320     
    2227     
    231     
    139     
    351     
    524     
    1562     
    402     
    5098     
    1109     
    2240     
    922     
    Where the blank lines are records containing text entries in that field, such as "cash, credit card, paypal".
    My problem is that no matter what I'm trying, the numbers come across fine, but now the literal text isn't.
    I've tried some variation of the formula as follows:
    If IsNull({Sheet1_.F3}) then "" ELSE
    if not(Isnumeric({Sheet1_.F3}))  then ({Sheet1_.F3}) else 1
    As a suggestion from the board, but when I check for errors, I get various errors such as  "string needed" or something else.
    I'm getting lost on this.
    And, I'm sure it is something simple, but I just can't grasp it from the manual or help screen.
    Please help!!

  • Convert number to date

    Hello.
    I'm new at this stuff and need a hand with a function.
    I have a Customer table that has a Date set as a number. 
    When I drag this field on to the report I get the following: 20,071,101.00
    Which makes complete sense since it is a number field.
    How do I convert this field to a date format?
    I tried the following:
    cDateTime ({CUS.DATESTART})
    Unfortunately, I'm doing something wrong as it is providing me with the following error:
    Error: Dates must be between year 1 and year 9999
    What am I doing wrong?
    Perhaps there is a much easier method then trying to create function...
    Thanks in advance for your assistance.
    Stephane

    Hello Raghavendra.
    Your solution has provided my answer.
    I will provide my final solution for others to view:
    Date(tonumber(left(totext({CUS.DATESTART},'##'),4)),tonumber(mid(totext({CUS.DATESTART},'##'),5,2)),tonumber(right(totext({CUS.DATESTART},'##'),2)))
    Notice how I substituted the actual date with the field(number).
    Here is reported field: 01/11/2007
    Note: my field value at this point was equal to CUS.DATESTART = 20,071,101.00
    Thank you very much for your quick assistance.
    Stephane

  • Number field issue

    Hi,
    I have the table and a row like this:
    create table swchk1 (numfield number(38))
    insert into swchk1 values (31.5)
    select * from swchk1 --32
    The actual value 31.5 is converted to 32.
    Is there a way to get the value of 31.5 instead of 32?
    Thanks in advance

    Please dont say that. It was a miss
    for example, if the number field is created as a datatype number (Please note iam not giving any provisions to accomodate any decimals) it would have solved the problem.
    The datatype Number(38) were the standards when we used oracle-8i to deal with number, of course without decimals, as we migrated to 9i the datatype number was the standard we use.
    Is there any migration tool or any means where i can restore the actual value?
    Thanks.

  • Number Field - Decimal Sign

    Hi,
    i have a number field. When the user inserts a value for example 5,2 it should be automatically converted to 5.2 and inserted in the database. Instead it's inserted as 52.0
    When the user inserts 52,2 into the field, the error 'MTTRi [months] does not match number format 90D0 (Example: 3.5).' is shown. Why is this error not shown when the user is inserting the value 5,2?
    The format mask is 90D0.
    Has anybody an idea how to achieve this?
    Best Regards,
    Martin

    Hi Martin,
    the TO_NUMBER format mask conversion tries to fix user errors. If you want to have a more restrict format mask handling, try to use the FX prefix.
    From the online doc at http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm#i170559
    FX Format exact. This modifier specifies exact matching for the character argument and datetime format model of a TO_DATE function:
    -) Punctuation and quoted text in the character argument must exactly match (except for case) the corresponding parts of the format model.
    -) The character argument cannot have extra blanks. Without FX, Oracle ignores extra blanks.
    -) Numeric data in the character argument must have the same number of digits as the corresponding element in the format model. Without FX, numbers in the character argument can omit leading zeroes.
    When FX is enabled, you can disable this check for leading zeroes by using the FM modifier as well.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Project Number field

    Hi All,
    When I want to print Project Number field in XML Publisher Template then its displaying some of the values in HEXADECIMAL, please let me know what to do.
    0541370E01 (This value is displayed in HEXADECIMAL as 5.41E+06 )
    0533012B06 (This value is OK).
    When I concatenate it with Spaces like project_number || ' '
    Then it displays fine.
    But when I display it with spaces then user are complaining that Vlookup function in EXCEL does not work..
    Thanks
    J
    Edited by: user12294561 on Oct 11, 2011 7:38 AM

    Excel will automatically convert the large number into expo/Scientific notation, which is correct.
    but a number format does not affect the actual cell value that Excel uses to perform calculations. The actual value is displayed in the formula bar. check if that is true.

  • Address Book/iSync - email addresses moving to phone number fields

    I'm not sure what is causing this, but I'm noticing that email addresses in my cards are moving to phone number fields. I originally thought this had something to do with cards that had no phone number in them, only an email address, but now I"m realizing that's not the case.
    I fixes all cards last night and just a minute ago, when I was in Address Book I noticed some or all of the email addresses had moved again. I reverted to my backup from last night and it fixed things, but I'm wondering what's going to cause those addresses to move again.
    I do use iSync to sync my AB contacts to my Motorola phone (I think I have it set up where it's one way, computer to phone) and I have Entourage that's using my AB contacts to populate its address book.
    Any thoughts about what in my environment is causing this?
    -John

    Thank you for the suggestion. I did this, but noticed that some cards were still messed up. So I reverted back to a clean copy of my address book from last night. Then I went to iSync and synchronized with my Motorola phone. That's when iSync says that it's going to modify over 5% of my contacts in AB (122) at which point I said okay. Problem appears to be that the cards it modifies is random.
    Now to make matters worse, it appears that if I repeat this process over and over (revert, iSync, look through cards), there is no pattern to which cards are changing. I don't even know how to troubleshoot this. I'd love make iSync go one way - computer to phone - so that the phone can never write information to the computer. Is that possible?
    I'm sure this needs to go to a different section...
    -John

  • MIGO tr Serial number field and table?

    Hi guys,
                  can anybody tell me how to find the field name and table for Serial number in MIGO tr Code?
                     in MIGO the Serial number field and Structure are GOSERIAL-SERIALNO.but i was not able to find the Actucal Field name and table where i can get the values based on PO and Asset Number's?
    Thanks,
    Gopi.

    Hello,
    I'm looking at the same problem here. I found the table SER03 in which you can enter the the material document. This returns 1 line in this table and from this one you need the OBKNR element
    You can copy this data and paste it into table OBJK element OBKNR and this returns all serialnumbers for the relevant material document.
    My problem is that i can't get these items on the sapscript. (WESCHEINVERS 1,2 or 3)
    Greetings
    Edited by: Lode Vandecruys on Apr 9, 2008 11:04 AM
    Edited by: Lode Vandecruys on Apr 9, 2008 11:09 AM

  • Serial number field and table

    Hi,
    I want Serial number field and table,
    Scenario like this,for returnable packging material we have assigned serial numbers,mtrl type is LEIH,so for tracking of RTP material now we are going to Develop one Report for this i need ur Help.
    Logic is:1)Matrl doc at the time of Delievery.
                Qty,Posting Date,Customer,Mvt type,Serial numbers for all.
                 Beacause at the time of Del we are mentioned all serial numbrs.
                2)Material Document at the time of GI.
                Same field as mentioned as above.
    After that,3)System is to Calculate How many Matrl are deliever to Custmer upto current  Period.Say  10.
    4)Calculte  How many Matrl are Recieved from the Custmer upto current  period.say 5
    5)Del - Issue=Total Number of Material is in Customer side.Say 5
    6)According to the Serial Number wise system has to calculate in which month delieverred matrl is in still customer side.
    (Ex PGI date 20.02.2007  3 qty
    Serial Number    1,2,3
    Issue date    20.03.2007   2 qty
    Serial Number    2,3
    Serial number  1 still is in Customer side.
    Age is 2 month)
    I am giving simple ex.
    so pls any body is having this idea pls Shared with me.
    Thanks
    Raghu

    Hi Raghu,
    Check table SER01(Document Header for Serial Numbers for Delivery).
    OBJK is the object table and you will have SERNR as serial number in this table.
    check table EQUI
                          EQUI -SERGE
                          EQUI-GERNR.
    EQUI-SERGE is Manufacturer serial number.chk if this is the one u r looking for.
    MARC-SERNP.
    key in plant and material in this table to fetch the Serial number profile of the material.
    Check in IKPF AND ISEG Tables... ( inventory )
    MSEG~EQUNR
    Hope it will hep u
    Regards
    Hareesha

  • Delivery Schedule Number or Delivery Plan Number field

    Hi,
    In MM which field refers to Delivery Schedule number (or Delivery Plan number)
    Advance Thanks
    Aadarsh

    Hi Sanjeev,
    Sorry. That is not the one. ETENR is of NUMC 4. But the field I am seeing is atleat 8 characters (maybe 10).
    I dont have any further information than the name given :
    Delivery Schedule Number or Delivery Plan Number field.
    I can further say to you that this is being used in Vendor Decleration
    Regards
    Aadarsh

Maybe you are looking for