| From: | Dorin Grunberg <dorin(at)visgen(dot)com> |
|---|---|
| To: | karl(at)tecc(dot)co(dot)uk (Karl Orbell), pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: position(text,text) function |
| Date: | 2001-07-23 17:58:52 |
| Message-ID: | 4.3.2.7.2.20010723135813.00b50630@pophost |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
The correct way would be:
select position('el' in 'Hello');
Dorin
At 02:27 PM 7/23/01 +0000, Karl Orbell wrote:
>I'm having trouble using the position function, it's a simple built-in
>function.
>
>It returns the index of a substring within a main string.
>
>But, I just can't get it to work, it always gives this silly parser error.
>I've tried it in a variety of ways with variables instead of constants
>casting
>to text and using it in other contexts, (ie. in functions, not just in a
>select). What am I doing wrong? Is this not the correct syntax for a two
>argument function?
>
>test=# select position('hello','el');
>ERROR: parser: parse error at or near ","
>
>
>Karl Orbell.
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
| From | Date | Subject | |
|---|---|---|---|
| Next Message | omid omoomi | 2001-07-23 18:09:13 | Re: position(text,text) function |
| Previous Message | Stephan Szabo | 2001-07-23 17:49:52 | Re: unique index on more than one field using functions |