It looks okay when it leaves here.

I'll see if I can figure out what's changed in the encoding before I
simply resend this.  I'm seeing lots of "─" and the like instead of
box characters, and I presume you are, too.

The essence of the problem is that having a JDB file with all varchars
seems to fail on inserting some data.  Adding a first integer column fixes
that specific problem.

Bill

On Wed, January 20, 2010 1:10 pm, Bill Harris wrote:
> Okay; maybe the typo, if it exists, _wasn't_ obvious in the first version.
>  Let me try again -- the same email but hopefully with a better encoding
> (I have _no_ idea what's different between how I created the two
> versions).
>
> 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'
> &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
> &#9474;zeroth&#9474;first&#9474;second&#9474;third&#9474;
> &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
> &#9474;1     &#9474;a    &#9474;b     &#9474;c    &#9474;
> &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
>
>    Insert__testd 'id2';<1;'a1';'b1';'c1'
>
>    Reads__testd 'from id2'
> &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
> &#9474;zeroth&#9474;first&#9474;second&#9474;third&#9474;
> &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
> &#9474;1     &#9474;a    &#9474;b     &#9474;c    &#9474;
> &#9474;1     &#9474;a1   &#9474;b1    &#9474;c1   &#9474;
> &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
>
>    Insert__testd 'id2';<1;'abc';'def';'ghi'
>
>    Reads__testd 'from id2'
> &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
> &#9474;zeroth&#9474;first&#9474;second&#9474;third&#9474;
> &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
> &#9474;1     &#9474;a    &#9474;b     &#9474;c    &#9474;
> &#9474;1     &#9474;a1   &#9474;b1    &#9474;c1   &#9474;
> &#9474;1     &#9474;abc  &#9474;def   &#9474;ghi  &#9474;
> &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
>
> ========================================================================
>
> 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'
> &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
> &#9474;table&#9474;column&#9474;type
> &#9474;unique&#9474;parent&#9474;parentkey&#9474;
> &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
> &#9474;id1  &#9474;first &#9474;varchar&#9474;0     &#9474;      &#9474;
>       &#9474;
> &#9474;id1  &#9474;second&#9474;varchar&#9474;0     &#9474;      &#9474;
>       &#9474;
> &#9474;id1  &#9474;third &#9474;varchar&#9474;0     &#9474;      &#9474;
>       &#9474;
> &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
>
>    Insert__testd 'id1';<'a';'b';'c'
>
>    Reads__testd 'from id1'
> &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
> &#9474;first&#9474;second&#9474;third&#9474;
> &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
> &#9474;a    &#9474;b     &#9474;c    &#9474;
> &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
>
>    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.
>
> Ideas?
>
> Bill
>
> On Wed, January 20, 2010 1:00 pm, Bill Harris wrote:
>> 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'
>> &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
>> &#9474;table&#9474;column&#9474;type
>> &#9474;unique&#9474;parent&#9474;parentkey&#9474;
>> &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
>> &#9474;id2  &#9474;zeroth&#9474;int    &#9474;0     &#9474;      &#9474;
>>       &#9474;
>> &#9474;id2  &#9474;first &#9474;varchar&#9474;0     &#9474;      &#9474;
>>       &#9474;
>> &#9474;id2  &#9474;second&#9474;varchar&#9474;0     &#9474;      &#9474;
>>       &#9474;
>> &#9474;id2  &#9474;third &#9474;varchar&#9474;0     &#9474;      &#9474;
>>       &#9474;
>> &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
>>
>>    Insert__testd 'id2';<1;'a';'b';'c'
>>
>>    Reads__testd 'from id2'
>> &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
>> &#9474;zeroth&#9474;first&#9474;second&#9474;third&#9474;
>> &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
>> &#9474;1     &#9474;a    &#9474;b     &#9474;c    &#9474;
>> &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
>>
>>    Insert__testd 'id2';<1;'a1';'b1';'c1'
>>
>>    Reads__testd 'from id2'
>> &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
>> &#9474;zeroth&#9474;first&#9474;second&#9474;third&#9474;
>> &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
>> &#9474;1     &#9474;a    &#9474;b     &#9474;c    &#9474;
>> &#9474;1     &#9474;a1   &#9474;b1    &#9474;c1   &#9474;
>> &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
>>
>>    Insert__testd 'id2';<1;'abc';'def';'ghi'
>>
>>    Reads__testd 'from id2'
>> &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
>> &#9474;zeroth&#9474;first&#9474;second&#9474;third&#9474;
>> &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
>> &#9474;1     &#9474;a    &#9474;b     &#9474;c    &#9474;
>> &#9474;1     &#9474;a1   &#9474;b1    &#9474;c1   &#9474;
>> &#9474;1     &#9474;abc  &#9474;def   &#9474;ghi  &#9474;
>> &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
>>
>> ========================================================================
>>
>> 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'
>> &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
>> &#9474;table&#9474;column&#9474;type
>> &#9474;unique&#9474;parent&#9474;parentkey&#9474;
>> &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
>> &#9474;id1  &#9474;first &#9474;varchar&#9474;0     &#9474;      &#9474;
>>       &#9474;
>> &#9474;id1  &#9474;second&#9474;varchar&#9474;0     &#9474;      &#9474;
>>       &#9474;
>> &#9474;id1  &#9474;third &#9474;varchar&#9474;0     &#9474;      &#9474;
>>       &#9474;
>> &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
>>
>>    Insert__testd 'id1';<'a';'b';'c'
>>
>>    Reads__testd 'from id1'
>> &#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9516;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
>> &#9474;first&#9474;second&#9474;third&#9474;
>> &#9500;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9532;&#9472;&#9472;&#9472;&#9472;&#9472;&#9508;
>> &#9474;a    &#9474;b     &#9474;c    &#9474;
>> &#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9524;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
>>
>>    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
>>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to