<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body smarttemplateinserted="true" text="#000000" bgcolor="#FFFFFF">
Thanks, db.join table=test1 column=A other_table=test2
other_column=A now works. When trying to link the two tables on
column B and C, it doesn't, which is because both tables have a
column A.<br>
<br>
<pre>GRASS 7.1.svn (AEA):~ > db.join table=test1 column=B other_table=test2 other_column=C
WARNING: SQLite driver: unable to parse decltype: REAL(20)
WARNING: SQLite driver: unable to parse decltype: REAL(20)
WARNING: SQLite driver: column 'C', SQLite type 2 is not supported
WARNING: SQLite driver: unable to parse decltype: REAL(20)
WARNING: SQLite driver: unable to parse decltype: REAL(20)
WARNING: SQLite driver: column 'C', SQLite type 2 is not supported
DBMI-SQLite driver error:
Error in sqlite3_prepare():
duplicate column name: A</pre>
<pre>DBMI-SQLite driver error:
Error in sqlite3_prepare():
duplicate column name: A</pre>
<pre>ERROR: Error while executing: 'ALTER TABLE test1 ADD COLUMN A INTEGER(20)'
ERROR: Unable to add column <A>.</pre>
The warnings were not shown when linking via columns A, so I assume
they are not a problem? As for the problem with the duplicate column
name, would it be possible to add the option to define a prefix
which is added to the column of the second table if a column with
the same name exists in the first table (with a default prefix if
none is given by the user)?<br>
<br>
<br>
<div class="moz-cite-prefix">On 09-03-16 17:30, Markus Neteler
wrote:<br>
</div>
<blockquote
cite="mid:CALFmHhtsW23jp0P-g3fhSSoiVLi83AJBNVOdDoqHPUrQhwfJYw@mail.gmail.com"
type="cite">
<p dir="ltr"><br>
On Mar 9, 2016 5:25 PM, "Paulo van Breugel" <<a
moz-do-not-send="true" href="mailto:p.vanbreugel@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:p.vanbreugel@gmail.com">p.vanbreugel@gmail.com</a></a>>
wrote:<br>
><br>
> Hoi Markus<br>
><br>
> Still not there via g.extension, but I copied the script to
the script folder. <br>
><br>
> I tried with two tables (both created in an external sqlite
editor), <br>
><br>
> Table 1: columns A (integer, key) and B (float)<br>
> Table 2: columns A (integer, key) and C (float)<br>
><br>
> First observation: using the GUI, the drop down menu for
the identifier column shows the column names of Table 1 instead
of Table 2.</p>
<p dir="ltr">Mhh, perhaps I mixed something up there.</p>
<p dir="ltr">> I tried to link the two on the first columns and
on the second columns. In both cases I got an error message,
copied below:<br>
><br>
> db.join table=test1 column=A other_table=test2
other_column=A <br>
><br>
> Traceback (most recent call last):<br>
><br>
> File "/home/paulo/.grass7/addons/scripts/db.join", line
170, in <module> sys.exit(main())<br>
><br>
> File "/home/paulo/.grass7/addons/scripts/db.join", line
152, in main columns=colspec)<br>
><br>
> File
"/usr/local/grass7/grass-7.1.svn/etc/python/grass/script/core.py",
line 408, in run_command ps = start_command(*args, **kwargs)<br>
><br>
> File
"/usr/local/grass7/grass-7.1.svn/etc/python/grass/script/core.py",
line 377, in start_command return Popen(args, **popts)<br>
><br>
> File
"/usr/local/grass7/grass-7.1.svn/etc/python/grass/script/core.py",
line 74, in __init__ subprocess.Popen.__init__(self, args,
**kwargs)<br>
><br>
> File "/usr/lib/python2.7/subprocess.py", line 710, in
__init__ errread, errwrite)<br>
><br>
> File "/usr/lib/python2.7/subprocess.py", line 1327, in
_execute_child raise child_exception<br>
><br>
> OSError: [Errno 2] No such file or directory</p>
<p dir="ltr">That one I fixed 30min ago or so in Svn.</p>
</blockquote>
<br>
Works now<br>
<br>
<blockquote
cite="mid:CALFmHhtsW23jp0P-g3fhSSoiVLi83AJBNVOdDoqHPUrQhwfJYw@mail.gmail.com"
type="cite">
<p dir="ltr">Please check again.</p>
<p dir="ltr">Markus </p>
<p dir="ltr">> Paulo<br>
><br>
><br>
><br>
> On 09-03-16 14:02, Markus Neteler wrote:<br>
>><br>
>><br>
>> On Mar 9, 2016 1:36 PM, "Paulo van Breugel" <<a
moz-do-not-send="true" href="mailto:p.vanbreugel@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:p.vanbreugel@gmail.com">p.vanbreugel@gmail.com</a></a>>
wrote:<br>
>><br>
>> ...<br>
>> > It is in svn I saw, but it doesn't show up in
g.extension.. perhaps because I am on 7.1?<br>
>><br>
>> This does not matter. I didn't yet add it to the parent
Make file because it is not ready.<br>
>><br>
>> Just take it from trac/svn from now...<br>
>><br>
>> Markus<br>
><br>
><br>
</p>
</blockquote>
<br>
</body>
</html>