Set Variable with the Result of a SQL Select

Now I stuck in producing an integer variable out of an sql result, concerning the number of characters of a string (in a table cell). I get the right number with the procedure blocks, but it is no number I can process as an integer number. The number comes out together with an sql variable called Laenge. I tried to feed the integer variable "global RezStringLaenge" width the "global result" of the query, but the result is a list...


are you aware, that you get the result of the query in the Web.GotText event?
you might want to provide a screenshot of that event...

also it seems to be a little bit cumbersome how you create your select statement...
there is not need to first prepare all these global variables...
also what happens, if you use Do it to find out, it the select statement looks fine?
you might want to provide another screenshot including Do it results...

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

Thanks for your reply!

  1. I upload the Web1_GotText_Event and 2 screenshots of the number results (CHARACTER_LENGTH of a cell and COUNT the records) above the green buttons (the results are correct):

  1. These query results should be split off the text and the "|" character. The remaining number should be transformed in an integer variable to compare it with a "maximum"

  2. I use the above global variables because I use the query for different columns

  3. I will exercise your hints using the Do-it for debugging

I add the DisplayTable procedure too


I enhanced the Display Procedure with a variable catch of the result:

Then I tried to parse it with Taifun's parse procedure and display it with a test button, but it does not parse...(The result is displayed in 2 rows...the target is one integer figure)


Now I changed the start-/end-parameter and I get the following (what I do not understand why!):

btnDisplayTest with changed start-end

Now, there is only one figure left. I try to pack it into an integer variable now...

I can't find any way to change my string number into an integer one. No chance to compare the resulted number of characters with a limit/maximum. I searched in the guide, no sucess....

Show the procedure (parse) to get these (Do it) results:

Now I found a JavaScript function: parseInt(string, radix) which parses a string and returns an integer. (string is required, radix is optional) I found also an article to use the WebViewer as a JavaScriptProcessor.

Here I upload the Parse Procedure from Taifun: