Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...



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



select to_char('10','10') from dual This gives me an error oRA-1481 INVALID ..

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

select to_char('10','10') from dual This gives me an error oRA-1481 INVALID ..

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

select to_char('10','10') from dual This gives me an error oRA-1481 INVALID ..

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

select to_char('10','10') from dual This gives me an error oRA-1481 INVALID ..

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

select to_char('10','10') from dual This gives me an error oRA-1481 INVALID ..

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

select to_char('10','10') from dual This gives me an error oRA-1481 INVALID ..

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

Post New Answer

More Oracle General Interview Questions

What are the oracle differences between nvl and coalesce

0 Answers  


What would you do with an in-doubt distributed transaction?

0 Answers  


What is tablespace in oracle? how can we create? how is it manage? . . . Thnx 2 All in Advnc....:)

3 Answers  


how can we write trigger in trigger???????? can we write one trigger on two table???

2 Answers   Value Labs,


In what script is snap$ created? In what script is the scott/tiger schema created?

0 Answers  


What is a select query statement in oracle?

0 Answers  


Can you have more than one content canvas view attached with a window ?

0 Answers   Oracle,


What types of joins are used in writing subqueries?

0 Answers  


what is the scenario where you take the database to NoArchivelog mode?

0 Answers  


while i take backup using ibm tsm the following errors occurred: rman-03009 ora-19513 ora-27206 ora-19502 ora-27030 ora-ora19511

0 Answers  


What to do if the binary spfile is wrong for the default instance?

0 Answers  


I have a table that log salary-increase-process have fields: autoid, old_salary, acctno and table EMP: acctno, name, salary I want to list count increase-salary of employees, each have old_salary, new_salary. Help me with SELECT statement, please!

1 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)