select to_char('10','10')
from dual
This gives me an error oRA-1481 INVALID NUMBER FORMAT MODEL
why? pls help
Answers were Sorted based on User's Feedback
Answer / mohammad islam
The format is to_char('10','0,999.99')
or to_char(10,'0,999.99')
What is the meaning of it? It means 10 has to be 4 digit
long number with comma after the first digit and 2 digit
decimal places
like 0,010.00
But for to_char('10','0999.99'), the result would be
0010.00 because 4 digit before the decimal place with no
comma and 2 digit after the decimal place
And for TO_CHAR(1230,'00,999.99'), the result is
01,230.00(as you see 5 digit before decimal and 2 digit
after decimal and comma after 2 digit.
I hope it will clear everything
Thanks,
Mohammad Islam
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / avinash
To_char function accepts only 1 parameter.
So the syntax should be as follows.
select TO_CHAR(10) from dual;
| Is This Answer Correct ? | 16 Yes | 6 No |
Answer / kumar
We can use TO_CHAR function in two ways.
1. To convert a number into a character.
TO_CHAR(-) will take one parameter i.e, number
2. To convert a date into a character.
TO_CHAR(-,-) will take two parameters
i) first parameter is the date
ii) Second parameter is format in which we have to
convert, that to the second parameter should be enclosed
with single Quotes.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / neha k
to_char function can take both Number and String Values but
one at a time.
ie. select to_char(10) from dual;
select to_char('10') from dual;
both are valid.
Another form of overloaded function to_char accepts two
arguments first is Date and second if its format in which
it needs to be converted as string.
ie. select to_char(sysdate,'YYYYMMDD') from dual;
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / kanan
in this query first 10 is value you want to convert to
character and second value is format ;format can
be '9999.99' or '09999.99' but '10' is not valid
format .you should be thorough at the formats used on
to_char before implementing this .To_char can take upto
three parameters .
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / rpk
adding to the above answer to_char function takes only the
number value
i.e select to_char(10) from dual;
| Is This Answer Correct ? | 3 Yes | 3 No |
how to delete all duplicate records from a table using subquery?
In which dictionary table or view would you look to determine at which time a snapshot or MVIEW last successfully refreshed?
Explain an index?
what is data independence exactly? give an example
What is object data modeling?
What are operators in oracle?
what is main def between plsql/table and array?
I am using an Oracle 8i Database my data contains Clob data. I am using toad version 7.6 i am able to get the data in toad but unable to extract the data in excel.when trying to extract the data into the excel the toad error says out of memory. Can any body please help me to extract the data through the same toad version. Thanks in advance
1) What is dense ranking? 2) Difference between Substring and Instring? 3) Case and Decode? 4) Pseudo column? 5) View vs Materialized views? 6) SQl performance tuning?
List out the components of logical database structure of oracle database.
What is cursor
while i take backup using ibm tsm the following errors occurred: rman-03009 ora-19513 ora-27206 ora-19502 ora-27030 ora-ora19511