Announcement

Collapse
No announcement yet.

Datentypkonventierung in PLSQL

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Datentypkonventierung in PLSQL

    Hallo Liebe Genosse,

    Hat jemand die Ahnung, wie man von SYSDATE auf z.B. '12-AUS-10' Datentypen konventieren?

    Meine CODE:

    SET SERVEROUTPUT ON
    DECLARE
    --> var. 'today' deklarieren und initialisieren
    today DATE:=SYSDATE;
    --> 2: deklariert tomorrow mit Attr.%TYPE
    tomorrow today%TYPE;
    --> 3. ini. 'tomorrow' im ausführbarem Bereich
    BEGIN
    tomorrow:=today +1;
    DBMS_OUTPUT.PUT_LINE('Hallo World!');
    DBMS_OUTPUT.PUT_LINE('TODAY IS:' || today);
    DBMS_OUTPUT.PUT_LINE('TOMORROW IS: ' || tomorrow);
    END;
    /

    Output von diese Code läutet:
    - Hallo World
    - TODAY IS 12.08.10
    - TOMMOROW IS 13.08.10

    Mein Ziel ist:
    - Hallo World
    - TODAY IS 12-AUS-10
    - TOMMOROW IS 13-AUS-10

    Ich danke voraus

  • #2
    Hi,

    dafür gibt's die to_char Funktion und die zugehörigen Formatierungsangaben.

    Dim
    Zitat Tom Kyte:
    I have a simple philosophy when it comes to the Oracle Database: you can treat it as a black box and just stick data into it, or you can understand how it works and exploit it as a powerful computing environment.

    Comment

    Working...
    X