Jump to content

BE_FileMaker SQL Delimiter ?changed? accept only 1 character

Recommended Posts

Hi, I have been using Base Elements command BE_FileMakerSQL in FileMaker script to SQL select data, and return with '<c>' as field(column) delimiter, and '<r>' as the row delimiter. The below line worked before, I dumped a whole FM database with these delimiters showing in text files. But somehow, now if I run below line, it seems to have changed to ?only allow? 1 character for the delimiter, which of course doesn't make sense anyway with varied characters in the data:

BE_FileMakerSQL ( $sql_select;  "<c>" ; "<r>" ; $fm_file )

The string this returns now looks like for example: 352265<gwgwh<474848<<wegwgw<65755<gwgw ....

i.e. it has only taken the first character of the delimiter, I changed delimiter string to test with eg "A≠" instead of "<c>", same problem, it then only inserts "A" as delimiter. Just wonder if anyone can guess what might have happened here?

Thanks kindly any suggestions!

Link to post
Share on other sites

The documentation states clearly that the separators are single characters only.

I am not a frequent user of this function and I don't know if this is something new or if it was always like that.

You could designate a pair of special characters (characters that will never appear in the data) as the separators and use Substitute() on the result to replace them with the strings you want.



Link to post
Share on other sites

Thanks @consultant @Wim both your comments are helpful to make me recheck, think through again and confirm not losing my mind just yet.. ExecuteSQL can use with multi character delimiters yes, unfortunately for this one executing against another script-locked FM database, so forced to use BE_FileMakerSQL. The docs do indeed state BE_FileMakerSQL only accepts 1 character delimiters. However, I  used this same code less than 2 weeks ago on other FM database and worked, I can see the text files output with <c> <r> delimiters in them. So I guess only thing is environment changed somehow.

In case anyone else sees this and struggling to find 1 character delimiter that they can guarantee won't be in the data.. I suppose for a data delimiter, you really want the most obscure character you can find..

My data is large and varied - as I was just looking main FM code window, my first best guess was: ≥ and ≠ 

Probably 50% chance working without any exception for data I have, but I speak Chinese, and then realised maybe 1 Chinese character will be accepted by FM script as a 1 character delimiter (I kept thinking unicode codepoints more than 1 character, which indeed they are), lo and behold present: 

䶫 and 

which I'm fairly sure most native Chinese people won't understand without a dictionary! In fact wiktionary.org doesnt even have definition yet for either! Do have a few Chinese artwork names in this data, but even so chance of this coming up in more than 1 artwork is infinitesimal I think! Of course FM is in utf-8 coding by default, so any 1 unicode character (not code point) should work I think?

Then after this, as you say use Substitute() on result, still within the FM script, perform a couple of Substitute() lines to convert these to save to CSV format.

Link to post
Share on other sites
1 hour ago, Will_Logic said:

In case anyone else sees this and struggling to find 1 character delimiter that they can guarantee won't be in the data.. I suppose for a data delimiter, you really want the most obscure character you can find..

A better alternative, IMHO, is to use characters designated for such purpose. Here are some you can choose from:

  • Char ( 31 ) - UNIT SEPARATOR
  • Char ( 30 ) - RECORD SEPARATOR
  • Char ( 29 ) - GROUP SEPARATOR
  • Char ( 28 ) - FILE SEPARATOR
  • Char ( 8233 ) - PARAGRAPH SEPARATOR
  • Char ( 8232 ) - LINE SEPARATOR

There are also non-characters "intended for process-internal uses":

  • Char ( 65534 )
  • Char ( 65535 )



  • Like 1
  • Thanks 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Similar Content

    • By Msaeed
      Hi All,
      I would like to find solve my issue, as mentioned on the topic of how can find more than fields like serial No. or Code by IOS camera. please find below the script.
      thank in advance for any help or support  
    • By tomp
      I'm having a problem getting BE_SMTPsend to successfully send an email with an attachment.
      No problem sending without an attachment, but when I add an attachment, I get an error 2 (not sure exactly what that means, but without the attachment, no error)
      These are the argument strings with and without attachments:

      I have tried both relative and direct file paths for the variable $attachment. Examples are:

      Both of them return an error code of 2.
      Since the 'send' without an attachment works, all the values of the fields/variables other than $attachment must be valid.
      Can anyone offer a suggestion as to what might be going on and what I might try to resolve this?
    • By Msaeed
      Hi All,
      As per mentioned on topic, in fact i would like to create icon ex. hour in case rigging guard the insert time.

    • By Solvax
      I'm trying to make a subsummary report with data from the current table and a related table.
      I never get to display the correct totals for the related table, and would therefore appreciate your help.
      First I'll try to explain the workflow:
      I have two tables called 'Voorraad_uit' (= outgoing stock) and 'Voorraad_in' (= incoming stock) which are related by delivery number.
      Data is first entered in 'Voorraad_in' (= incoming stock) and then related records are created in 'Voorraad_uit' when an incoming stock item is partly or completely shipped.  This second table contains mainly the outgoing amount and a unique outgoing delivery ID.

      As a consequence, one record in table 'Voorraad_in' (= incoming stock) can have one ore more related records in 'Voorraad_uit' (=outgoing stock).
      I want to make a subsummary report showing the total amount of incoming and outgoing units per product(name) by using the following layout structure:

      I tried two scenarios which each give me a part of the desired result.
      when I base the layout on 'Voorraad_in' (=incoming stock): I get the right totals for incoming deliveries I get all the incoming deliveries listed (also those without outgoing delivery) Body part 3 (see above) only shows one row also when there are more than one related outgoing transactions I get the wrong totals for outgoing deliveries (only based on one record) when I base the layout on 'Voorraad_uit' (=outgoing stock): I get the wrong totals for incoming deliveries I don't get all the incoming deliveries listed (only those with outgoing delivery) Body part 3 (see above) shows all the related outgoing transactions I get the right totals for outgoing deliveries Main goal is having the right totals for both incoming and outgoing deliveries..
      My layout is sorted ascending by (in mentioned order) productname, incoming delivery number and outgoing delivery number.
      The totals are calculated by using summary fields.
      I hope I'm on the right track and that the desired result is possible.. your help is much appreciated!
      Thanks in advance for your help.
    • By Steve Pfister
      Security Challenge when signing on to Paypal through Filemaker pro 18 web viewer.    I see the text "Security Challenge" but nothing else shows up... all is invisible, making it impossible to solve the security challenge and sign in....  Mac Pro..OS High Sierra 10.13  ....running Filemaker 18 .     I am having Java script issues I am assuming.   Has anyone else had this similar issue and solved it?
      Thank you in advance
  • Who Viewed the Topic

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.