I don't yet understand JDB.
Here is a transcript of something that works:
========================================================================
require 'data/jdb'
testf=: Open_jdb_ jpath '~temp/jdbtest'
Drop__testf 'tests'
testd=: Create__testf 'tests'
testd=: Open__testf 'tests'
testt2=: Create__testd 'id2'
InsertCols__testd 'id2'; 0 : 0
zeroth int
first varchar
second varchar
third varchar
)
ShowCols__testd 'id2'
┌─────┬──────┬───────┬──────┬──────┬─────────┐
│table│column│type
│unique│parent│parentkey│
├─────┼──────┼───────┼──────┼──────┼─────────┤
│id2 │zeroth│int │0 │ │
│
│id2 │first │varchar│0 │ │
│
│id2 │second│varchar│0 │ │
│
│id2 │third │varchar│0 │ │
│
└─────┴──────┴───────┴──────┴──────┴─────────┘
Insert__testd 'id2';<1;'a';'b';'c'
Reads__testd 'from id2'
┌──────┬─────┬──────┬─────┐
│zeroth│first│second│third│
├──────┼─────┼──────┼─────┤
│1 │a │b │c │
└──────┴─────┴──────┴─────┘
Insert__testd 'id2';<1;'a1';'b1';'c1'
Reads__testd 'from id2'
┌──────┬─────┬──────┬─────┐
│zeroth│first│second│third│
├──────┼─────┼──────┼─────┤
│1 │a │b │c │
│1 │a1 │b1 │c1 │
└──────┴─────┴──────┴─────┘
Insert__testd 'id2';<1;'abc';'def';'ghi'
Reads__testd 'from id2'
┌──────┬─────┬──────┬─────┐
│zeroth│first│second│third│
├──────┼─────┼──────┼─────┤
│1 │a │b │c │
│1 │a1 │b1 │c1 │
│1 │abc │def │ghi │
└──────┴─────┴──────┴─────┘
========================================================================
Here is a transcript of something that fails. As you can see, all I
(think I) did was to drop the zeroth column:
========================================================================
require 'data/jdb'
testf=: Open_jdb_ jpath '~temp/jdbtest'
Drop__testf 'tests'
testd=: Create__testf 'tests'
testd=: Open__testf 'tests'
testt1=: Create__testd 'id1'
InsertCols__testd 'id1'; 0 : 0
first varchar
second varchar
third varchar
)
ShowCols__testd 'id1'
┌─────┬──────┬───────┬──────┬──────┬─────────┐
│table│column│type
│unique│parent│parentkey│
├─────┼──────┼───────┼──────┼──────┼─────────┤
│id1 │first │varchar│0 │ │
│
│id1 │second│varchar│0 │ │
│
│id1 │third │varchar│0 │ │
│
└─────┴──────┴───────┴──────┴──────┴─────────┘
Insert__testd 'id1';<'a';'b';'c'
Reads__testd 'from id1'
┌─────┬──────┬─────┐
│first│second│third│
├─────┼──────┼─────┤
│a │b │c │
└─────┴──────┴─────┘
Insert__testd 'id1';<'a1';'b1';'c1'
|assertion failure: validate
| 1=#~.(#@".)&>'active';Tcolmap
Reads__testd 'from id1'
|index error: readbase1
| (rws{".)&.>cls
========================================================================
Someone will probably point out an obvious typo, but I can't see a
difference between the two _except_ that the failing one has no
integer in column 1, and I can't find anything that says you need a
leading integer field.
I'm running
9!:14''
j602/2008-03-03/16:45
with libraries updated a few hours ago, and I start each test in a new
.ijx session.
Ideas?
Bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm