specifying where clause in sync pff file?

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Post Reply
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

specifying where clause in sync pff file?

Post by Anne »

After data collection, our data needs to be managed in various local offices, so I made a desktop application which (amongst other stuff) runs a pff file to download data from the csweb server.

My challenge is that the data is confidential, so I only want to download the data relevant for the given local office, but I can't find documentation anywhere that it is possible to download/sync data by specifying the cases you want. This would also come in handy as the amount of data grows (this is a monthly survey going on forever, hence file sizes will probably become a problem sooner or later)

Any suggestions on how to deal with this?

(My not-so-elegant solution is to copy the relevant data to another csdb file right after downloading, and then delete the downloaded file)
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: specifying where clause in sync pff file?

Post by htuser »

Hi Anne,
Have you looking for using universe with sync? https://www.csprousers.org/forum/viewtopic.php?t=2467
This could help you.
However, actual universe lack of flexibility. It's why months ago, Greg think to give us a better way, something that combines CSPro and SQL like this:

syncdata(PUT or GET, SURVEY_DICT where .... = x and ...= y);

But it's not implemented yet.

If multiples users request it, maybe, we may have it quickly.
Last edited by htuser on December 3rd, 2020, 9:26 am, edited 1 time in total.
G.VOLNY, a CSProuser from Haiti, since 2004
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

Re: specifying where clause in sync pff file?

Post by Anne »

thank you, htuser
This would be a great way of doing it had it been implemented :D

My method was just to run the pff file that is generated when you click on the download icon on csweb.. and I wamted to add parameters to that file, but your suggestion is much more general and usable..

Let's cross fingers that it will be implemented..

Anne
aaronw
Posts: 565
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: specifying where clause in sync pff file?

Post by aaronw »

If your case ids specify the local office, then the sync universe would be perfect. Notice that syncdata takes a optional parameter sync_universe:
https://www.csprousers.org/help/CSPro/s ... ction.html

A few paragraphs down the use is explained. Ideally, you could specify a particular local office. For instance, if you wanted to download cases for the office specified by REGION 01, WARD 02, EA 007, OFFICE 001 it would look like:
string officeUniverse = maketext("%v%v%v%v", REGION, WARD, EA, OFFICE);
syncdata(GET, SURVEY_DICT, officeUniverse);
At the least you could limit the data downloaded to a geographically area:
string officeUniverse = maketext("%v%v%v", REGION, WARD, EA);
syncdata(GET, SURVEY_DICT, officeUniverse);
noel
Posts: 25
Joined: June 16th, 2012, 7:32 pm
Location: Libreville, Gabon

Re: specifying where clause in sync pff file?

Post by noel »

Hi Aaronw,

It would be a good think to be able to use a where clause with sync statement.

I hope it will be implemented quickly.

Noël
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

Re: specifying where clause in sync pff file?

Post by Anne »

Aaronw,
this helps a lot, thank you..
Now I only need some wild cards in the middle and it'd be perfect :)
Post Reply