#NEWLINE# def visit_substring_func( self , func , **kw ) : #NEWLINE# #INDENT# s = self . process ( func . clauses . clauses [ 0 ] ) #NEWLINE# start = self . process ( func . clauses . clauses [ 1 ] ) #NEWLINE# if ( len ( func . clauses . clauses ) > 2 ) : #NEWLINE# #INDENT# length = self . process ( func . clauses . clauses [ 2 ] ) #NEWLINE# return ( 'SUBSTRING(%s FROM %s FOR %s)' % ( s , self , length ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( 'SUBSTRING(%s FROM %s)' % ( s , start ) )