Sorry, meant

NB. Instead of Insert__hd 'middletable';< (<0 0;100 200),1 1;0 0

to comment the altered insertion.

On Tue, Sep 22, 2009 at 11:52 PM, Devon McCormick <[email protected]>wrote:

> Not sure I really understand this, but if "midkey" has unique values, e.g.
>
>    Insert__hd 'middletable';< (<0 0;100 200),0 1;0 0  NB. Instead of
> Insert__hd 'middletable';< (<0 0;100 200),0 0;0 0
>
> You get
>
> +-------+---+
> |lowkey2|200|
> +-------+---+
>
> from the read statement.
>
>
> On Tue, Sep 22, 2009 at 4:38 PM, Tirrell, Jordan (Consultant) <
> [email protected]> wrote:
>
>> In JDB, when adding data to a table referencing a table which is
>> referencing a third table I run into a problem where the data doesn't
>> match what I put in. Try the following example:
>>
>>
>>
>> load 'data/jdb'
>>
>> hf=: Open_jdb_ dirpath     NB. dirpath is directory to save database
>>
>> hd=: Create__hf 'sample'
>>
>>
>>
>> Create__hd 'lowertable';'lowkey1 int, lowkey2 int; low int'
>>
>> Insert__hd 'lowertable';< 0 0;100 200;0 0
>>
>>
>>
>> Create__hd 'middletable';'lowid lowertable,midkey int;mid int'
>>
>> Insert__hd 'middletable';< (<0 0;100 200),1 1;0 0
>>
>>
>>
>> Create__hd 'uppertable';'midid middletable,upkey int;up int'
>>
>> Insert__hd 'uppertable';< (<(<0;200),<1),0;0
>>
>>
>>
>> Read__hd 'lowkey2 from uppertable'
>>
>>
>>
>> This gives me a value of 100 for lowkey2 from uppertable (it should be
>> 200). Does anyone see a mistake or have any ideas where a bug could be?
>>
>>
>>
>> Thanks,
>>
>> Jordan
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
>
>
> --
> Devon McCormick, CFA
> ^me^ at acm.
> org is my
> preferred e-mail
>
>


-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to