The following SQL is a simple join of two tables used to create a view
with an integer depth value & explicit centroid assigned to each cell.
(Cells are box datatype)
This works fine.
SELECT chat_cells.cell_id,
chat_cells.cell,
(@@ chat_cells.cell) AS centre,
int4(id_depth.depth) AS depth,
chat_cells.substrate
FROM chat_cells,
id_depth
WHERE (chat_cells.cell_id = id_depth.depth_id);
What I want to do now is save the data as a table, using select into.
The modified query (as I read the docs) should be:
SELECT chat_cells.cell_id,
chat_cells.cell,
(@@ chat_cells.cell) AS centre,
int4(id_depth.depth) AS depth,
chat_cells.substrate
INTO table1
FROM chat_cells,
id_depth
WHERE (chat_cells.cell_id = id_depth.depth_id);
When I run this, I get the error message:
PostgreSQL Error Message:
ERROR: DECLARE CURSOR must not specify INTO
Can anyone tell me what I'm doing wrong & how to select the data into a
new table?
Thanks,
Brent Wood