| От | Christoph Moench-Tegeder |
|---|---|
| Тема | Re: [GENERAL] Where is the error? |
| Дата | |
| Msg-id | 20170506182341.GA1545@elch.exwg.net обсуждение исходный текст |
| Ответ на | [GENERAL] Where is the error? (Igor Korot <ikorot01@gmail.com>) |
| Список | pgsql-general |
## Igor Korot (ikorot01@gmail.com): > std::string query1 = "DECLARE alltables CURSOR SELECT > table_schema, table_name FROM information_schema.tables WHERE > table_type = 'BASE TABLE' OR table_type = 'VIEW' OR table_type = > 'LOCAL TEMPORARY';"; > [quote] > RROR: syntax error at or near "SELECT" > LINE 1: DECLARE alltables CURSOR SELECT table_schema, table_name FRO... > What am I missing? A "FOR" in front of the "SELECT": https://www.postgresql.org/docs/current/static/sql-declare.html Note you can use cursors via psql, too - only they have to be in a transaction block (but postgres will tell you, once you got the syntax right). Regards, Christoph -- Spare Space
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера