#NEWLINE# def convertInterval( dataType , value ) : #NEWLINE# #INDENT# value = value . strip ( ) #NEWLINE# if ( dataType == 'INTERVAL YEAR' ) : #NEWLINE# #INDENT# return _convertScalarInterval ( dataType , value , 'years' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dataType == 'INTERVAL YEAR TO MONTH' ) : #NEWLINE# #INDENT# return _convertInterval ( dataType , value , yearToMonthIntervalRegEx , 'years' , 'months' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dataType == 'INTERVAL MONTH' ) : #NEWLINE# #INDENT# return _convertScalarInterval ( dataType , value , 'months' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dataType == 'INTERVAL DAY' ) : #NEWLINE# #INDENT# return _convertScalarInterval ( dataType , value , 'days' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dataType == 'INTERVAL DAY TO HOUR' ) : #NEWLINE# #INDENT# return _convertInterval ( dataType , value , dayToHourIntervalRegEx , 'days' , 'hours' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dataType == 'INTERVAL DAY TO MINUTE' ) : #NEWLINE# #INDENT# return _convertInterval ( dataType , value , dayToMinuteIntervalRegEx , 'days' , 'hours' , 'minutes' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dataType == 'INTERVAL DAY TO SECOND' ) : #NEWLINE# #INDENT# return _convertInterval ( dataType , value , dayToSecondIntervalRegEx , 'days' , 'hours' , 'minutes' , 'seconds' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dataType == 'INTERVAL HOUR' ) : #NEWLINE# #INDENT# return _convertScalarInterval ( dataType , value , 'hours' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dataType == 'INTERVAL HOUR TO MINUTE' ) : #NEWLINE# #INDENT# return _convertInterval ( dataType , value , hourToMinuteIntervalRegEx , 'hours' , 'minutes' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dataType == 'INTERVAL HOUR TO SECOND' ) : #NEWLINE# #INDENT# return _convertInterval ( dataType , value , hourToSecondIntervalRegEx , 'hours' , 'minutes' , 'seconds' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( value == 'INTERVAL MINUTE' ) : #NEWLINE# #INDENT# return _convertScalarInterval ( dataType , value , 'minutes' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dataType == 'INTERVAL MINUTE TO SECOND' ) : #NEWLINE# #INDENT# return _convertInterval ( dataType , value , minuteToSecondIntervalRegEx , 'minutes' , 'seconds' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( dataType == 'INTERVAL SECOND' ) : #NEWLINE# #INDENT# return _convertInterval ( dataType , value , secondIntervalRegEx , 'seconds' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return value