Data Store Not Loading Table

Product :4D - 4D Server
OS : Mac OS X

After converting from v17 R6 to v18 some tables are not being loaded into the data store. In the debugger, ds.tablename shows as undefined.

To be available with ds, tables must have a primary key.

Hi,

Also, the table must not have a composite primary key.

Thanks. When I open the primary key manager, it does not look like the one shown in the manual. Any ideas why? There are no drop downs.

Can you provide a screen copy ? This will help to understand…

This is what I see…

[]33513272;“test”[/]

Problem solved. The primary key can be set by right clicking on the field in the table you want to be the primary key.

: Marie-Sophie LANDRIEU

Also, the table must not have a composite primary key.

Hi Marie-Sophie,

???

What do you mean ? Composite primary keys are no longer authorized in v18 ?

: Eric TROTTA
: Marie-Sophie LANDRIEU

Also, the table must not have a composite primary key.
What do you mean ? Composite primary keys are no longer authorized in
v18 ?

Tables without a primary key or with a https://doc.4d.com/4Dv17/4D/17.3/Overview.200-4640016.en.htmlcomposite> primary key are not exposed in the datastore.

Hello,

That’s in the doc :

https://doc.4d.com/4Dv18/4D/18/Datastores.300-4575757.en.html

Regards,

: Eric TROTTA

What do you mean ? Composite primary keys are no longer authorized in
v18 ?
I seem to remember I heard that a composite PK is not suitable for 4D-orda, it must be somewhere in the doc. Anyway, I can’t use such a table in ORDA, it’s even not recognised, compare colors of Table_1 and Table_2:
[]33537141;“Your comment here…”[/]
The second query fails with:
“Erreur lors de l’exécution … Objet ou collection attendu(e).”

PS: strange, I was not seeing Bertrand’s and Olivier’s answers before I started mine?

: Olivier DESCHANELS

That’s in the doc :

https://doc.4d.com/4Dv18/4D/18/Datastores.300-4575757.en.html
Well…I haven’t seen those 5 little words…but it worked perfectly fine in v17 !

And I find it quite strange that composite primary keys are prohibited :-?

: Eric TROTTA

And I find it quite strange that composite primary keys are prohibited

In ORDA this was just a design decision.

Entities/Records are internally accessed via the key.

See:https://doc.4d.com/4Dv18/4D/18/dataClassget.305-4505890.en.html

$e3:=ds.Employee.get(3)

3 is longint 3, the primary key. It could be a long or a UUID.
It is one unique value.

similar for REST:
https://myserver/rest/Employee(3)

For a composite keys it would need to be a more complex parameter, such as an object where the parts (two or more fields) are specified. That would be more complex and slower to execute.

So it was just a decision to say: if you want to use ORDA, you need to have a single key…

: Thomas MAUL

So it was just a decision to say: if you want to use ORDA, you need
to have a single key…
I’m curious to know if many 4D developers use composite keys in their works.

Bertrand,

: Bertrand SOUBEYRAND

I’m curious to know if many 4D developers use composite keys in
their works.

I used one once! It was a long time ago and I was younger but I tried it.

I’m curious to know if many 4D developers use composite keys in their works.

I looked at it once. I seem to remember not liking it, but didn’t have the inclination to work out why.