by jh | Jul 14, 2022 | Combat Robotics, OpenQM, Projects, WordPress
I am tinkering around with OpenQM. It’s the only NoSQL database that is worth the effort. I seriously hope that Rocket Software won’t screw it up, but I think we all know what happens when an affordable product is purchased by some other company. Then again, the sell of OpenQM from Ladybridge to Zumasys didn’t end the world. The QM projects are all little toys, so I will be highly unlikely to post anything about those until they turn into something more interesting.
Also working on the the bot(s). Currently Waiting On Parts from SendCutSend. I also have a backup plan… a Jolt! kit on the way… but Absolute Chaos is waiting on parts…
Next thing… working on WordPress. I have a nice setup right now that is very fast for anybody that isn’t logged in. I want to make it scale horizontally. Not because I need to, but because… why not?
by jh | Jul 6, 2022 | OpenQM
The problem: How do I join two tables in OpenQM?
Solution: L-Type Records
Let’s say we have a couple of tables files, SKUS and VENDORS
LIST DICT SKUS Page 1
@ID......... TYPE LOC........... CONV.. NAME........ FORMAT S/M ASSOC...
@ID D 0 SKUS 10L S
DESCR D 1 Description 24L S
VENDORS D 2 8R M
VDR L VENDORS VENDOR
S
4 record(s) listed
LIST DICT VENDORS Page 1
@ID......... TYPE LOC........... CONV.. NAME........ FORMAT S/M ASSOC...
@ID D 0 VENDORS 10L S
COMPANY D 1 32L S
ADDR D 2 Address 24L M
3 record(s) listed
According to the OpenQM documentation, the four fields of an L-Type record are:
1: L { descriptive text }
2: Id expression
3: File name
4 { File expression }
The key here, pun intended, is that we need to link an expression in one file to another. We aren’t limited to simple keys here… we can actually build complex expressions. The example in the documentation and given in the demo files extracts a key defined in the file as 3-7 while it links to the @ID of the target file, which is needs just the left half of the expression. Now, in my own example here, I’m using just a simple key to join the two files so that the VENDORS field in SKUS and the id field of the VENDORS file will match. When we LIST the SKUS file, we can list the vendor information as follows:
LIST SKUS DESCR VDR%COMPANY
SKUS...... Description............. Company.........................
5192 STAPLER, RED BOBCO LTD
VILE INDUSTRIES
2121 STAPLER, BLUE VILE INDUSTRIES
2 record(s) listed
And just like that, it works.
Now, I’m missing a piece of the puzzle here, because if you list both the company name and address in the skus listing, it has no association between the two values and ends up looking like this garbage:
list skus DESCR VDR%COMPANY VDR%ADDR
SKUS...... Description............. Company......................... Address.................
5192 STAPLER, RED BOBCO LTD JOBO MCDUGNUTS
VILE INDUSTRIES ACCOUNT EXECUTIVE
BOBCO LTD
1010 THREE TWO ONE ST
NOWHERESVILLE EX 00000
SNAKE SLITHERY
PRESIDENT
VILE INDUSTRIES
814 W CATAHULA AVE
TOXIC DUMP EX 00100
2121 STAPLER, BLUE VILE INDUSTRIES SNAKE SLITHERY
PRESIDENT
VILE INDUSTRIES
814 W CATAHULA AVE
TOXIC DUMP EX 00100
2 record(s) listed
Hrm…