#1 2015-04-15 13:45:08

array81
Member
From: Italy
Registered: 2010-07-23
Posts: 411

Manipulate data to server before send it to client

I have define a TSQLRecord with a "file" field. This is a RawUTF8 variable where I save a subfolder path.
For example I have this path "SERVER\\mypath\subfolder1\subfolder2\" and I use "file" field to save the string "subfolder1\subfolder2\".

The first part of my path ("SERVER\\mypath\") can change se I don't save this on "file" field.

I'd like to do this:
1. the client ask TSQLRecord to server;
2. the server get the TSQLRecord from db and then edit "file" field from "subfolder1\subfolder2\" to "SERVER\\mypath\subfolder1\subfolder2\";
3. the server send the TSQLRecord (edit by server) to client.

Is it possible?

Offline

#2 2015-04-15 16:08:31

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,206
Website

Re: Manipulate data to server before send it to client

I'm sorry, but I'm afraid I did not understand well the question....
sad

Offline

#3 2015-04-20 05:52:35

noobies
Member
Registered: 2011-09-13
Posts: 139

Re: Manipulate data to server before send it to client

create pas, add constant with u path and add on client and server app or save in db in special options table paths and others sys info

Offline

#4 2016-03-08 13:52:03

squirrel
Member
Registered: 2015-08-13
Posts: 146

Re: Manipulate data to server before send it to client

Hi ab, I would like to know something similar to the above question.

I use TSQLDBConnectionProperties.Execute to return ISQLDBRows and then send ISQLDBRows.FetchAllAsJSON to my 3rd party clients.

There are 2 scenarios where I need to change the data before sending it as a result, and I want to ensure that the same format as FetchAllAsJSON is always used:
  1) I must step through the data and change the content of some fields (such as hide sensitive values)
  2) I must remove some records from the set or add additional records to the result set.

What would be the preferred way of doing this?  The queries are very complicated and the data require additional work before being sent as a JSON result.  Do I send the ISQLDBRows to a memory table, or is there a way of directly making changes to the resulting dataset?

Offline

#5 2016-03-09 14:15:03

igors233
Member
Registered: 2012-09-10
Posts: 234

Re: Manipulate data to server before send it to client

> There are 2 scenarios where I need to change the data before sending it as a result, and I want to ensure that the
> same format as FetchAllAsJSON is always used:
>  1) I must step through the data and change the content of some fields (such as hide sensitive values)
>  2) I must remove some records from the set or add additional records to the result set.

I had similar issues and finally settled on using iterating through returned recordset, copying records to TDocVariantData, do the necessary changes and then saving it as JSON. I don't know how effectively or good such solution would be in your case but it would probably require some changes to format.

Offline

Board footer

Powered by FluxBB