Using DynamicTable Fields in Clarion

Morning, folks.

I need a little help over here with clarion and those tables things.

I’m working on a project where we need to save some fields in tables, but in a dynamic way. I’m returning a JSon Object from a webserver and there is a list on this object where I have diferent fields from diferent tables. Every record of this list has an ID which is always the same and references the same field on Clarion, but I don’t want to do a case to work with every code that I have returned. Is there any way to cast the table field by the name, for example, and initialize it with the value which I want to save and work with the “get”, “add” and “put” stuff from Clarion?

I don’t know if it is clear. I can try to explain it in another way.

Thx.

Hi There-

If this is SQL, the simplest way is probably through PROP:SQL using a dummy table. This way you can construct your own update/insert statements. Just be careful of SQL injection.

You could also build your own access using the ODBC api.

With top speed files, a more convoluted way would be to create the access to the table with the DynFile driver. This is tougher as you will need to know the structure of the files you want to update.

Just some ideas…

HTH,
Gordon

I think that I couldn’t express myself in the way that I wanted. Nevermind, Gordon; Thanks for your help.

You can do this using i.e. DynaLib templates