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

why? pls help

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to open a cursor variable?

622


What is a select query statement in oracle?

551


How to run queries on external tables?

581


what are the advantages of running a database in archive log mode?

1743


What is using clause and give example?

595






What is a system tablespace?

616


What are the predefined tablespaces in a database?

562


Is java required for oracle client?

560


How to connect ms access to oracle servers?

560


What is the difference between primary key and unique key and foreign key in oracle?

560


What is the use of aggregate functions in oracle?

591


How to delete a column in an existing table in oracle?

611


Can we convert a date to char in oracle and if so, what would be the syntax?

562


What is a trigger and what are its types?

623


How to work with data objects interactively?

565