<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [postgis-users] convert integer to varchar</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Bui Anh Tin shaped the aether and said:<BR>
<BR>
><BR>
>  SELECT ( '../admin.aspx?com=addmap&type=edit&id=' ,mapid) as edit form<BR>
> mytable<BR>
><BR>
> mapid is interger<BR>
> but it error<BR>
><BR>
<BR>
It helps if you include the version of PostGreSQL that you are running (select version() at a psql prompt will tell you); I suspect that this is 8.3.x because it has gotten rid of some implicit casts, especially where numbers are concerned.<BR>
<BR>
You might try:<BR>
<BR>
 SELECT ( '../admin.aspx?com=addmap&type=edit&id=' || mapid::text)<BR>
<BR>
This is untested as the SQL you provide is not the SQL you ran -- "as edit form" is probably "AS edit FROM" -- not the transposed letters in the last word. It helps if you can actually quote exactly what you did since an accidentally introduced typo can break an SQL statement.<BR>
<BR>
I am guessing you want to append the mapid value to a string -- "||" is one concatenation operator.<BR>
<BR>
HTH,<BR>
<BR>
Greg Williamson<BR>
Senior DBA<BR>
DigitalGlobe<BR>
<BR>
Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information and must be protected in accordance with those provisions. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.<BR>
<BR>
(My corporate masters made me say this.)<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>