[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-sql
Subject:    Re: [SQL] What is wrong?
From:       Stephan Szabo <sszabo () megazone23 ! bigpanda ! com>
Date:       2001-09-29 6:19:21
[Download RAW message or body]


On 28 Sep 2001, Wei Weng wrote:

> Hi there. I wrote a simple postgresql sql function as follows:
> 
> create function test() returns integer as '
> begin
> fixed_path := translate (''/text'', ''\\'', ''/'');
> raise notice ''fixed_path:'', fixed_path;
> return 1;
> end
> ' language 'plpgsql';
> 
> And when I ran it as 
> 
> pgsql>select test();
> 
> I got:
> 
> NOTICE:  plpgsql: ERROR during compile of test near line 8
> ERROR:  unterminated string starting on line 10
> 
> What is wrong? (something fishy about translate function?) Could anyone
> enlighten me on this?

I think you need to use four backslashes to do the quoting for the
backslash.  Plus you're going to need to declare that variable.


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic