![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
i am using a regular expression in a select statement inside a function. how do i dynamically insert a variable into the regexp? eg. SELECT string ~ '\\d{X}' where X is the dynamic variable. I tried '\\d{' || X || '}' obviously it didn't work. is there an equivalent of javascript's eval() in postgresql? |
#3
| |||
| |||
|
|
- wrote: i am using a regular expression in a select statement inside a function. how do i dynamically insert a variable into the regexp? eg. SELECT string ~ '\\d{X}' where X is the dynamic variable. I tried '\\d{' || X || '}' obviously it didn't work. is there an equivalent of javascript's eval() in postgresql? somebody......... help me out please.. i want to put a variable into a WHERE clause e.g WHERE columnname ~ X (X is a variable). how should i do it? columnnane ~ '' || X ||'' doesn't work. |
|
| quote_literal(my_text) || ';'; EXECUTE my_query; |
![]() |
| Thread Tools | |
| Display Modes | |
| |