¡Caminando hacia el éxito!

Aprende en Comunidad

Avalados por :

Funciones de conversión y formato en los Sistemas de Gestión de Bases de Datos compatibles con SAP Advanced SQL Migration

  • Creado 01/03/2024
  • Modificado 01/03/2024
  • 10 Vistas
0
Cargando...
All the Database Management Systems supported by SAP Advanced SQL Migration (Oracle, SQL Server, IBM DB2 LUW, Teradata and Netezza) allow users to explicitly perform data conversions and also to format outputs when presenting data to the clients. For conversion they use to provide Built-in Functions like cast/convert and while for format they have other Built-in Functions like to_char, check these 2 examples from Teradata:
 BTEQ -- Enter your SQL request or BTEQ command:
    select to_char (12345.67, '$99999,999.99');
    *** Query completed. One row found. One column returned.
    *** Total elapsed time was 1 second.

    to_char(12345.67,'$99999,999.99')
    ---------------------------------
    $12,345.67

    BTEQ -- Enter your SQL request or BTEQ command:
    select cast (to_char (12345, '$99999,999.99') as float);
    *** Query completed. One row found. One column returned.
    *** Total elapsed time was 1 second.

    to_char(12345,'$99999,999.99')
    ------------------------------
    1.23450000000000E 004

But among them all Teradata has a kind of slightly different extra way to do it beside the generic way using the typical functions, their official name in Teradata language is the FORMAT PHASE

The FORMAT PHRASE is an expression using parentheses located after the column and expression, and in it, you can specify things like:

DATA TYPE for the output:
      BTEQ -- Enter your SQL request or BTEQ command:
    SELECT 12345 (FLOAT);
    *** Query completed. One row found. One column returned.
    *** Total elapsed time was 1 second.

    12345
    ----------------------
    1.23450000000000E 004
                
                
Pedro Pascal
Se unió el 07/03/2018
Pinterest
Telegram
Linkedin
Whatsapp

Sin respuestas

No hay respuestas para mostrar No hay respuestas para mostrar Se el primero en responder

contacto@primeinstitute.com

(+51) 1641 9379
(+57) 1489 6964

© 2024 Copyright. Todos los derechos reservados.

Desarrollado por Prime Institute

¡Hola! Soy Diana, asesora académica de Prime Institute, indícame en que curso estas interesado, saludos!
Hola ¿Puedo ayudarte?