dba:sqlplus_scientific_notation
Wissenschaftliche Zahlendarstellung in SQL*Plus
SQL*Plus Einstellung "numwidth"
Ab der mit dem Parameter numwidth eingestellten Stellenzahl werden Zahlen in „scientific notation“ dargestellt.
SHOW numwidth numwidth 10 SELECT 1000000000 FROM dual; 1000000000 ----------- 1,00E+09 SET numwidth 12 r 1000000000
Rechnen
In SQL*Plus kann auch direkt mit EE Zahlen gerechnet werden.
sql>SELECT 100 * 10E+03 FROM dual; 100*10E+03 ----------- 1,00E+06
SQL*Plus Einstellung "numformat"- immer Zahlen in der EE Notation ausgeben
Der Format String für die „scientific notation“ ist für to_char und SQL*Plus „EEEE“, wie zum Beispiel: „999G999D99EEEE“
SET numformat "999G999D99EEEE" SELECT 10 FROM dual; 10 ----------- 1,00E+01
Format Modell für to_char siehe hier⇒ http://docs.oracle.com/cd/E11882_01/server.112/e41084/sql_elements004.htm#SQLRF00211
Expliziertes Wandeln mit to_char und Format Maske EEE
SQL>SELECT to_char(100*10E+03,'999G999D99EEEE') FROM dual; TO_CHAR(100 ----------- 1,00E+06
dba/sqlplus_scientific_notation.txt · Zuletzt geändert: 2014/01/10 20:53 von gpipperr