Informix

Informix

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  Perl-like string manipulation in SPL?

    Posted Thu March 27, 2025 04:53 PM

    Hi again, Family.

    I am rereading up on SPL (which I have not touched in nearly 30 years - and the times, they are a-changin'!) because I found a user request for an interesting constraint on a column in a table.

    • It must look like an email address i.e. yodel@spaceballs.org. (or maybe yodel@spaceballs.org.en for a British email address.)
    • It may contain several email addresses, separated by a semicolon.
    • But a maximum of 3 email addresses.

    I don't believe there is any MATCHES or LIKE expression in SQL that would work for such a complex requirement.  I might conceive of a regular expression in Perl that might handle this but for a check constraint?  Well, for a complex check like this I suppose we'd go to stored procedure invoked in the AFTER clause of the trigger.  But is such detailed character manipulation even possible in SPL?  My instincts leads me to an external procedure/function but written in Perl.  But I'm mainly curious if it is possible in SPL.

    Ideas, anyone?



    ------------------------------
    Jacob Salomon
    ---
    Nobody goes there anymore, it's too crowded.  --Attr: Yogi Berra
    ------------------------------


  • 2.  RE: Perl-like string manipulation in SPL?

    Posted Thu March 27, 2025 04:56 PM
    Use the regex blade

    On 3/27/2025 3:53 PM, Jacob Salomon via IBM TechXchange Community wrote:
    01000195d96192f6-8be75281-8189-4a55-ace8-07d01d6c1d2b-000000@email.amazonses.com">
    Hi again, Family. I am rereading up on SPL (which I have not touched in nearly 30 years - and the times, they are a-changin'!) because I found a...





  • 3.  RE: Perl-like string manipulation in SPL?

    Posted Thu March 27, 2025 05:01 PM
    the older version can be downloaded from here (with source code). It has the same functionality as the official one for most part

    https://www.oninit.com/download/index.php?page=regexp.html



    On 3/27/2025 3:56 PM, Paul Watson via IBM TechXchange Community wrote:
    01000195d964150c-2558b948-39de-466b-bc5d-a7c0d1fcaf3b-000000@email.amazonses.com">
    Use the regex blade On 3/27/2025 3:53 PM, Jacob Salomon via IBM TechXchange Community wrote: ... -posted to the "Informix" group