[NEWSboard IBMi Forum]
  1. #1
    Registriert seit
    Aug 2001
    Beiträge
    2.928

    Unhappy WEEK_ISO in SQL

    Hallo Leute,

    in News400 Januar waren Beispiele, wie man Datums-Funktionen aus SQL in RPG nutzen kann.
    Hat jemand das mal ausprobiert?
    Beim Einsatz der Skalaren Funktion WEEK_ISO()bekomme ich einen Umwandlungs-Fehler:
    SQL1105 : Benutzerdefinierte Art oder Funktion WEEK_ISO in *LIBL nicht gefunden.
    Wir arbeiten mit Release V5R1M0. Laut SQL-Referenz gibt es die Funktion WEEK_ISO() ab Release V5R1M0.

    Übrigens müssen auch alle Host-Variablen, die in Skalaren Funktionen benutzt werden, durch : gekennzeichnet werden!
    (Dies ist sowohl in News400 als auch im Download falsch!)
    Der korrekte Befehl zur Ermittlung des Wochentages muss wie folgt lauten:
    C/Exec SQL
    C+ Set ayOfWeekNbr = DayOfWeek( ateIn )
    C/End-Exec
    Birgitta

    Birgitta Hauser

    Anwendungsmodernisierung, Beratung, Schulungen, Programmierung im Bereich RPG, SQL und Datenbank
    IBM Champion seit 2020 - 5. Jahr in Folge
    Birgitta Hauser - Modernization - Education - Consulting on IBM i

  2. #2
    Registriert seit
    Feb 2002
    Beiträge
    20

    Smile

    Hallo Birgitta,

    habe bei IBM folgendes gefunden:

    APAR#: SE02777
    Component: 5722SS1DB - OS/400 DATABASE
    Release(s): R510

    Abstract
    SQL-CMPL-CURR-MSGSQL1105 NEW JULIAN_DAY, DAYOFWEEK_ISO, WEEK_ISO SCALAR FUNCTIONS DO NOT WORK IN EMBEDDED SQL PROGRAMS

    Error Description
    ******* (Do NOT alter/erase this or next 3 lines) *******
    * EQUIVALENT ABSTRACT:
    SQL-CMPL-CURR-MSGSQL1105 NEW JULIAN_DAY_ DAYOFWEEK_ISO_ WEEK_ISO SCALAR FUNCTIONS DO NOT WORK IN EMBEDDED SQL PROGRAMS

    When compiling embedded SQL C and embedded SQL RPGIV programs with the new SQL scalar functions julian_day, dayofweek_iso and
    week_iso program is created. But when called programs fail with MSGSQL0204 - <scalar function> in *LIBL type *N not found.

    In the spool file created from the CRTSQLCI command you can see the MSGSQL1105 - User defined type or function <scalar function>
    in *LIBL not found warning message.

    Problem Summary
    When compiling embedded SQL C and embedded SQL RPGIV programs with the new SQL scalar functions julian_day, dayofweek_iso and
    week_iso program is created. But when called programs fail with MSGSQL0204 - <scalar function> in *LIBL type *N not found.
    In the spool file created from the CRTSQLCI command you can see the MSGSQL1105 - User defined type or function <scalar function>
    in *LIBL not found warning message.

    Problem Conclusion
    MSGSQL1105 and MSGSQL0204 are issued for the functions DAYOFWEEK_ISO, WEEK_ISO, JULIAN_DAY, MIDNIGHT_SECONDS, PI, TIMESTAMPDIFF and SPACE either at precompile time or when a program is called. With the PTF, the functions will be found as long as valid arguments are specified.

    Temporary Fix

    Comments

    Circumvention
    None.

    PTFs Available
    R510 SI02174 2036

    Affected Modules
    ROCSMGR

    Affected Publications

    Summary Information
    Status.... CLOSED PER
    HIPER..... No
    Component. 5722SS1DB
    Failing Module. ROCSMGR
    Reported Release.R510
    Duplicate Of
    IBM disclaims all warranties, whether express or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. By furnishing this document, IBM grants no licenses to any related patents or copyrights. Copyright (c) 1994, 1995, 1996,1997,1998, 1999, 2000, 2001, 2002 IBM Corporation. Any trademarks and product or brand names referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.

    Oberelch

Similar Threads

  1. RPGLE - SQL
    By christian_lettner in forum NEWSboard Programmierung
    Antworten: 2
    Letzter Beitrag: 16-11-06, 10:15
  2. SQL - Cursor vernichten ?!?
    By FNeurieser in forum NEWSboard Programmierung
    Antworten: 3
    Letzter Beitrag: 11-10-06, 14:53
  3. SQL und OBJLCK
    By malzusrex in forum IBM i Hauptforum
    Antworten: 8
    Letzter Beitrag: 19-09-06, 11:04
  4. SQL - Fehler
    By Kaufmann in forum IBM i Hauptforum
    Antworten: 11
    Letzter Beitrag: 28-06-06, 14:11
  5. SQL .. for update of (RPG embedded SQL)
    By loeweadolf in forum NEWSboard Programmierung
    Antworten: 2
    Letzter Beitrag: 01-06-06, 09:43

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • You may not post attachments
  • You may not edit your posts
  •