Received: from hotmail.com (f216.law14.hotmail.com [64.4.21.216]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6NI9Ff96571 for ; Mon, 23 Jul 2001 14:09:15 -0400 (EDT) (envelope-from oomoomi@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 23 Jul 2001 11:09:13 -0700 Received: from 213.29.16.6 by lw14fd.law14.hotmail.msn.com with HTTP; Mon, 23 Jul 2001 18:09:13 GMT X-Originating-IP: [213.29.16.6] From: "omid omoomi" To: karl@tecc.co.uk, pgsql-sql@postgresql.org Subject: Re: position(text,text) function Date: Mon, 23 Jul 2001 18:09:13 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 23 Jul 2001 18:09:13.0888 (UTC) FILETIME=[946CEA00:01C113A2] X-Archive-Number: 200107/316 X-Sequence-Number: 4127 position ( 'el' in 'hello') ; >From: karl@tecc.co.uk (Karl Orbell) >To: pgsql-sql@postgresql.org >Subject: [SQL] position(text,text) function >Date: Mon, 23 Jul 2001 14:27:15 +0000 (UTC) > >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@postgresql.org _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp