Subscribe to this thread
Home - General / All posts - SQL to extract objects from drawing
anajera
126 post(s)
#08-Sep-16 20:46

Hello,

I have a drawing from which I want to extract objects that meet a certain criteria into a new drawing. I am looking at something like the SELECT INTO statement but applied to drawings instead of tables , someting like

SELECT * INTO [New Drawing] from [Drawing] WHERE [Column] ="Criteria"

Considering the Drawing has 2 columns Label and Class, I have also tried to first create the new drawing with

CREATE DRAWING New Drawing ([Label] VARCHAR),([Class] VARCHAR)

and then insert the data into the New Drawing table like this

INSERT INTO [New Drawing] SELECT [ID],[Label], [Class] FROM [Drawing] WHERE [Class] ="Criteria"

but does not work with an error message "Different number of columns SELECT".

Thanks in advance for your help


BiciMapas Mexico GPS Maps & GIS Data www.bicimapas.com.mx

anajera
126 post(s)
#09-Sep-16 02:06

Hi all

I found this post that had the answer I was looking for

http://www.georeference.org/forum/t132553.13

Thanks


BiciMapas Mexico GPS Maps & GIS Data www.bicimapas.com.mx

tjhb
10,094 post(s)
#09-Sep-16 06:56

Sorry you didn't get a decent answer in time. Well done anyway.

The principle is that INSERT INTO usually requires that you specify a list of target columns, matching the SELECT list in number and types.

Manifold 8 is forgiving. If the target columns and SELECT columns match, you can omit the target columns.

But that's not best. Normally match target columns to source.

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.