Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Specifying scale and precision of number literal in a view
Hello out there,
I'm looking for a way to get a number literal in a view (or subquery) to display as e.g. number(4).
When I do
create view vtest as select 111 mycol from dual;
I get mycol dispalyed as number.
I tried
create view vtest as select cast(111 as number(4)) mycol from dual; create view vtest as seelct to_number('111','999') mycol from dual;
without success.
I would have done Google search but I did not come up with some reasonable key words to search for. :-)
The background is that I have an application that makes selects on
different tables but displays the results in the same datagrid (using
Borland Delphi). To do some client side calculations I have to predefine
the datadypes of the result columns. All tables have one column as, say,
number(4) but one does not have it, so I want to put a literal in the
select statement. Now the literal becomes number which is interpreted as
float an not as integer as it should.
I could convert all other columns to nummber but I'd rather like to
convert the literal to number(4).
The Oracle version is 9.0.1.3.1 on W2k.
Any Ideas?
Many thanks in advance.
Lothar
-- Lothar Armbrüster | la_at_oktagramm.de Hauptstr. 26 | la_at_heptagramm.de D-65346 Eltville | lothar.armbruester_at_t-online.deReceived on Thu Jun 13 2002 - 10:57:51 CDT