2017년 7월 29일 토요일

Fusion Tables UPDATE by App Inventor


I have created an app by App Inventor to store data in a Fusion Table but I need to UPDATE some cells in a specific row. I want to scan a barcode and manually enter the new data. After that, I need to sum the old data and the new data in the row orded by barcode. How can I do it?

--

just send an update statement to the fusiontable using the fusiontable controls
Thank You for the fast answer but I've seen that tutorial about 3 weeks ago and It can't help me. Now I can insert data, but I can't update it. That's my problem. Do You know something about it?

--
the tutorial helps you to learn how to work with fusiontables
now it's your turn
I sent you several links, did you check all of them?
just try something, and if you get stuck, post a screenshot of your relevant blocks

--
Ok, ok. Thank You again. Now I try to explain (if I can) with some screenshots. 
The INSERT TO function works and the dropdown menus too. But now I need to update QUANTITY and PRICE choosing product by barcode scanner. 
--
For UPDATE statements the first step to be done is to get the ROWID of the row to be updated with a SELECT statement. The second step is to do the UPDATE.

you can find the syntax in the documentation https://developers.google.com/fusiontables/docs/v1/sql-reference

btw. you probably like to rename your procedures? for example rename "procedure" to "insert"
what is "procedure2" doing?

--
Yes, You're right!. Rename functions is better then default names. 
I've found that page too, but I think my sintax is incorrect. Can You verify it, please? 
--
1. SELECT ROWID FROM <tableid> 
    WHERE CODICE = '<tb_barcode.Text>'

2. UPDATE <tableid>
    SET GIACENZA = '<tb_quantita_text>', 
           PREZZO = <tb_prezzo_text>
    WHERE rowid = '<rowid from step 1>'

and yes, it helps to read the reference documentation to find out the correct syntax...

--
Now I suppose I undestood. I never thought to need to use SELECT instruction. Can I use them in the same "join" element?

--
no
first do the select
then you get back the rowid in the fusiontablecontrols.Gotresult event
then  do the update

--

댓글 1개:

  1. If you want your ex-girlfriend or ex-boyfriend to come crawling back to you on their knees (no matter why you broke up) you got to watch this video
    right away...

    (VIDEO) Win your ex back with TEXT messages?

    답글삭제