[Gambas-user] MULTIPLE ROW RESULT

Arief Bayu Purwanto ariefbayu at ...626...
Tue Jan 22 08:32:59 CET 2008


Can you show us the SQL generated by your script?
the actual query that is sent to mysql server.
On 1/22/08, Nx GT-R BOY <nxgtrturbo at ...626...> wrote:
>
> 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
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
Arief Bayu Purwanto
About : http://about.freelancer.web.id/
Blog : http://bayu.freelancer.web.id/



More information about the User mailing list