• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • The Basics Of XML-SAX

    June 14, 2016 Jon Paris

    Note: The code accompanying this article is available for download here.

    In XML-INTO And Optional Elements, I showed a reader how he could use XML-INTO to parse an XML document that effectively contained one of two completely different payloads. As I noted in that article, for this type of “does the document contain X” processing, XML-SAX can be a better choice than XML-INTO. That is the task that I’m going to demonstrate in this tip.

    In his email, the reader mentioned that his original intent had been to simply identify the type of payload (Report or Event) and

    …

    Read more
  • Easier Overloading of SQL Functions

    June 14, 2016 Hey, Ted

    In Formatting Dates with SQL, Take 2, you have shared a great technique. Function overloading is a real boon to SQL programming. Here’s another way to handle the same issue with what I believe is less code and less invasive (meaning you won’t have to recompile programs that use the FMTDATE service program).

    Leave your original FMTDATE function alone, but add the following to the SQL source:

    create function xxx/fmtdate
    (inDate varchar(8), inFromFmt varchar(8), inToFmt varchar(8))
    returns varchar(10)
    language SQL
    specific FMTDATEA
    deterministic
    returns null on null input
    
    begin
     declare DateNum numeric (8,0);
     declare OutDate varchar(10);
     set DateNum = 
    …

    Read more
  • Inline Table Functions In DB2 For i

    June 14, 2016 Michael Sansoterra

    In DB2 for i 7.2 TR4 and IBM i 7.3, IBM has made a special user-defined table function (UDTF) enhancement that should be shouted from the rooftops. This enhancement is referred to as an inline table function.

    Consider the simple example of this UDTF named Get_Customer_Orders:

    CREATE OR REPLACE FUNCTION Get_Customer_Orders (
    @CustomerID INT,
    @StartDate  DATE,
    @EndDate    DATE)
    RETURNS TABLE (
    SalesOrderId INT,
    CustomerId   INT,
    OrderDate    DATE,
    ShipDate     DATE,
    SUBTOTAL     DEC(19,4))
    LANGUAGE SQL
    NO EXTERNAL ACTION
    DISALLOW PARALLEL
    SET OPTION COMMIT=*NONE,USRPRF=*OWNER,DATFMT=*ISO
        RETURN
            SELECT SalesOrderId,CustomerId,
                   OrderDate,ShipDate,SubTotal
              FROM SalesOrderHeader
             WHERE CustomerId=@CustomerId
               AND OrderDate BETWEEN @StartDate AND @EndDate;
    

    What does DB2 do when

    …

    Read more

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • IBM i Has a Future ‘If Kept Up To Date,’ IDC Says
  • When You Need Us, We Are Ready To Do Grunt Work
  • Generative AI: Coming to an ERP Near You
  • Four Hundred Monitor, March 22
  • IBM i PTF Guide, Volume 25, Number 12
  • Unattended IBM i Operations Continue Upward Climb
  • VS Code Is The Full Stack IDE For IBM i
  • Domino Runs on IBM i 7.5, But HCL Still Working on Power10
  • Four Hundred Monitor, March 6
  • IBM i PTF Guide, Volume 25, Number 11

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2023 IT Jungle