1

I have been programming with PICK for a few months now, and am still adjusting to thinking of programming solutions that solely use multi-value arrays. PICK doesn't natively offer any other data structures for either database or in-memory operations * (ignoring dimensioned arrays for the sake of argument since they are still a type of "array")

What are some creative ways of imitating other data structures? I can imagine ways of implementing a hash/dictionary, or a linked list, using arrays and routines to manipulate them. A concern here is that it gets complicated very quickly since the interface for the data structure can't be conceptually simplified as an object.

Are there any easy to implement algorithms that people have used to create unique data structures?


My System: I am writing routines in PICK for add-ons to Epicor's Eclipse, which sits atop UniVerse. I know there is a C# interface to UniVerse, but they are not usable to most of my work.

Jon
  • 1,820
  • 2
  • 19
  • 43
  • I've been working with the Pick/MultiValue platform for over 30 years and I don't understand what you're asking. Can you rephrase the question into something that can be answered definitively? Also, please clarify your assertion that "PICK doesn't natively offer any other data structures for either database or in-memory operations". And why isn't the C# interface "usable"? I understand you're new to the platform. We can work with that. But since StackOverflow is for specific questions I recommend a forum for more general information: https://groups.google.com/forum/#!forum/mvdbms – TonyG May 11 '15 at 16:53
  • @TonyG, you're right that this is overly broad. I think I wasn't clear myself what I was asking. I will consider re-asking a more specific question. – Jon May 14 '15 at 18:02

2 Answers2

1

The Pick/MultiValue DBMS allows multiple values to be stored in a single field.

A common example would be to have a single attribute for a street address, with Street1, Street2, and perhaps Street3 as values. The structure would look like this: 01 Company Name 02 Street1]Street2]Street3 03 City 04 State...

Those are fields of the same type but they don't relate to anything else. Another similar structure would be to have multiple attributes where the values are correlated. There is typically one controlling attribute and any number of dependent attributes (atb 26 is used as a random example):

26 ShipDate]ShipDate]ShipDate
27 ShipQty]ShipQty]ShipQty
28 ShipVia]ShipVia]ShipVia

The application program manages the RI, not the database, though triggers can be used to allow the database to enforce the RI.

A RDBMS developer might prefer not to use that structure, so we can use traditional foreign keys for related data. In this case we might see a single attribute with keys to records in a Shipping file:

26 1234*01]1234*02]1234*03

So each of those values is a key to another file. The *00 value is an application-maintained sequential numeric ID for each delivery. They might be used here in case one of the deliveries is later marked as unconfirmed, so the value could be deleted, leaving this:

26 1234*02]1234*03

The common MVDBMS platforms allow one more level for SubValues. These are used with reservation but they can be quite valuable. Consider the above shipping data in a single attribute:

26 ShipDate\ShipQty\ShipVia ] ShipDate\ShipQty\ShipVia

The ShipVia from the second shipment would be referenced in code as Item<26,2,3>.

Some developers prefer to use non-system delimiters. Anything is valid as long as it won't be found in the data. You'll usually see asterisk, slash, pipe, comma, or some other alphanumeric:

26 ShipDate|ShipQty|ShipVia ] ShipDate|ShipQty|ShipVia

The code to get the second ShipVia might be:

Field(  Item<26,2> , "|" , 3  )

That ShipVia field might itself be a foreign key to table file which just has the ID for the key and the ShipperName in atb1. So we're talking about the same data structure being used for two kinds of file: transactional data, and mostly static tables. It's no different than a relational database.

Yes, you can create linked lists, where for example a Company record has a single attribute for Departments. That translates to a Departments file where there's an attribute for Managers. That translates to an Employees file where an attribute is allocated for Team members. Each of those IDs would also translate to Employees, where some of those Employees might also be managers with their own teams. This structure is used for Bill Of Materials, for Multi-Level Marketing companies where individuals have a down-line, or for Insurance where risk is broken up to multiple companies who each then further break up the risk.

So there is a lot of versatility to the structures. Anything you can do with a RDBMS or a Key/Value structure can be done with MV.

How closely does that answer match your question? And what other kind of example would you like to see?

With regard to Objects, the QM MVDBMS does have OO BASIC, and the Caché DBMS includes an MVDBMS implementation where MV data can be exposed as objects. Also, with mv.NET and other tools, we can generate strongly typed classes from dictionary definitions (schema) which allows for the exact same kind of ORM as for any relational platform.

TonyG
  • 1,432
  • 12
  • 31
  • I think this answers my question, especially given it's broad nature. Thanks for your thoroughness. – Jon May 14 '15 at 18:03
1

I would need to know more about what you are trying to do but there are other data types.

If you want to use other languages with other data structures look at U2 Common Clients.

Yet, if you are looking at doing Server side development in UniVerse go to the Rocket Software website, and get the "Rocket UniVerse Basic Extensions" manual: Chapter 10: U2 Dyanmic Object Chapter 8: Data transfer between XML documents and UniVerse files.

You may also want to look at the "Rocket UniVerse GCI Guide" "The General Calling Interface (GCI) acts as a gateway from UniVerse BASIC to an external subroutine. The GCI passes data to and from subroutines through arguments and arrays."

http://docs.rocketsoftware.com/nxt/gateway.dll?f=templates$fn=default.htm

Lastly, while it is still in Beta, something that may be of interest to you is using Python for your MultiValue development along with the BASIC. I presented this at a CMUG (Colorado MultiValue User Group) meeting back in Oct.

https://vimeo.com/109520035

Mike Rajkowski

Rocket Software

Mike
  • 194
  • 11
  • Glad to hear about a python interface. I am not able to use anything other than PICK/BASIC at this time, but would gladly try it given the opportunity. – Jon May 14 '15 at 18:04
  • Mike, elsewhere in StackOverflow a response like that would generally get ripped by passers-by as being unrelated to the question. I won't tarnish your SO rating with a downvote. But as a helpful FYI, if others do that, your rating here can plummet, and that's not good for a long-term presence here. HTH – TonyG May 14 '15 at 22:48