AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change settings of a constraint in SQLite

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
swt-gis
968 Views, 4 Replies

Change settings of a constraint in SQLite

I am not able to change a constraint in SQLite:

1. I created a schema  in SQLite witth AutoCAD Map 3D 2012.
2. I set a constraint to one field: a list with 3 entries valid for the property. For example:
       Test 1
       Test 2
       Test 3
3.    I draw some lines

In the schema editor I want to change the constraint:
-    But I am not able to add a new entry “Test 4” to the list from step 2
-    I am also not able to change an existing entries (“test 1” to “test 1 new”)

Is it possible to change the settings of a constraint?

The help (http://docs.autodesk.com/MAP/2012/ENU/filesMUG/GUID-47B2AD48-11F7-45DA-9B11-979265C7FDA8.htm) says: “You cannot edit a schema to convert an existing field to use a different constraint type if the table already contains data. The table must be empty.”
But I do not want to change the “constraint type”. I want to change the entries of the list.

Thanks

Jens

4 REPLIES 4
Message 2 of 5
Alfred.NESWADBA
in reply to: swt-gis

Hi,

 

at least the help is right, and also: I do understand your situations (it get's sometimes frustrating having data finalized and then have to add or modify some fields).

What would I do:

  • First I would try to close Map3D or at least disconnect from the DB, modify some fields within the SQLite-database itself, then connect again to the DB.
  • If that does not help, by what reason ever, you can create a new scheme and then do a masscopy from your previous scheme to the new one.

 

Good luck, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 5
swt-gis
in reply to: Alfred.NESWADBA

Alfred,

thank you for your answer.

Autodesk has now replied to me directly. Autodesk has also proposed to do an export/import.

Your idea to modify the SQLite-database is good. But unfortunately this does not work:
I've looked at how a “constraint in AutoCAD FDO schema” is implemented in SQLite. SQLite uses a SQL-constraint when a table is created:
CREATE TABLE "testtable” … "testfield" TEXT CONSTRAINT CHK_Typ CHECK("testfield " IN(‘Test 1, Test 1, Test 1)) …

Normaly I would drop the existing constraint, and add the new constraint:
ALTER TABLE ... DROP CONSTRAINT CHK_Typ
ALTER TABLE ... ADD CONSTRAINT CHK_Typ ...

The problem is that SQLite does not support a CONSTRAINT option in the ALTER command (http://www.sqlite.org/omitted.html).

In my opinion this is very great limitation of a geodatabase based on SQLite.

Thanks for your help.

Regards

Jens

Message 4 of 5
NateMoore
in reply to: swt-gis

I agree with Alfred - the new schema (possibly from an export/import of just the schema), then a bulkcopy is likely the easiest route, considering the SQLite limitations.



Nate Moore, GISP
Geospatial Premium Support Specialist
Global Services
Autodesk, Sarl
Message 5 of 5
swt-gis
in reply to: NateMoore

Thanks to Alfred and Nate. I will use their workarounds proposed (import/export/bulkcopy).

Jens

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost