Hi, I'm just starting to learn J and JDB.
I'm starting with the most trivial cases since they are best suited to
my trivial IQ.
I built a table with only 1 column defined as datatype char.
I was successful in inserting a single character with each insert statement.
However, when I tried inserting 2 characters, an 'assertion failure'
was returned.
Also, the table could no longer be read after the 'assertion failure' error.
Thanks for any assistance.
I apologize in advance for moronic mistakes I probably committed.
Here's the code:
load 'data/jdb'
fldr =: Open_jdb_ jpath , '~temp'
db =: Create__fldr 'testdb'
ht=: Create__db 'tblChar';0 : 0
c1 char
)
NB. Insert a single character
Insert__db 'tblChar';'a'
Insert__db 'tblChar';'b'
Insert__db 'tblChar';'c'
Insert__db 'tblChar';'d'
Reads__db 'from tblChar'
+--+
|c1|
+--+
|a |
|b |
|c |
|d |
+--+
NB. try to insert a list of 2 characters
Insert__db 'tblChar';'xy'
|assertion failure: validate
| 1=#~.(#@".)&>'active';Tcolmap
NB. try to read what, if anything, got inserted
Reads__db 'from tblChar'
|index error: readbase1
| (rws{".)&.>cls
NB. After the insert error the table can't be read by the same
statement that read it previously
Thanks again.
--chris--
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm