Support Forum

Ask questions and get help from MobileTogether experts.
MobileTogether Product Information
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
nigel  
#1 Posted : Friday, April 20, 2018 9:08:48 AM(UTC)
nigel

Rank: Advanced Member

Groups: Registered
Joined: 1/20/2017(UTC)
Posts: 59
United Kingdom
Location: sussex

Thanks: 1 times
My project was completed and went live last year, so thank you for your help in achieving this. I now have a small problem, which I am sure has a very simple solution. I need to have an sql database, which is server only, so it the client does not have create original rowset and therefore does have have access to any of the server data. The client data is persistent client only, and it needs to send the data to the sql database which has auto-increment setup. My problem is that I get errors about not mixing client only and server only page sources. Is there an example of a page that just has a single input that when a button is pushed it sends the data to the server and does not need to read it back again. I know this sounds really simple but I just cannot get the data to update on the server.
bbv  
#2 Posted : Friday, April 20, 2018 10:22:54 AM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 484

Was thanked: 81 time(s) in 81 post(s)
Simply don't mark your client data as client only. This will solve the issue. Don't get confused - it will not be saved on server - it will still only resist on client, but with the shared flag it is allowed to be transferred to server
nigel  
#3 Posted : Friday, April 20, 2018 10:39:34 AM(UTC)
nigel

Rank: Advanced Member

Groups: Registered
Joined: 1/20/2017(UTC)
Posts: 59
United Kingdom
Location: sussex

Thanks: 1 times
The trouble is that I do not want to have the original rowset enabled as I do not want to download any data from the server. As there is so much data it slows the app down comparing the data for changes. I just need to send the client data at the server. The bulk insert would do what I need but it does not allow me to select persistent data to put into the send array.
bbv  
#4 Posted : Friday, April 20, 2018 11:45:53 AM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 484

Was thanked: 81 time(s) in 81 post(s)
This is what I was trying to say - mark your persistent data as shared between client and server. That's it
nigel  
#5 Posted : Friday, April 20, 2018 12:03:01 PM(UTC)
nigel

Rank: Advanced Member

Groups: Registered
Joined: 1/20/2017(UTC)
Posts: 59
United Kingdom
Location: sussex

Thanks: 1 times
Sorry, I misunderstood. I will change the way the data is kept so that bulk insert works but is there an easy way on doing bulk insert with over 300 fields eg a script.
bbv  
#6 Posted : Friday, April 20, 2018 1:09:44 PM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 484

Was thanked: 81 time(s) in 81 post(s)
Yes, there is a DB Bulk Insert action
nigel  
#7 Posted : Friday, April 20, 2018 3:21:33 PM(UTC)
nigel

Rank: Advanced Member

Groups: Registered
Joined: 1/20/2017(UTC)
Posts: 59
United Kingdom
Location: sussex

Thanks: 1 times
I have this working manually where I place the values into the insert into array eg. [90909,99,999,9999,99999,0]
but when I try this:-
[element Row {
for $i in $PERSISTENT/Root/test/*
return attribute { $i/name() } { $i/text() }
}]

or

element Row {
for $i in $PERSISTENT/Root/test/*
return attribute { $i/name() } { $i/text() }
}

It just puts spaces into the first value and null into the rest in the sql database. I just need tthe code to read through the persistent fields and send the values in an array. Any help would be much appreciated.

Thanks

bbv  
#8 Posted : Friday, April 20, 2018 9:27:17 PM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 484

Was thanked: 81 time(s) in 81 post(s)
I can only guess what you are doing without seeing your XML and DB structures. If you need to put values from elements under test element in their order into an array, then the syntax would be:

$PERSISTENT/Root/test/array{*}
nigel  
#9 Posted : Sunday, April 22, 2018 9:28:02 AM(UTC)
nigel

Rank: Advanced Member

Groups: Registered
Joined: 1/20/2017(UTC)
Posts: 59
United Kingdom
Location: sussex

Thanks: 1 times
The database is simply fields called a,b,c,d,e and they are all character fields. The app is 5 boxes in a persistent file with attributes a,b,c,d,e and a button to submit.
I need to make the attributes in the app bulk send to the sql server, so if the app entries were 1,2,3,4,5 then it would send [1,2,3,4,5] to the sql database.
I am having problems getting the correct syntax so the attributes are sent to the sql database. Please can you supply the script for the values part of the bulk send procedure where it reads all attributes and creates an array to send to server.

Many thanks
nigel  
#10 Posted : Wednesday, April 25, 2018 1:12:49 PM(UTC)
nigel

Rank: Advanced Member

Groups: Registered
Joined: 1/20/2017(UTC)
Posts: 59
United Kingdom
Location: sussex

Thanks: 1 times
ALthough I can get the attributes using a for loop
eg.
[ for $i in $PERSISTENT/Root/test
return attribute concat($i , ",")
]
I cannot see how to create an array with the brackets on each end so I can do a bulk send.
I have read the xpath documentation but this does not help on creating an array
eg array:append([], $i)

I really would appreciate some help with contructing this as I cannot seem to get the syntax correct.
bbv  
#11 Posted : Wednesday, April 25, 2018 8:49:14 PM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 484

Was thanked: 81 time(s) in 81 post(s)
In this case the statement is

$PERSISTENT/Root/test/array{@*}
nigel  
#12 Posted : Thursday, April 26, 2018 8:31:27 AM(UTC)
nigel

Rank: Advanced Member

Groups: Registered
Joined: 1/20/2017(UTC)
Posts: 59
United Kingdom
Location: sussex

Thanks: 1 times
How would this be used to create an array that looks like:-
[ value1, value 2, value 3, etc]
so it can be used in bulk insert

Thanks
bbv  
#13 Posted : Thursday, April 26, 2018 10:36:08 AM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 484

Was thanked: 81 time(s) in 81 post(s)
I don't understand the question. You've asked me about a statement to create such array, I've sent you one.

Don't get confused with array{ @* } syntax
It will get you the arrays with rectangular brackets as requested
Users browsing this topic
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.