convert access sql to postgresql

Поиск
Список
Период
Сортировка
От Tom Hart
Тема convert access sql to postgresql
Дата
Msg-id 473E056A.7020806@coopfed.org
обсуждение исходный текст
Ответы Re: convert access sql to postgresql
Re: convert access sql to postgresql
Список pgsql-general
Hey guys. I have a long piece of sql that I'm trying to take out of an
existing Access db and modify to work with Postgresql. I've started
trying to convert it, but I've come across a problem that I don't even
know how to describe, let alone google. Here's the function

INSERT INTO MemberMailingAddress (
mb_cn_num,
mb_acct_num,
isactive,
ismember,
ismail,
ispromomail,
... <trimmed for your convenience> ...

)
SELECT
mb_cn_num,
mb_acct_num,
mb_stat_cd<>1 as isactive,
mb_stat_cd=0 as ismember,
isactive and (mb_mail_cd=0 or mb_mail_cd=1) as ismail,
ismail and (mb_stat_cd=0 or mb_stat_cd=2) as ispromomail,
... <trimmed for your convenience> ...

FROM member
ORDER BY mb_cn_num, mb_acct_num
;

Specifically I'm looking at these two lines

isactive and (mb_mail_cd=0 or mb_mail_cd=1) as ismail,
ismail and (mb_stat_cd=0 or mb_stat_cd=2) as ispromomail,

which appear to use other fields it's preparing to insert as variables
in the determination of the values of other fields (I told you I
couldn't figure out how to explain it).

Does anybody have any idea what I'm talking about? I sure don't.

Thomas R. Hart II
tomhart@coopfed.org

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: [pgtranslation-translators] Call for translations
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: view management