2014년 12월 11일 목요일

Problem with Update and delete query

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.







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?



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



I corrected the And query but i get two results but not the row id.







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) 




Ok i am successful in getting the rowid but the id is enclosed with brackets. how do i extract it. please help  




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



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



Without screenshot we can't see what you are doing. I'm wondering, why you do not like to split at \n as suggested...



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.







you have to split at \n (note the backslash instead of forward slash)



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.



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





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

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.



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.





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.



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.


댓글 없음:

댓글 쓰기