[Gambas-user] MULTIPLE ROW RESULT

Nx GT-R BOY nxgtrturbo at ...626...
Tue Jan 22 01:40:40 CET 2008


Sorry, I made a Mistake with the procedure I write, the right one is:

PUBLIC SUB tellmeposition(lookingfor AS String, table AS String, reference
AS String, value AS String)
myresult = conexion.Exec("SELECT count(*) AS position FROM " & table & "
where " & lookingfor & " < (SELECT " & lookingfor & " FROM " & table & "
where " & reference & " = '" & value & "')")
END

My program crash with the message:
"Query failed: Subquery return more than 1 row"

Did I make something wrong?


On Jan 21, 2008 3:50 PM, Nx GT-R BOY <nxgtrturbo at ...626...> wrote:

> MULTIPLE ROW RESULT
>
> Hi, I got a trouble with the "Result" data type @ gambas, I have a
> function like this:
>
> PUBLIC myresult AS Result
>
> PUBLIC SUB search(lookingfor AS String, table AS String, reference AS
> String, value AS String)
> myresult = conexion.Exec("Select " & lookingfor & " from " & table & "
> where " & reference & " = '" & value & "'")
> END
>
> Everything works perfect when the query returns ONLY ONE ROW, but what
> about multiple row result?, I tried:
>
> PUBLIC myresult AS Result[X]
> and
> PUBLIC myresult[X] AS Result
>
> But that didn't work (the language doesn't allow that), Is there any
> possible way to catch all the rows?
>
>
>
>
> --

Nx GT-R



More information about the User mailing list