Re: pgsql code is not working.
От | David G. Johnston |
---|---|
Тема | Re: pgsql code is not working. |
Дата | |
Msg-id | CAKFQuwb4-+BR25ToJZUKUAt3RWjJfdVHk5m-U7aGS+4edc+F-w@mail.gmail.com обсуждение исходный текст |
Ответ на | pgsql code is not working. ("Singh, Gambhir" <gsingh2@kemper.com>) |
Ответы |
Re: pgsql code is not working.
|
Список | pgsql-admin |
SELECT MAX(pkey) into MAX_VAL FROM additional_details;
SELECT setval(additional_details_id_seq,MAX_VAL + 1);
Raise notice ‘Value pkey: %’,pkey;
Raise notice ‘Value max_val: %’,max_val;
END;
$$ LANGUAGE plpgsql;
ERROR: invalid input syntax for type integer: "additional_details_id"
CONTEXT: PL/pgSQL function inline_code_block line 14 at SQL statement
SQL state: 22P02
But when I change the data type of ‘MAX_VAL’ variable from INTEGER to VRACHAR then got this result.
NOTICE: Value pkey: additional_details_id
NOTICE: Value max_val: additional_details_id
Actually in max_val column, it should display the max value of column in numbers, instead it showing the same value which is stored in pkey variable.
В списке pgsql-admin по дате отправления: