Chad,
> CREATE OR REPLACE FUNCTION phonenum_substr (varchar)
> RETURNS VARCHAR AS '
> SELECT substr(cr.phonenum, 1, 6) as phonenum
>
> --is cr.phonenum supposed to be $1?
>
> from call_results_fixed cr;
> ' LANGUAGE 'sql' WITH (ISCACHABLE, ISSTRICT);
OOOps! Sorry, got confused:
CORRECT Function is:
CREATE OR REPLACE FUNCTION phonenum_substr (varchar)
RETURNS VARCHAR AS '
SELECT substr($1, 1, 6);
' LANGUAGE 'sql' WITH (ISCACHABLE, ISSTRICT);
-Josh
--
-Josh Berkus
Aglio Database Solutions
San Francisco