Converting int4 to varchar

Поиск
Список
Период
Сортировка
От Larry Bottorff
Тема Converting int4 to varchar
Дата
Msg-id Pine.BSI.4.02A.9901050836090.16300-100000@jasper.southwind.net
обсуждение исходный текст
Список pgsql-sql
I'm doing something very typical: I created a sequence "seq" and then
wanted to insert the NEXTVAL('seq') into a varchar field of a table to be
used as a primary key.

INSERT INTO products (prodno, ...) VALUES (NEXTVAL('seq'), 'blah',
'blah');

Where prodno is varchar. I tried a text(...) cast, but it complains of a
text-varchar mismatch. There is no varchar(...).

Apparently, this is not possible in Postgres(?).

Larry Bottorff                    SouthWind Internet Access, Inc.
System Programmer                 120 S. Market St. Suite 300
swprenzl@southwind.net            Wichita, KS 67202
---------------------------------------------------------------------
In Wichita:(316)263-7964              Elsewhere:1-877-525-7964


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

Предыдущее
От: "Jackson, DeJuan"
Дата:
Сообщение: RE: [SQL] Probs with int2 in functions
Следующее
От: jwieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [SQL] Triggers and sql functions not working...