Re: Scientific notation for SCN



Ganesh escribió:
**********
SQL> select MAX(NEXT_CHANGE#) from V$ARCHIVED_LOG;

MAX(NEXT_CHANGE#)
-----------------
1.3278E+10

SQL> select TO_CHAR(MAX(NEXT_CHANGE#)) from V$ARCHIVED_LOG;

TO_CHAR(MAX(NEXT_CHANGE#))
----------------------------------------
13278230177

SQL> select TO_CHAR(MAX(NEXT_CHANGE#), 999999999999999999999) from V
$ARCHIVED_LOG;

TO_CHAR(MAX(NEXT_CHANGE#))
----------------------------------------
13278230177

**********

But when I give input 1.3278E+10 to my calculator it returns me the
value as 13278000000. So I am not sure why "TO_CHAR" returned
13278230177. So what oracle is doing extra that we are not getting
here.

The 1.3278E+10 you see is the representation of a long number chosen by your SQL console. When you use TO_CHAR() you generate a string so you no longer have a number.

TO_CHAR() accepts an optional argument ("fmt") to specify the format. Docs say:

"If you omit fmt, then n is converted to a VARCHAR2 value exactly long enough to hold its significant digits."

Your SQL console rounds the number to five significant digits but prints the string as-is.



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
.



Relevant Pages

  • Re: Problems with Delete Command
    ... The SQL could get fairly messy if you need to construct it in code, ... ContactID, and WebComID, and create your on-the-fly SQL on that saved query, ... to find the list of ContactIDs from the junction table, ... This is a style/readability thing: if you are going to use string ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Need help with Code Please!!!
    ... posted in response to my last post was some SQL, but this is not the SQL that ... the actual string that gets built at the end of the SQ1 build process. ... The message says Syntax error in query expression ... Dim rs As Recordset 'object ref to qryCompany\USFNumber ...
    (microsoft.public.access.formscoding)
  • RE: Web Part and Access database
    ... I dont know if it is possible to connect to access,but you can download SQL ... Server Error in '/Webparts' Application. ... The connection string specifies a local Sql Server Express instance ... String user, String password, Boolean trusted, String connectionString) ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: INDEXES: BTRIEVE vs EXTFH (cobol)
    ... Bill Bach wrote: ... In SQL, you can specify just about anything, but at the lower MKDE ... the engine has to pick the right Btrieve ... When COBOL needs to find this value, it knows that the key is a string. ...
    (comp.databases.btrieve)
  • Re: INDEXES: BTRIEVE vs EXTFH (cobol)
    ... In SQL, you can specify just about anything, but at the lower MKDE ... the engine has to pick the right Btrieve ... When COBOL needs to find this value, it knows that the key is a string. ...
    (comp.databases.btrieve)

Loading