Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6OE1Vf20130 for ; Tue, 24 Jul 2001 10:01:31 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f6ODrwD81627 for pgsql-sql@postgresql.org; Tue, 24 Jul 2001 09:53:58 -0400 (EDT) (envelope-from news) From: karl@tecc.co.uk (Karl Orbell) X-Newsgroups: comp.databases.postgresql.sql Subject: Re: position(text,text) function Date: Tue, 24 Jul 2001 13:53:57 +0000 (UTC) Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 26 Message-ID: References: X-Complaints-To: scrappy@hub.org User-Agent: slrn/0.9.7.1 (Linux) To: pgsql-sql@postgresql.org X-Archive-Number: 200107/324 X-Sequence-Number: 4137 Many thanks for all of the assistance on this question. I can't say I've ever seen the "a in b" syntax in postgres, but you live and learn. ;-) Thanks again. Karl. In article , 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. >