Skip to first unread message

Yusuf Jk

unread,
Oct 21, 2014, 5:57:20 AM10/21/14
to mitappinv...@googlegroups.com
Hey, 
       So i had to make a new thread as i couldn't find any solution to it by myself.

I want the correct update and delete query for the following block attached below. also i want to know what the problem is.

I want the row id if two fields are matched that is Product and size in the fusion table.


rowid.JPG
Selectquery.JPG
tableids.JPG
updateusingrowid.JPG

Abraham Getzler

unread,
Oct 21, 2014, 11:11:01 AM10/21/14
to mitappinv...@googlegroups.com
For starters, I suggest going into your data and changing all occurrences of
the double quote character (") to the word inches.

The quote characters mess up query syntax if the are not balanced or
safely wrapped up in other quote-type characters. 
It's much easier to avoid the problem and drop them from your data.
(Apologies to Mr. O'Brian)

I am also suspicious of your use of  '&&' instead of the word AND.
It looks like something out of the Microsoft Access SQL handbook, and
not part of Fusion Table syntax.
Could you please confirm that for us?

ABG

Taifun

unread,
Oct 21, 2014, 4:18:27 PM10/21/14
to mitappinv...@googlegroups.com

as ABG said, use AND instead of &&
do you have the columns Tee and Size in the table?

btw. you error message is displayed in the second Do it result, because you do not have any error handling in the GotResult event

if you later get the rowid back successfully, please note, that you also will get back the header row, which means the result will look like this

rowid
101

101 is just an example of a rowid.
you can extract the 101 from the example by using the split at block, just split at \n and you get a list with 2 items, then select the second item to get the rowid (in this case the 101) 

first try to get a vaild rowid back, then continue with the UPDATE statement

Taifun


Yusuf Jk

unread,
Nov 5, 2014, 3:41:20 AM11/5/14
to mitappinv...@googlegroups.com
I corrected the And query but i get two results but not the row id.
result.JPG
Screenshot_2014-10-23-12-27-35.png
Screenshot_2014-10-23-12-27-37.png
update.JPG

Taifun

unread,
Nov 5, 2014, 9:12:47 AM11/5/14
to mitappinv...@googlegroups.com
if you do not get a rowid as in your example, you should check your SELECT statement
global rowid in your example is a list, in your case a one item list, because no row was found
also add some error handling, something like this: if length of list = 1 then display "no row available" else update

rowid
101

101 is just an example of a rowid.
you can extract the 101 from the example by using the split at block, just split at \n and you get a list with 2 items, then select the second item to get the rowid (in this case the 101) 

Taifun

Yusuf Jk

unread,
Nov 8, 2014, 3:28:10 AM11/8/14
to mitappinv...@googlegroups.com
Ok i am successful in getting the rowid but the id is enclosed with brackets. how do i extract it. please help  
Screenshot_2014-11-08-13-52-07.png

Taifun

unread,
Nov 8, 2014, 8:20:27 AM11/8/14
to mitappinv...@googlegroups.com
how does your fusiontable control got result event look like?
what is the result you get from the fusiontable?
rembember, the result looks like this:

rowid
101

Taifun

Yusuf Jk

unread,
Nov 8, 2014, 9:10:07 AM11/8/14
to mitappinv...@googlegroups.com
Yes i got the result as rowid 101. Then i added a component to split the text at rowid and only get the id. So i get the only the id but idk why it gets enclosed in brackets

Taifun

unread,
Nov 8, 2014, 9:34:32 AM11/8/14
to mitappinv...@googlegroups.com
Without screenshot we can't see what you are doing. I'm wondering, why you do not like to split at \n as suggested...
Taifun

Yusuf Jk

unread,
Nov 8, 2014, 10:16:22 AM11/8/14
to mitappinv...@googlegroups.com
The result i get from the first pic is (3). just the id which i want when i use /n it does not split and shows rowid together.
result2.JPG
result3.JPG
Screenshot_2014-10-23-12-27-35.png
Screenshot_2014-11-08-20-40-04.png

Taifun

unread,
Nov 8, 2014, 2:55:05 PM11/8/14
to mitappinv...@googlegroups.com
you have to split at \n (note the backslash instead of forward slash)
Taifun

Abraham Getzler

unread,
Nov 8, 2014, 6:49:19 PM11/8/14
to mitappinv...@googlegroups.com
If you are seeing () around your result it's because it's a list,
which is what the split operation returns.

Select the first (or whatever) element to get just the value,
using the list select element block.

ABG

Yusuf Jk

unread,
Nov 9, 2014, 3:22:54 AM11/9/14
to mitappinv...@googlegroups.com
I did as you said and now i get the rowid correctly. Now a problem has occurred in update query, please find out where have i made the blunder
update.JPG
Screenshot_2014-11-09-18-47-51.png

Taifun

unread,
Nov 9, 2014, 9:18:55 AM11/9/14
to
you still split at rowid...
your result looks like this

rowid
3

this is the same as rowid\n3
as we know, \n (backslash n) is the invisible newline character
after splitting at rowid you get \n3 as rowid, this is not what you want...
this is also why you find the 3 in the next row of the Do it result, see screenshot





so my suggestion is, as already recommend several times, to split at \n
just split at \n and you get a list with 2 items, then select the second item to get the rowid
Thank you for trying it now.

Taifun

Yusuf Jk

unread,
Nov 12, 2014, 3:54:47 AM11/12/14
to mitappinv...@googlegroups.com
Thanks Taifun i finally got what you were trying to say and implemented it and i can now get my commands working alright but there are some problems occurring i dont know why. My fusiontables is connected to more than one table, in some the commands work correctly but not in two tables. 

1st table: When i use the update command for a different size column the same result is copied to the other cell in the size column i dont know what wrong i have done.

and The data in all the tables gets entered when i click on the update button twice. it does not get updated when the button is clicked once.
error.JPG
update.JPG

Taifun

unread,
Nov 12, 2014, 8:31:22 AM11/12/14
to mitappinv...@googlegroups.com
without taking a look at what you have done this will be difficult to find out....
and this is where personal support starts for me.
as you can see from my webpage, I'm also offering personal support for a small fee. In case you are interested in this service, please contact me directly per email. Thank you.
Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.                

Yusuf Jk

unread,
Nov 19, 2014, 5:33:20 AM11/19/14
to mitappinv...@googlegroups.com
Okay but the only way i can donate to you is through fiverr. if you can make an account there i will pay for your service. More likely i think the fault is not in the blocks but in the fusion tables.
Reply all
Reply to author
Forward
0 new messages