NOVICE - first time trigger and function

Поиск
Список
Период
Сортировка
От sam@edup.tudelft.nl (Sam)
Тема NOVICE - first time trigger and function
Дата
Msg-id ff8cfc7.0311060315.1aa1746d@posting.google.com
обсуждение исходный текст
Список pgsql-novice
Dear All,

I'm having trouble creating a function (it's my first time). First
I'll explain what I want to achieve:

I have two tables,I want to add a column to a table2 when a row is
inserted in table1. So i thought i could create a trigger and a
function: But I can't even get the function to do what I want. I tried
the following:

CREATE FUNCTION add_column (name) RETURNS BOOLEAN '
      ALTER TABLE table2 ADD COLUMN $1 integer
   ' LANGUAGE SQL;

I get the following error:

parser: parse error at or near "$1"

Anybody an idea?

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

Предыдущее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: [PERFORM] error while executing a c program with embedded sql
Следующее
От: "Farid Khan"
Дата:
Сообщение: Primary Keys