[Gambas-user] too many operands

Dimitris Anogiatis dosida at ...626...
Mon Sep 7 11:41:35 CEST 2009


MSulchan,

Where is this coming from? Gambas or mysql?

can you try and do this insert in mysql in a terminal window?

if mysql doesn't return an error and accepts the insert command then
you might want to break the sql string like this

sSql = "INSERT INTO refPos(id,idpos,year,month,day, "
sSql &= "r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, "
sSql &= "r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, "
sSql &= "r21, r22, r23, r24, r25, r26, r27, r28, r29, r30, r31"
sSql &= ") VALUES "
sSql &= "('" & hRes!iddata & "', '" & hRes!idpos & "', '" & hRes!yr & "', '"
& hRes!mn & "', '" & hRes!dt & "', '"
sSql &= hRes!r1 & "', '" & hRes!r2 & "', '" & hRes!r3 & "', '" & hRes!r4 &
"', '" & hRes!r5 & "', '" & hRes!r6 & "', '" & hRes!r7 & "', '"
sSql &= hRes!r8 & "', '" & hRes!r9 & "', '" & hRes!r10 & "', '"
sSql &= hRes!r11 & "', '" & hRes!r12 & "', '" & hRes!r13 & "', '" & hRes!r14
& "', '" & hRes!r15 & "', '" & hRes!r16 & "', '" & hRes!r17
sSql &= "', '" & hRes!r18 & "', '" & hRes!r19 & "', '" & hRes!r20 & "', '"
sSql &= hRes!r21 & "', '" & hRes!r22 & "', '" & hRes!r23 & "', '" & hRes!r24
& "', '" & hRes!r25 & "', '" & hRes!r26 & "', '" & hRes!r27
sSql &= "', '" & hRes!r28 & "', '" & hRes!r29 & "', '" & hRes!r30 & "', '" &
hRes!r31 &  "')"

I hope this helps
Keep up the good work

Regards,
Dimitris


2009/9/7 MSulchan Darmawan <bleketux at ...626...>

> Dear all,
>
> Any suggestion to simplify this code ? I had "Expression too complex,
> too many operands" warning :D
> I have 36 fields data to insert.
>
>    sSql = "INSERT INTO refpos (id, idpos, year, month, day, " &
>                  "r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, " &
>                  "r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, " &
>                  "r21, r22, r23, r24, r25, r26, r27, r28, r29, r30, r31" &
>                   ") VALUES " &
>           "('" & hRes!iddata & "', '" & hRes!idpos & "', '" & hRes!yr & "',
> '" & hRes!mn & "', '" & hRes!dt & "', '" &
>           hRes!r1 & "', '" & hRes!r2 & "', '" & hRes!r3 & "', '" & hRes!r4
> & "', '" & hRes!r5 & "', '" & hRes!r6 & "', '" & hRes!r7 & "', '" & hRes!r8
> & "', '" & hRes!r9 & "', '" & hRes!r10 & "', '" &
>           hRes!r11 & "', '" & hRes!r12 & "', '" & hRes!r13 & "', '" &
> hRes!r14 & "', '" & hRes!r15 & "', '" & hRes!r16 & "', '" & hRes!r17 & "',
> '" & hRes!r18 & "', '" & hRes!r19 & "', '" & hRes!r20 & "', '" &
>           hRes!r21 & "', '" & hRes!r22 & "', '" & hRes!r23 & "', '" &
> hRes!r24 & "', '" & hRes!r25 & "', '" & hRes!r26 & "', '" & hRes!r27 & "',
> '" & hRes!r28 & "', '" & hRes!r29 & "', '" & hRes!r30 & "', '" & hRes!r31 &
>            "')"
>
> Thanks for your valuable suggest,
>
> --
> Cheers,
> [-Sulchan-]
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>



More information about the User mailing list