B4J Question Search Sql

BPak

Active Member
Licensed User
Longtime User
ExecQuerySingleResult (Query As String) As String

Check if data exists by using ExecQuerySingleResult

Executes the query and returns the value in the first column and the first row (in the result set).
Returns Null if no results were found.

Before saving the record use a unique field to check if record already exists:

Dim NumberOfMatches As Int
NumberOfMatches = SQL1.ExecQuerySingleResult("SELECT count(*) FROM table1 WHERE col2 = 300")

If NumberOfMatches > 0 then record already exists.
 
Upvote 0

RobRock92

Member
Licensed User
Longtime User
ExecQuerySingleResult (Query As String) As String

Check if data exists by using ExecQuerySingleResult

Executes the query and returns the value in the first column and the first row (in the result set).
Returns Null if no results were found.

Before saving the record use a unique field to check if record already exists:

Dim NumberOfMatches As Int
NumberOfMatches = SQL1.ExecQuerySingleResult("SELECT count(*) FROM table1 WHERE col2 = 300")

If NumberOfMatches > 0 then record already exists.

Thanks and you know a method for use the scroll pane in b4j?the scroll doesn't work
 
Upvote 0
Top