[GRASS-user] Change SQLite DB Column Width?

Jeshua Lacock jeshua at 3DTOPO.com
Thu Aug 3 16:19:56 PDT 2017


Greetings,

I am attempting to patch vectors together with v.patch -e (I need the attributes). But I am getting this error:

ERROR: Length of string columns differ

Upon inspecting the columns, I see that at least one vector has a NAME column with a width of 120 characters, while most of them have a width of 80:


> db.describe  table=TrailSegment_12

column:NAME
description:
type:CHARACTER
len:120
scale:0
precision:0
default:
nullok:yes
select:?
update:?

Is it possible to change the width of the columns? The DB is SQLite.

I tried altering the width using db.execute and this SQL:

ALTER TABLE TrailSegment_12
ALTER COLUMN NAME CHARACTER(128)

But I get the errors:

DBMI-SQLite driver error:
Error in sqlite3_prepare():
near "TrailSegment_Michigan": syntax error

DBMI-SQLite driver error:
Error in sqlite3_prepare():
near "TrailSegment_Michigan": syntax error

ERROR: Error while executing: 'ALTER TABLE TrailSegment_12'

Seems like there must be a way. I found SQLite has a .width command, but I am not sure how to use it.


Thanks,

Jeshua Lacock
Founder/Engineer
<3DTOPO.com>
GlassPrinted.com



More information about the grass-user mailing list