Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.os.vms    |    DEC's VAX* line of computers & VMS.    |    264,096 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 262,802 of 264,096    |
|    Lawrence D'Oliveiro to All    |
|    Re: VMS x86-64 database server    |
|    09 Jul 25 07:22:19    |
   
   From: ldo@nz.invalid   
      
   On Tue, 8 Jul 2025 20:31:37 -0400, Arne Vajhøj wrote:   
      
   > On 7/8/2025 7:37 PM, Lawrence D'Oliveiro wrote:   
   >>   
   >> On Tue, 8 Jul 2025 18:20:50 -0400, Arne Vajhøj wrote:   
   >>>   
   >>> Standards evolve. They add lots of new stuff. And sometimes they   
   >>> remove stuff that is not needed anymore.   
   >>   
   >> But those standards in particular have not evolved.   
   >   
   > SQL standard has evolved. Lot of stuff has been added.   
      
   But nothing new in EXEC SQL. For example, did they offer any   
   equivalent to the following utility functions?   
      
    def sql_string_list(the_list) :   
    "returns a list containing the quoted items of the_list, suitable" \   
    " for use in an “in” clause."   
    return \   
    "(" + ", ".join([sql_string(s) for s in the_list]) + ")"   
    #end sql_string_list   
      
    def escape_sql_wild(s, escch) :   
    "escapes SQL pattern wildcards in s with escch. The same escch needs" \   
    " to be passed to the ESCAPE clause for the LIKE operator."   
    if not isinstance(s, str) :   
    raise TypeError("expecting s to be a string")   
    #end if   
    if not isinstance(escch, str) or len(escch) != 1 :   
    raise TypeError("expecting escch to be a single-character string")   
    #end if   
    result = []   
    for ch in s :   
    if ch == escch or ch == "%" or ch == "_" :   
    result.append(escch)   
    #end if   
    result.append(ch)   
    #end for   
    return "".join(result)   
    #end escape_sql_wild   
      
    def escape_sql_name(n, escch = "\"") :   
    "converts n to escaped form to avoid potential conflicts with SQL   
   keywords" \   
    " and other syntax errors (e.g. from embedded spaces). escch should be   
   “\"”" \   
    " as per the SQL standard."   
    assert len(escch) == 1   
    out = []   
    for i, split1 in enumerate(n.split(escch)) :   
    if i != 0 :   
    out.append(escch * 2)   
    #end if   
    out.append(split1)   
    #end for   
    return escch + "".join(out) + escch   
    #end escape_sql_name   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca