jarinwhalley / User-Defined-Functions

1 stars 0 forks source link

pgsql evaluator #2

Open jarinwhalley opened 11 years ago

jarinwhalley commented 11 years ago

My code for the pgsql evaluator compiles without issues, but when I run it, it returns at or around the first number in the string str1.

code: https://github.com/jarinwhalley/User-Defined-Functions/blob/master/code/pgsql_evaluator

cegme commented 11 years ago

Can you please attach your sample output.

jarinwhalley commented 11 years ago

Output for the pgsql evaluator:

ERROR: syntax error at or near "581.833"

QUERY: 581.883 + 287.507

CONTEXT: PL/pgSQL function "algebra_pgsql" line 6 at EXECUTE statement

cegme commented 11 years ago

This statement should be prefixed with SELECT

SELECT  581.883 + 287.507;
jarinwhalley commented 11 years ago

If I put a "SELECT" statement in place of the "EXECUTE" statement, the function basically outputs the contents of the string.

cegme commented 11 years ago

No, I mean put SELECT inside the string itself.