RE: Perl DBI Documentation Proposal: Using NULLs in Placeholders

From: Brian D Campbell (campbelb_at_lucent.com)
Date: 01/26/05

  • Next message: Dean Arnold: "[ANNOUNCE] SQL::Preproc 0.10, an SQL preprocessor for Perl"
    To: dbi-users@perl.org
    Date: Wed, 26 Jan 2005 16:32:55 -0600
    
    
    

    As promised, here's a summary of revisions I made to the material I sent out in December. Attached is the complete material with revisions. Thanks to all of you who responded. I believe that I have your feedback incorporated in the revisions in some form or another.

    The perldoc update...

    1) Change the example's column name from "name" to "fullname".
    2) Changed use of "parameter" to "placeholder".
    3) Fixed the iterating script example.
    4) Addressed the issue that if Example 0 works, Examples 4, 5, and 6 work, even if their features aren't fully supported.
    5) Updated the database-engine/working-example matrix.
    6) A few misc grammar fixes.

    The accompanying perl script...

    1) Documented issue with Sybase columns defaulting to NOT NULL.
    2) Padded char data with blanks for databases (e.g. Oracle) that don't pad char values automatically.
    3) Added display of row ids for styles that return rows, but not the expected rows.
    4) The script no longer relies on output from the "rows" method, and issues a warning if it doesn't "work" as expected.

    -----Original Message-----
    From: CAMPBELL, BRIAN D (BRIAN) [mailto:campbelb@lucent.com]
    Sent: Thursday, December 16, 2004 10:33 AM
    To: dbi-users@perl.org
    Subject: Perl DBI Documentation Proposal: Using NULLs in Placeholders

    Fellow DBI Users,

    Tim Bunce has asked me to help revise the NULLs subsection in the "Placeholders and Bind Values" section in the DBI documention for DBI 1.47. Attached is the proposed text to be included, along with an associated perl script. You are invited to review them. Please send comments back directly to me (not the DBI users mailing list). I'll post a summary in January.
     
    The revision addresses the issue of testing for NULL values in a WHERE clause. There's no "one size fits all" solution, so several options are given. In particular, several examples of WHERE clauses are presented that can support both NULL and non-NULL tests. But the examples tend to rely on database specific features or how flexibly they support placeholders (e.g. Informix supports the NVL function but not with a placeholder).

    Near the bottom of the attached text is a table that lists some database engines and which WHERE clause examples work with them. The table is sparse. Only Informix has been properly tested so far. Any other entries you see are educated guesses. You can help us fill out the table. How? Use the attached perl script that you can run to see which examples actually work on your favorite database engine. I invite you to run it and send the results back to me (not the DBI users mailing list). I'll post a summary. View the top of the perl script for specific instructions. You'll likely want to change the suffix of the script's file name to .pl.

    
    
    




  • Next message: Dean Arnold: "[ANNOUNCE] SQL::Preproc 0.10, an SQL preprocessor for Perl"

    Relevant Pages