support des certaines valeurs chaine
This commit is contained in:
parent
c408daa44c
commit
b0248c1f33
|
@ -26,13 +26,17 @@ def display_help():
|
|||
|
||||
RE_NUMERIC = re.compile('\d+$')
|
||||
RE_QUOTED = re.compile(r'".*"$')
|
||||
RE_STRING = re.compile(r'[A-Za-z][A-Za-z0-9]*$')
|
||||
def fixvalue(v):
|
||||
if RE_NUMERIC.match(v) is not None:
|
||||
# Les valeurs numériques sont données telles quelles
|
||||
return v
|
||||
if RE_QUOTED.match(v) is not None:
|
||||
elif RE_QUOTED.match(v) is not None:
|
||||
# Les valeurs chaines sont entre guillemets
|
||||
return "'" + v[1:-1] + "'"
|
||||
elif RE_STRING.match(v) is not None:
|
||||
# Certaines valeurs chaine ne sont pas entre guillemets
|
||||
return "'" + v + "'"
|
||||
# Sinon, on assume que c'est une date
|
||||
return "to_date('" + v + "', 'YYYY-MM-DD HH24:MI:SS')"
|
||||
|
||||
|
|
Loading…
Reference in New Issue