Re: VARCHAR to INTEGER conversion

Поиск
Список
Период
Сортировка
От Jeff Eckermann
Тема Re: VARCHAR to INTEGER conversion
Дата
Msg-id 20020117150951.61361.qmail@web20807.mail.yahoo.com
обсуждение исходный текст
Ответ на VARCHAR to INTEGER conversion  (Darren Ferguson <darren@crystalballinc.com>)
Список pgsql-general
PostgreSQL allows for function overloading, i.e. you
can create another function with the same name (and
same logic) that takes a VARCHAR parameter.
PostgreSQL will figure out which function you want,
based on the datatype of the parameter that you pass
to it.

IIRC, if you use pl/pgsql for your function, any type
casting required internally in the function (to get to
your return type) will be handled automagically.

--- Darren Ferguson <darren@crystalballinc.com> wrote:
> Hello list
>
> I have a stored procedure that takes in an integer
>
> sp_customer_service_property_descr(INTEGER)
>
> However i have a database field that is a VARCHAR
> because it can take
> either a number that would have to go into this
> stored procedure or it can
> just have normal text depending on the value of
> another field.
>
> I tried casting the VARCHAR as an INTEGER postgres
> (V7.2b4) doesn't let me
> do this. Now i understand why it is not letting me
> do this however here is
> my question
>
> Does anyone know of a work around so that i can call
> this function with
> the varchar database field.
>
> Thanks in advance
>
> Darren Ferguson
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please
> send an appropriate
> subscribe-nomail command to majordomo@postgresql.org
> so that your
> message can get through to the mailing list cleanly


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

В списке pgsql-general по дате отправления:

Предыдущее
От: Nicholas Piper
Дата:
Сообщение: pattern-match selectivity code and lower(thing) LIKE
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump behaviour changed in 7.1.3?