pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rehan Saleem <pk_rehan@yahoo.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Invalid syntax for integer
Date: Tue, 13 Mar 2012 11:25:38 -0700 (PDT)
Message-ID: <1331663138.21401.YahooMailNeo@web121606.mail.ne1.yahoo.com> (raw)

hi ,

what is wrong with this if statement in this function
if distance ='' THEN
    distance := 1;
    end if;
here distance variable is of type integer , this function has been created successfully but when i execute this function it gives me this error ,

ERROR:  invalid input syntax for integer: ""
LINE 1: SELECT distance =''
                                ^
QUERY:  SELECT distance =''
CONTEXT:  PL/pgSQL function "getsitesbytfid" line 6 at IF

********** Error **********

ERROR: invalid input syntax for integer: ""
SQL state: 22P02
Context: PL/pgSQL function "getsitesbytfid" line 6 at IF

view thread (2+ messages)  latest in thread

Message-ID: <1331663138.21401.YahooMailNeo@web121606.mail.ne1.yahoo.com>
Permalink:  ../1331663138.21401.YahooMailNeo@web121606.mail.ne1.yahoo.com/
Also on:    postgresql.org/message-id/1331663138.21401.YahooMailNeo@web121606.mail.ne1.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pk_rehan@yahoo.com
  Subject: Re: Invalid syntax for integer
  In-Reply-To: <1331663138.21401.YahooMailNeo@web121606.mail.ne1.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox