SQLQuote ( )

Function stats

Average user rating
375
345
9999
Support
FileMaker 7.0 +
Date posted
08 February 2013
Version
1
Recursive function
No

Author Info
 Daniel Smith

8 functions

Average Rating 5.0

author_avatar



 

Function overview

Prototype

SQLQuote  ( text  )


Parameters

text   text to quote


Description

Tags:  Sql  

Wrap text in single quotes, for use with SQL queries.
The purpose of the Substitute is to "escape" any internally embedded apostrophes, e.g., O'Malley becomes 'O''Malley', which SQL will convert into O'Malley

Examples

Sample input

O'Malley


Sample output

'O''Malley'

 

Function code

/* SQLQuote ( text )

PURPOSE:
Wrap text in single quotes, for use with SQL queries.
The purpose of the Substitute is to "escape" any internally embedded apostrophes, e.g., O'Malley becomes 'O''Malley', which SQL will convert into O'Malley

PARAMETERS:
(text) text    text to quote

DEPENDENCIES:
none

REVISIONS:
2011-MAR-25    - Created by Kevin Frank http://www.filemakerhacks.com/?p=1065
2011-JUL-01    - Dan Smith dansmith65@gmail.com
    - renamed from Q to SQLQuote
    - added to documentation section
####################################################################################################*/

"'" & Substitute ( text ; "'"; "''" ) & "'"

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/345

    Prototype: SQLQuote( text )
    Function Author: Daniel Smith (http://www.fmfunctions.com/mid/375)
    Last updated: 08 February 2013
    Version: 1

*/
// ===================================

 

 

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (32)
Date  (28)
XML  (27)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Layout  (15)
Interface  (15)
Text  (14)
Variables  (13)
Filter  (12)
Layout Objects  (11)
Design  (10)
Array  (8)