after some testing - it appears there is no (practical) limit.

I created a 4000 pair Selection to Array using the magic *
it appears to have executed correctly, populating the 4000th array

 
On Fri, 2 Feb 2018 09:08:14 -0500, Mike Beatty via 4D_Tech wrote:
> Chip-
> 
> I know at one point the limit was 64, not sure when/if it became 256. I
> demonstrated this to Thibeaux (sp?) many years ago at a Summit and he was
> surprised ;-).
> 
> Regardless, to get around that, I recoded to use SQL commands, which allows
> you to dynamically run table-to-table.
> 
> Here's the code that i used a few years ago to to a mass export. I'm sure
> others have similar (or better) examples.
> 
> 
>   // Method: pSQLSelectIntoArrays
> 
> 
> *C_LONGINT*($vltablenum;$size1;$vlDataLoop2;$fieldnum;$vlCounter;
> $vlFieldType;$vhTimeStampBegin;$vhTimeStampEnd;$vlLimit)
> *C_POINTER*($array;*$1*)
> *C_TEXT*($vtArrayName;$fieldtext;$vtValueText;$vtwhereText;$vtLimitText;
> $vtOffsettext;$vtClientGroup;$clienttext;$vtExportType;$vtSelectText)
> *C_TIME*($vhTime1;$vhTime2)
> *C_LONGINT*($vlOffset;$vlLimit)
> *C_TEXT*(*$2*;*$7*;*$8*)
> *C_LONGINT*(*$3*;*$4*;*$5*;*$6*)
> 
> *pMethodAuditBegin *(*Current method name*)
> 
> vpTablePtr:=*$1*
> $vtArrayName:=*$2*
> $vhTimeStampBegin:=*$3*
> $vhTimeStampEnd:=*$4*
> $vtClientGroup:=""
> 
> $vltablenum:=*Table*(*$1*)
> *If *(*Count parameters*>=5)
> $vlLimit:=*$5*
> $vlOffset:=*$6*
> $vtExportType:=*$7*
> $vtClientGroup:=*$8*
> *Else *
> 
> $vlLimit:=100000
> *End if *
> 
> $vlCounter:=*Get last field number*($vltablenum)
> 
> $vtValueText:=""
> 
> *For *($vlDataLoop2;1;$vlCounter)
> *GET FIELD PROPERTIES*($vltablenum;$vlDataLoop2;$vlFieldType)
> *Case of *
> *: *($vlFieldType=7)  // subtable
>   //: ($vlFieldType=11)  // time - treat as a longint
> $vtValueText:=$vtValueText+":"+$vtArrayName+*String*($vlDataLoop2)+","
> *: *($vlFieldType=30)  // blob
>   // INSERT IN ARRAY(atDataArray;$dataloop;1)
> $vtValueText:=$vtValueText+":"+$vtArrayName+*String*($vlDataLoop2)+","
> *Else *
> $vtValueText:=$vtValueText+":"+$vtArrayName+*String*($vlDataLoop2)+","
> *End case *
> *End for *
> $vtValueText:=*Substring*($vtValueText;1;*Length*($vtValueText)-1)
> 
> *C_TEXT*($tQueryTxt)
>   //$tQueryTxt:="SELECT * FROM "
> $vtSelectText:=*fSQLSelectFromClause *($vltablenum)
> $tQueryTxt:=$vtSelectText  //$tQueryTxt+Table name($vltablenum)
> $vtwhereText:=*fSQLSelectWhereClause *($vltablenum;$clienttext;$
> vhTimeStampBegin;$vhTimeStampEnd;$vtExportType;$vtClientGroup)
>   //if($clienttext#"")
>   //$vtwhereText:=" WHERE "+$clienttext
>   //$vtwhereText:=$vtwhereText+" AND time_stamp >
> "+String($vhTimeStampBegin)+" AND time_stamp <= "+String($vhTimeStampEnd)
>   //else
>   //  $vtwhereText:=" WHERE time_stamp > "+String($vhTimeStampBegin)+" AND
> time_stamp <= "+String($vhTimeStampEnd)
>   //end if
> $tQueryTxt:=$tQueryTxt+$vtwhereText
> $vtLimitText:=" LIMIT "+*String*($vlLimit)
> $tQueryTxt:=$tQueryTxt+$vtLimitText
> $vtOffsettext:=" OFFSET "+*String*($vlOffset)
> $tQueryTxt:=$tQueryTxt+$vtOffsettext
> $tQueryTxt:=$tQueryTxt+" INTO "+$vtValueText+";"
> 
> *C_TEXT*($tQueryTxt)
>   //$tQueryTxt:="INSERT INTO "+Table name($vltablenum)+" ("+$fieldtext+")
> VALUES ("+$vtValueText+");"
> $vhTime1:=*Current time*
> *Begin SQL*
> *EXECUTE* *IMMEDIATE** :*$tQueryTxt*;*
> *End SQL*
> $vhTime2:=*Current time*
> *FLUSH BUFFERS*
> 
> *pMethodAuditEnd *(*Current method name*)
> 
> 
> 
> Mike
> 
> 
> On Jan 29, 2018, at 3:00 PM, 4d_tech-requ...@lists.4d.com wrote:
> 
> I seem to remember that there is limit of 256 pairs for this command.
> 
> I am building the command in text to be used by Execute Formula, I want
> to be sure that I do not exceed the maximum number of pairs allowed.
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to