SQLite Forum

.param converts text to number - How to avoid this
Login
You have to quote a string.

```
sqlite> .param set t "'2010-01-01'"
sqlite> .param list
t '2010-01-01'
sqlite>
```

This is because the expression is evaluated and the outer quotes are stripped by the tokenizer.  So if you really want a string you have to make it look like one.  Note that this only applies if the expression can be evaluated -- if it cannot be evaluated then it must be a string:

```
sqlite> .param set $t "'2010-01-01'"
sqlite> .param set $u sin(5)
sqlite> .param set $v '2010-01-01 00:00:00'
sqlite> .param list
$t '2010-01-01'
$u -9.58924274663138453967e-01
$v '2010-01-01 00:00:00'
sqlite> select $t, $u, $v;
┌────────────┬────────────────────┬─────────────────────┐
│     $t     │         $u         │         $v          │
├────────────┼────────────────────┼─────────────────────┤
│ 2010-01-01 │ -0.958924274663138 │ 2010-01-01 00:00:00 │
└────────────┴────────────────────┴─────────────────────┘
```

ie, there is no internal function called goupta():

```
sqlite> .param set t goupta(1)
sqlite> .param list
t 'goupta(1)'
sqlite>
```