Good morning from Blighty.

I'm fairly well up on SQL but not necessarily the (cut-down) flavour of
MB's.  Does it work if you include all the fields of Table1, + 2 dummy
expressions, that match the data type of the 2 extra target fields in
Table2, i.e. ensure that your 2 tables match - field for field?  I think
this could be the problem. E.g.

....Select field1, field2, ..., SPACE$(20), 0.0 from Table1....

(This assumes that the 2 extra fields of Table 2 are of type char(20)
and float).  I may get shot down by more experienced users.

HTH

Terry McDonnell

-----Original Message-----
From: James Torrie [mailto:[EMAIL PROTECTED] 
Sent: 14 July 2004 04:23
To: [EMAIL PROTECTED]
Subject: MI-L Appending Rows to Unmatched columns

Afternoon MI Listers,

Hope someone with MapBasic experience can help here.
I wish to append a selection from Table1 into Table2. Both tables are
identical in structure except that Table2 has two additional columns at
the end.

If I choose the Table->Append rows to table... command, from within
MI7.0 it all works fine. The last two columns in Table2 are left empty

So why does it give me grief when I write the following MapBasic code...

Dim s_command as string
.
.
.
s_command = "insert into "+Table2+" select * from Table1"
Run Command s_command

Error! "Number of columns in selection must be equal to number of
columns being inserted" 

Can someone give me a MapBasic workaround?

James Torrie
Rangitikei District Council

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 12598





---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 12600

Reply via email to