Miyako,

One of the problems is that 'Get Last Table Number’ doesn’t acknowledge the new 
temporary table at all, but the Util_GetTableNum function does.

For example, after I create the temporary table, Util_GetTableNum returns table 
number 51. But then when 'Is Table Number Valid’ fails in my code, I log using 
the following method and 'Last Table Number' gives me 48.

See output below (I trimmed it for obvious reasons). It reports the temporary 
table as a missing table (And I’m not sure why I have 5 missing since I’m using 
CREATE TABLE IF NOT EXISTS each time).

Also, this only happens when compiled, client/server.

ARRAY TEXT(asTables;Get last table number)
If (Get last table number>0)
For ($vlTables;Size of array(asTables);1;-1)
If (Is table number valid($vlTables))
SEND PACKET(MyLogDoc;Char(13)+String($vlTables;"00 ")+Table name($vlTables))
Else 
SEND PACKET(MyLogDoc;Char(13)+String($vlTables)+" *Deleted*")
End if 
End for 
End if 

ARRAY TEXT($arrMissingTables;0)
GET MISSING TABLE NAMES($arrMissingTables)
$SizeArray:=Size of array($arrMissingTables)
If ($SizeArray#0)
For ($i;1;$SizeArray)
If (Find in array(asTables;$arrMissingTables{$i})=-1)
SEND PACKET(MyLogDoc;Char(13)+$arrMissingTables{$i}+" *Missing*")
End if 
End for 
End if 

//**********Output*********//
48 Table48
…
…
02 Table2
01 Table1
TempTable_4dt *Missing*
TempTable_4dt *Missing*
TempTable_4dt *Missing*
TempTable_4dt *Missing*
TempTable_4dt *Missing*

Regards,
Mark

> On Oct 10, 2017, at 12:12 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com <mailto:4d_tech@lists.4d.com>> wrote:
> 
> why not simply use Get last table number?
> 
> and you don't really need to use SQL to get a table pointer from name, just 
> do something like...
> 
> C_POINTER($p)
> $name:="Table_1"
> $formula:="<!--#4DEVAL $1->:=->["+$name+"]-->"
> PROCESS 4D TAGS($formula;$formula;->$p)

**********************************************************************
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