On Thu, January 21, 2010 8:49 am, Tirrell, Jordan (Consultant) wrote:
> Yes, you should always insert varchar data in boxes.
Thanks, Jordan. It makes sense.
But I get
9!:7 '+++++++++|-'
require 'data/jdb'
testf=: Open_jdb_ jpath '~temp/jdbtest'
Drop__testf 'tests'
testd=: Create__testf 'tests'
testd=: Open__testf 'tests'
testt4 =: Create__testd 'id4'
InsertCols__testd 'id4'; 0 : 0
zeroth int
timeseries varchar
)
ShowCols__testd 'id4'
+-----+----------+-------+------+------+---------+
|table|column |type |unique|parent|parentkey|
+-----+----------+-------+------+------+---------+
|id4 |zeroth |int |0 | | |
|id4 |timeseries|varchar|0 | | |
+-----+----------+-------+------+------+---------+
Reads__testd 'from id4'
+------+----------+
|zeroth|timeseries|
+------+----------+
+------+----------+
'id4';<1; <<"1 L:0 (4j0 & ":) i. 3 5
+---+--------------------------------------------------------------------+
|id4|+-+----------------------------------------------------------------+|
| ||1|+--------------------+--------------------+--------------------+||
| || || 0 1 2 3 4| 5 6 7 8 9| 10 11 12 13 14|||
| || |+--------------------+--------------------+--------------------+||
| |+-+----------------------------------------------------------------+|
+---+--------------------------------------------------------------------+
Insert__testd 'id4';<1; <<"1 L:0 (4j0 & ":) i. 3 5
|assertion failure: validate
| 1=#~.(#@".)&>'active';Tcolmap
Reads__testd 'from id4'
+------+--------------------+
|zeroth|timeseries |
+------+--------------------+
|1 | 0 1 2 3 4|
+------+--------------------+
Insert__testd 'id4';<1; <<"1 L:0 (4j0 & ":) i. 3 5
|assertion failure: validate
| 1=#~.(#@".)&>'active';Tcolmap
Reads__testd 'from id4'
+------+--------------------+
|zeroth|timeseries |
+------+--------------------+
|1 | 0 1 2 3 4|
|1 | 5 6 7 8 9|
+------+--------------------+
Insert__testd 'id4';<1; <<"1 L:0 (4j0 & ":) i. 3 5
|assertion failure: validate
| 1=#~.(#@".)&>'active';Tcolmap
Reads__testd 'from id4'
+------+--------------------+
|zeroth|timeseries |
+------+--------------------+
|1 | 0 1 2 3 4|
|1 | 5 6 7 8 9|
|1 | 10 11 12 13 14|
+------+--------------------+
Insert__testd 'id4';<1; <<"1 L:0 (4j0 & ":) i. 3 5
|assertion failure: validate
| 1=#~.(#@".)&>'active';Tcolmap
Reads__testd 'from id4'
+------+--------------------+
|zeroth|timeseries |
+------+--------------------+
|1 | 0 1 2 3 4|
|1 | 5 6 7 8 9|
|1 | 10 11 12 13 14|
|1 | 0 1 2 3 4|
+------+--------------------+
I'm probably abusing JDB, but it seems odd to get the error _and_ see the
table updated, and it seems odd that I get a subsequent row added each
time I execute the Insert.
> Also, try inserting multiple rows at once.
>
> Insert__testd 'id1';< ('a';'a1');('b';'b1');<'c';'c1'
> This would not be possible to do with different length strings without
> the boxes, which is why they are used.
Thanks for the tip; that could be useful.
I've got another apparent anomaly; I'll post it later.
Bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm