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?
--
a good start is the Pizza Party with Fusion Tables for App Inventor 2
see also the SQL reference https://developers.google.com/fusiontables/docs/v1/sql-reference#updateRow
and here an example of an UPDATE statement https://puravidaapps.com/fusionDB.php#update
this also may help
--
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"
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?
--
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
--
댓글 없음:
댓글 쓰기