Ejemplo n.º 1
0
    def __init__(self, tipo, valor):
        Expresion.__init__(self)
        self.tipo = tipo
        self.valor = valor
        if (self.tipo.tipo == 'varchar' or self.tipo.tipo == 'char'
                or self.tipo.tipo == 'character varyng'
                or self.tipo.tipo == 'text' or self.tipo.tipo == 'character'):
            self.stringsql = "\'" + str(self.valor) + "\'"
        elif (self.tipo.tipo == 'timestamp without time zone'):
            self.stringsql = str(self.valor) + "()"
        elif (str(self.valor) == 'pi' or str(self.valor) == 'random'):
            self.stringsql = str(self.valor) + '()'

        else:
            self.stringsql = str(self.valor)
Ejemplo n.º 2
0
 def __init__(self, identificador, expresiones):
     Expresion.__init__(self)
     self.identificador = identificador
     self.expresiones = expresiones
     self.stringsql = self.identificador+'('
     i = 0
     if self.expresiones!=None:
         for i in range(0, len(self.expresiones), 1):
             if str(self.identificador).lower() == 'convert':
                 self.stringsql += '\'' + self.expresiones[i].stringsql+'\' as '+ self.expresiones[i].tipo.tipo
             else:
                 if (i == 0):
                     self.stringsql += self.expresiones[i].stringsql
                 else:
                     self.stringsql += ', ' + self.expresiones[i].stringsql
             i = i + 1
         self.stringsql += ')'
Ejemplo n.º 3
0
 def __init__(self, exp1, operador):
     Expresion.__init__(self)
     self.exp1 = exp1
     self.operador = operador
Ejemplo n.º 4
0
 def __init__(self, tipo, valor):
     Expresion.__init__(self)
     self.tipo = tipo
     self.valor = valor
Ejemplo n.º 5
0
 def __init__(self, tipo, nombre=''):
     Expresion.__init__(self)
     self.tipo = tipo
     self.nombre = nombre
     self.valor = nombre
     self.stringsql = nombre
Ejemplo n.º 6
0
 def __init__(self, cadena, exps):
     Expresion.__init__(self)
     self.cadena = cadena
     self.exps = exps
Ejemplo n.º 7
0
 def __init__(self, identificador, expresiones):
     Expresion.__init__(self)
     self.identificador = identificador
     self.expresiones = expresiones
Ejemplo n.º 8
0
Archivo: Id.py Proyecto: AllVides/tytus
 def __init__(self, tipo, nombre=''):
     Expresion.__init__(self)
     self.tipo = tipo
     self.nombre = nombre
Ejemplo n.º 9
0
 def __init__(self, exp1,operador) :
     Expresion.__init__(self)
     self.exp1 = exp1
     self.operador = operador
     self.stringsql+= self.operador +' '
     self.stringsql+= str(exp1.stringsql) +' '