mysql_value_string — converts a Gamma value into a string for use in an SQL statement.
mysql_value_string (value)
This function converts the supplied value into a string that is suitable for inclusion in an SQL statement. It will convert a number to its string representation, and will convert a string into that string surrounded by double quotes, with embedded double quotes escaped using backslash characters. Any other data type will be converted to its string representation.
Gamma> require("MySQLSupport"); "/usr/cogent/require/MySQLSupport.g" Gamma> mysql_value_string("Hi there."); "\"Hi there.\"" Gamma> mysql_value_string(27); "27" Gamma> mysql_value_string(27.2); "27.199999999999999289" Gamma> mysql_value_string(date()); "\"Fri Apr 18 11:11:20 2003\"" Gamma> mysql_value_string(#3 + 4); "(+ 3 4)" Gamma> mysql_value_string(2003-04-17); "1982" Gamma> mysql_value_string(#2003-04-17); "(- (- 2003 4) 17)"
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.