NetTalk Central

Author Topic: Complex Data in NetTalkAPI  (Read 2944 times)

ProperGary

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Email
Complex Data in NetTalkAPI
« on: March 09, 2022, 03:35:04 AM »
Firstly, apologies for any incorrect terminology, I'm new to Clarion (very old to developing), I've been immersing myself in code articles and webinars but still gaps in my knowledge of Clarion  :)

I've created an API using NetTalk - I have authentication, JWT tokens and simple methods/endpoints all working, but now need to do some more complicated "product" and "order" methods/endpoints that require re-labelling of fields, handle data from a multiple tables and include many code->description looks ups.

I've coded the product query in a SQL query (stored as a Sybase SQL View), but I can't get Clarion to import that view whatever I try, it's may be because it has multiple lookups into the same "extended data" table with different filters to expand text fields (basically all long text fields are stored in a separate table, design not changeable).

So I am thinking that I need to use a GROUP or a QUEUE declared as a type, to pass the data in/out of the API ? Which would also give me more scope to validate the incoming data, add defaults etc. I thought about creating a class (I've used a class for token handling) so I could encapsulate the code, but it looks like NetTalk doesn't support Class as a parameter type?

I've seen that some people mirror the SQL view as a table in the dictionary, but that seems a little messy and I'm not sure how would the update validation would work? That maybe my lack of Clarion experience.

Could people point me toward the best solution for multi table endpoints? I did look for NetTalk examples or Webinars, but could not see anything matching the complexity we need.



Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Complex Data in NetTalkAPI
« Reply #1 on: March 09, 2022, 11:54:19 AM »
Hi,
If you dont want to add the view in the dct then use a dummy sql table to reterive the data and save it in a queue.
Regards
-----------
Regards
Alberto