IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 27, 2011, 9:48:39 AM (15 years ago)
Author:
rhenders
Message:

new method to replace nulls with a sub in a specific table and column

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/mysql.py

    r31380 r31387  
    9292
    9393    '''
     94    Replaces all NULL values in the provided table and column ith the provided substitute
     95    '''
     96    def replaceNullsInThisColumn(self, tableName, column, sub):
     97
     98      sql = "UPDATE " + tableName + " SET " + column + " = " + sub + " WHERE " + column + " IS NULL"
     99      print sql
     100      self.stmt.execute(sql)
     101
     102    '''
    94103    Replaces all NULL values in the provided table with the provided substitute
    95104    '''
Note: See TracChangeset for help on using the changeset viewer.