Re: position(text,text) function - Mailing list pgsql-sql

From Dorin Grunberg
Subject Re: position(text,text) function
Date
Msg-id 4.3.2.7.2.20010723135813.00b50630@pophost
Whole thread Raw
In response to position(text,text) function  (karl@tecc.co.uk (Karl Orbell))
List pgsql-sql
<font size="3">The correct way would be:<br /><br /> select position('el' in 'Hello');<br /><br /> Dorin<br /><br /> At
02:27PM 7/23/01 +0000, Karl Orbell wrote:<br /><blockquote cite="cite" type="cite">I'm having trouble using the
positionfunction, it's a simple built-in function.<br /><br /> It returns the index of a substring within a main
string.<br/><br /> But, I just can't get it to work, it always gives this silly parser error.<br /> I've tried it in a
varietyof ways with variables instead of constants casting <br /> to text and using it in other contexts, (ie. in
functions,not just in a <br /> select).  What am I doing wrong?  Is this not the correct syntax for a two <br />
argumentfunction?<br /><br /> test=# select position('hello','el');<br /> ERROR:  parser: parse error at or near ","<br
/><br/><br /> Karl Orbell.<br /><br /><br /> ---------------------------(end of
broadcast)---------------------------<br/> TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org</blockquote></font><br/> 

pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: What's wrong with this syntax?
Next
From: "Josh Berkus"
Date:
Subject: Re: RE: position(text,text) function