My requirement is to find the column which has more than 4000 characters in the entire found set in all the tables in the database file.
Could you please suggest me how to achieve this using Filemaker scripts?
If you want to find "column", how do you want to see the result?
Found set can show only "record".
And, "all tables" but "found set", not "all records" ??
I agree with user19752, explain a bit more what are you trying to do and what you have tried so far.
To start you up: check for one table and one column:
length (ExecuteSQL ( "SELECT myColumn from myTable" ; "" ; "" )) - Get ( FoundCount )
If this is related to your other topic of trying to export to .csv and then import into Excel, please link to that post.
As the other have said, your question is not clear. And perhaps you need to post in your native language and others on this forum can assist you better?
see this article:
Using ExecuteSQL to Query the Virtual Schema/System Tables
loop on all tables you got from specific query
loop on all fields you got from specific query
get current field contents in a list
loop on $i from 1 to valuecount(list)
$value = getvalue(list; $i)
if length($value) > 4000
$Log = List( $Log, currentTableName & char(9) & currentFieldName & char(9) & $i & char(9) & "[" & $value & "]")
end loop // list
end loop // fields
end loop // tables
set a gField to $Log
...and go look at it.
Sorry for not being clear in the requirement.
I have to find out the field values which has more than 4000 characters for all the fields in a table.
Consider Table A which has Col_1,Col2. I just want to find the list of values whose length is greater than 4000 which are present in Col_1 and Col_2.
Can you please advise me how to do it using Filemaker Scripts?
if all the fields are on a layout then this is useful (test for first field, so you can get out of the loop!)
Go to Next Field
(no ExecuteSQL needed).
How many fields and records are there?
WHERE LENGTH(Col1)>4000 OR LENGTH(Col2)>4000
You could simply create a calc field (text) named Length4000:
Length(Col_1) > 4000 ; "Col1" ;
Length(Col_2) > 4000 ; "Col2" ;
and do a find for records where Length4000 contains a value other than "Neither"...and you'll know which column it is as well...
Retrieving data ...