Results for TO_CHAR


1 to 40 of 457 results. Prev  Next
Results per page:  20 |  40  | 60


Database SQL Language Reference, 11g Release 2 (11.2)

TO_CHAR (character)

TO_CHAR (character)Syntax to_char_char::= Description of the illustration ''to_char_char.gif'' Purpose TO_CHARTO_CHAR('01110') FROM DUAL; TO_CH ----- 01110 Compare this example with the first example for TO_CHAR … character set: SELECT TO_CHAR(ad_sourcetext) FROM print_media WHERE product_id = 2268; TO_CHAR

Database SQL Language Reference, 11g Release 2 (11.2)

TO_CHAR (number)

TO_CHAR (number)Syntax to_char_number::= Description of the illustration ''to_char_number.gif'' Purpose TO_CHAR … applied after the format is applied. Thus TO_CHAR(-1, '$9') returns -$1, rather than $-1. Refer to … string and a number into a number: SELECT TO_CHAR('01110' + 1) FROM DUAL; TO_C ---- 1111 Compare this … example with the first example

Database SQL Language Reference, 11g Release 2 (11.2)

TO_CHAR (datetime)

TO_CHAR (datetime)Syntax to_char_date::= Description of the illustration ''to_char_date.gif'' Purpose TO_CHAR … shows the results of applying TO_CHAR to different TIMESTAMP data types. The result for a TIMESTAMP WITH … -8:00', TIMESTAMP'1999-12-02 10:00:00 -8:00', TIMESTAMP'1999-12-02 10:00:00 -8:00'); SELECT TO_CHAR … (ts_col, 'DD-MON-YYYY HH24:MI:SSxFF')

OLAP DML Reference, 11g Release 2 (11.2)

TO_CHAR

datetime-expNLS_DATE_LANGUAGE or NLS_TERRITORY; set NLS_DATE_LANGUAGE instead. While TO_CHAR saves and restores the … statement, TO_CHAR cannot save and restore any side effects of changing that option. For example … other options. When you change the value of NLS_TERRITORY in a call to TO_CHAR, all of these options … new value for the duration

OLAP DML Reference, 11g Release 2 (11.2)

TO_CHAR

TO_CHARThe TO_CHAR function converts a DATETIME, number, or NTEXT expression to a TEXT expression in a … TO_CHAR( datetime-exp, [ datetime-fmt,] [ option setting ]) or TO_CHAR( num-exp, [ num-fmt,] [ nlsparams ]) or TO_CHAR( ntext-exp) Parameters

OLAP Expression Syntax Reference, 11g Release 2 (11.2)

TO_CHAR (character)

TO_CHAR (character)TO_CHAR(character) converts a text expression to the database character set. Return Value VARCHAR2 … Syntax TO_CHAR(exp) Arguments char is a text expression. If it contains characters that are not … TO_CHAR('¡Una qué sorpresa!') returns the value ?Una qu? sorpresa! Two letters are lost in the conversion … ( ¡ and é ) because they

OLAP Expression Syntax Reference, 11g Release 2 (11.2)

TO_CHAR (datetime)

TO_CHAR (datetime)TO_CHAR(datetime) converts a datetime or interval expression to a text string in a specified format … . Return Value VARCHAR2 Syntax TO_CHAR({ datetime | interval } [, fmt [, 'nlsparam' ] ]) Arguments … in the session date language. Examples TO_CHAR(SYSDATE) returns a value such as 11-APR-08. TO_CHAR … (SYSDATE,

OLAP Expression Syntax Reference, 11g Release 2 (11.2)

TO_CHAR (number)

TO_CHAR (number)TO_CHAR(number) converts a numeric expression to a text value in the database character set. Return … Value VARCHAR2 Syntax TO_CHAR(n [, fmt [, 'nlsparam' ] ]) Arguments n is a numeric expression to be … default values for your session. Examples TO_CHAR(1234567, 'C9G999G999D99') returns a text string such … as USD1,234,567.00.

TimesTen In-Memory Database SQL Reference, 11g Release 2 (11.2)

Functions

TO_CHARThe TO_CHAR function converts a DATE, TIMESTAMP or numeric input value to a VARCHAR2. If you are … using TimesTen type mode, for information on the TO_CHAR function, see the Oracle TimesTen In-Memory … Database Release 6.0.3 documentation. SQL syntax TO_CHAR ( Expression1[, Expression2 [, Expression3 … ]]) Parameters TO_CHAR

Database SQL Language Reference, 11g Release 2 (11.2)

Data Type Comparison Rules

to CHAR,VARCHAR2,NCHAR,NVARCHAR2 to NUMBER to Datetime/Interval to RAW to ROWID to LONG,LONG RAW to…from CHAR, VARCHAR2, NCHAR, NVARCHAR2 TO_CHAR (char.) TO_NCHAR (char.) TO_NUMBER TO_DATE … TO_BINARY_FLOAT TO_BINARY_DOUBLE from NUMBER TO_CHAR (number) TO_NCHAR (number) -- TO_DATE NUMTOYM- INTERVAL … NUMTODS- INTERVAL -- -- -- -- TO_BINARY_FLOAT TO_BINARY_DOUBLE from Datetime/ Interval TO_CHAR (date … -- -- from CLOB, NCLOB,

Database SQL Language Reference, 11g Release 2 (11.2)

Format Models

Format Model ExamplesThe following statement uses a date format model to return a character expression: SELECT TO_CHAR … (SYSDATE, 'fmDDTH') || ' of ' || TO_CHAR(SYSDATE, 'fmMonth') || ', ' || TO_CHAR(SYSDATE, 'YYYY … modifier. If FM is omitted, then the month is blank-padded to nine characters: SELECT TO_CHAR(SYSDATE … , 'DDTH')

Database PL/SQL Language Reference, 11g Release 2 (11.2)

PL/SQL Language Fundamentals

Operator Operation; b INTEGER:= (1+2)**2; BEGIN DBMS_OUTPUT.PUT_LINE('a = ' || TO_CHAR(a)); DBMS_OUTPUT.PUT_LINE('b … = ' || TO_CHAR(b)); END; / Result: a = 5 b = 9 When parentheses are nested, the most deeply nested … = ' || TO_CHAR(a)); END; / Result: a = 3 You can also use parentheses to improve readability, as in Example … ('a = ' || TO_CHAR(a));

Database SQL Language Reference, 11g Release 2 (11.2)

Single-Row Functions

Conversion FunctionsTO_BLOB TO_CHAR (character) TO_CHAR (datetime) TO_CHAR (number) TO_CLOB TO_DATE TO_DSINTERVAL TO_LOB

Database PL/SQL Language Reference, 11g Release 2 (11.2)

PL/SQL Packages

How STANDARD Package Defines the PL/SQL EnvironmentSTANDARD contains these declarations: FUNCTION TO_CHAR (right DATE) RETURN VARCHAR2; FUNCTION … TO_CHAR (left NUMBER) RETURN VARCHAR2; FUNCTION TO_CHAR (left DATE, right VARCHAR2) RETURN VARCHAR2 … ; FUNCTION TO_CHAR (left NUMBER, right VARCHAR2) RETURN VARCHAR2; PL/SQL resolves an invocation of TO_CHAR

TimesTen In-Memory Database SQL Reference, 11g Release 2 (11.2)

Expressions

Format model for TO_CHAR of TimesTen datetime data typesUse this format model when invoking the TO_CHAR function to convert a datetime value of … TT_TIMESTAMP or TT_DATE. In addition, use this format model when invoking the TO_CHAR function to convert any … less than 1e-126 or greater than 1e126 is specified as input to the TO_CHAR function, TimesTen

Database Administrator's Guide, 11g Release 2 (11.2)

Administering Oracle Scheduler

Examples of Setting Attributesinitialize a JOBATTR object type newattr:= sys.jobattr(job_name => 'TESTJOB' || to_char(i), attr_name … ; newattr:= sys.jobattr(job_name => 'TESTJOB' || to_char(i), attr_name => 'COMMENTS', attr_value => 'Test … ' || to_char(i), attr_name => 'END_DATE', attr_value => systimestamp + interval '24' hour); newattrarr(j … ):= newattr;

Database PL/SQL Language Reference, 11g Release 2 (11.2)

PL/SQL Control Statements

EXIT StatementDBMS_OUTPUT.PUT_LINE ('Inside loop: x = ' || TO_CHAR(x)); x:= x + 1; IF x > 3 THEN EXIT; END IF; END LOOP; -- After … EXIT, control resumes here DBMS_OUTPUT.PUT_LINE(' After loop: x = ' || TO_CHAR(x)); END; / Result

Database SQL Language Reference, 11g Release 2 (11.2)

SYSTIMESTAMP

SYSTIMESTAMPspecify fractional seconds: SELECT TO_CHAR(SYSTIMESTAMP, 'SSSSS.FF') FROM DUAL; TO_CHAR(SYSTIME

Database PL/SQL Language Reference, 11g Release 2 (11.2)

PL/SQL Collections and Records

Assigning NULL to Record Variable') || ' '); DBMS_OUTPUT.PUT(NVL(name.last, 'NULL') || ', '); DBMS_OUTPUT.PUT(NVL(TO_CHAR(name.age.years), 'NULL') || ' yrs … '); DBMS_OUTPUT.PUT_LINE(NVL(TO_CHAR(name.age.months), 'NULL') || ' mos'); END; BEGIN print_name; name

Database SQL Language Reference, 11g Release 2 (11.2)

Format Models

Format Modelsof the TO_CHAR and TO_DATE functions to specify: The format for Oracle to use to return a value … for examples of using format models TO_CHAR (datetime), TO_CHAR (number), and TO_DATE Oracle

Database SQL Language Reference, 11g Release 2 (11.2)

Compound Expressions

Compound Expressions' || 'SMITH') LENGTH('MOOSE') * 57 SQRT(144) + 72 my_fun(TO_CHAR(sysdate,'DD-MMM-YY'))

Database SQL Language Reference, 11g Release 2 (11.2)

Format Models

The RR Datetime Format Element… RR Datetime Format Examples Assume these queries are issued between 1950 and 1999: SELECT TO_CHAR … (TO_DATE('27-OCT-98', 'DD-MON-RR'), 'YYYY') \"Year\" FROM DUAL; Year ---- 1998 SELECT TO_CHAR(TO_DATE … issued between 2000 and 2049: SELECT TO_CHAR(TO_DATE('27-OCT-98', 'DD-MON-RR'), 'YYYY') \"Year\" FROM … DUAL; Year

Database PL/SQL Language Reference, 11g Release 2 (11.2)

PL/SQL Collections and Records

NLS Parameter Values Affect Associative Arrays Indexed by Stringwith indexes of any data type that the TO_CHAR function can convert to VARCHAR2. (For information … about TO_CHAR, see Oracle Database SQL Language Reference.) If your indexes have data types other … initialization parameters change. For example: Do not use TO_CHAR(SYSDATE) as an index. If the … value of NLS_DATE_FORMAT changes,

Database SQL Language Reference, 11g Release 2 (11.2)

Format Models

char 'fmt' Match or Error?… The following statement selects the salaries of the employees in Department 80 and uses the TO_CHAR … format model ' $99,990.99 ': SELECT last_name employee, TO_CHAR(salary, '$99,990.99') FROM employees … which each employee from Department 20 was hired and uses the TO_CHAR function to convert these … ': SELECT last_name

Database SQL Language Reference, 11g Release 2 (11.2)

TO_BINARY_FLOAT

TO_BINARY_FLOATthe same purpose as for the TO_CHAR (number) function. The incase-sensitive string ' INF ' is … supported by the BINARY_FLOAT. See Also: TO_CHAR (number) and \"Floating-Point Numbers\" Examples Using

Database SQL Language Reference, 11g Release 2 (11.2)

Format Models

Number Format ModelsYou can use number format models in the following functions: In the TO_CHAR function to translate a … are using TO_CHAR with a restrictive number format string, causing a rounding operation. If a

Database SQL Language Reference, 11g Release 2 (11.2)

TO_NUMBER

TO_NUMBERthe TO_CHAR function for number conversions. Refer to TO_CHAR (number) for more information. This

Database SQL Language Reference, 11g Release 2 (11.2)

Format Models

Format Model ModifiersThe FM and FX modifiers, used in format models in the TO_CHAR function, control blank padding and … to TO_CHAR and TO_* datetime functions or they are retrieved from the NLS environment of the current … not padded. The FM modifier suppresses the above padding in the return value of the TO_CHAR

Database PL/SQL Language Reference, 11g Release 2 (11.2)

PL/SQL Language Fundamentals

Comments… (The SQL function TO_CHAR returns the character equivalent of its argument. For more information … about TO_CHAR, see Oracle Database SQL Language Reference.) Example 2-7 Multiline Comments DECLARE … . */ area:= pi * radius**2; DBMS_OUTPUT.PUT_LINE('The area is: ' || TO_CHAR(area)); END; / Result: The

Database PL/SQL Language Reference, 11g Release 2 (11.2)

PL/SQL Control Statements

EXIT WHEN Statement: x = ' || TO_CHAR(x)); x:= x + 1; -- prevents infinite loop EXIT WHEN x > 3; END LOOP; -- After … EXIT statement, control resumes here DBMS_OUTPUT.PUT_LINE('After loop: x = ' || TO_CHAR(x)); END … sum of products equals: ' || TO_CHAR(s)); END; / Result: The sum of products equals: 166 An EXIT WHEN

Database SQL Language Reference, 11g Release 2 (11.2)

Data Types

DATE Data Typedate format model \"J\" with date functions TO_DATE and TO_CHAR to convert between Oracle DATE values … the Julian equivalent of January 1, 2009: SELECT TO_CHAR(TO_DATE('01-01-2009', 'MM-DD-YYYY'),'J … ') FROM DUAL; TO_CHAR ------- 2454833 See Also: \"Selecting from the DUAL Table\" for a description of the DUAL table

Database PL/SQL Language Reference, 11g Release 2 (11.2)

PL/SQL Control Statements

CONTINUE Statementloop: x = ' || TO_CHAR(x)); x:= x + 1; IF x Result: Inside loop: x = 0 Inside loop: x = 1 Inside

Database SQL Language Reference, 11g Release 2 (11.2)

SYSDATE

SYSDATEoperating system date and time: SELECT TO_CHAR (SYSDATE, 'MM-DD-YYYY HH24:MI:SS') \"NOW\" FROM DUAL; NOW ------------------- 04-13-2001 09:45:51

Database SQL Language Reference, 11g Release 2 (11.2)

Format Models

Datetime Format Models… (The TO_ * datetime functions are TO_DATE, TO_TIMESTAMP, and TO_TIMESTAMP_TZ.) In the TO_CHAR

Database SQL Language Reference, 11g Release 2 (11.2)

Multiset Conditions

IS EMPTY Conditionwhich the ad_textdocs_ntab nested table column is not empty: SELECT product_id, TO_CHAR(ad_finaltext

Database PL/SQL Language Reference, 11g Release 2 (11.2)

PL/SQL Language Fundamentals

Assigning Values to Variables with the SELECT INTO StatementWHERE employee_id = 100; END; DBMS_OUTPUT.PUT_LINE('bonus = ' || TO_CHAR(bonus)); / Result: bonus = 2646

Database Administrator's Guide, 11g Release 2 (11.2)

Repairing Corrupted Data

Example: Fixing Corrupt Blocksfix: ' || TO_CHAR(num_fix)); END; / SQL*Plus outputs the following line: num fix: 1 The following

Database PL/SQL Language Reference, 11g Release 2 (11.2)

PL/SQL Data Types

SIMPLE_INTEGER Subtype of PLS_INTEGER(TO_CHAR(n, 'S9999999999')); END LOOP; FOR j IN 1..4 LOOP n:= n - 1; DBMS_OUTPUT.PUT_LINE(TO_CHAR(n

Database SQL Language Reference, 11g Release 2 (11.2)

TRIM

TRIMemployee_id, TO_CHAR(TRIM(LEADING 0 FROM hire_date)) FROM employees WHERE department_id = 60 ORDER … BY employee_id; EMPLOYEE_ID TO_CHAR(T ----------- --------- 103 20-MAY-08 104 21-MAY-07 105 25-JUN-05 106 5-FEB-06 107 7-FEB-07

Database SQL Language Reference, 11g Release 2 (11.2)

TO_BINARY_DOUBLE

TO_BINARY_DOUBLEthe same purpose as for the TO_CHAR (number) function. The case-insensitive string ' INF ' is … BINARY_FLOAT to BINARY_DOUBLE are exact. See Also: TO_CHAR (number) and \"Floating-Point Numbers





Was this page helpful?

Integrated Cloud Applications & Platform Services