1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
/* 
 * $Id: sql_util.pmod,v 1.1 1999/07/06 21:58:50 kinkie Exp $ 
 * 
 * Some SQL utility functions. 
 * They are kept here to avoid circular references. 
 * 
 * Henrik Grubbström 1999-07-01 
 */ 
 
//. 
//. File:     sql_util.pmod 
//. RCSID:    $Id: sql_util.pmod,v 1.1 1999/07/06 21:58:50 kinkie Exp $ 
//. Author:   Henrik Grubbström (grubba@idonex.se) 
//. 
//. Synopsis: Some SQL utility functions 
//. 
//. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
//. 
//. These functions are kept here mainly to avoid circular references. 
//. 
 
//. - quote 
//.   Quote a string so that it can safely be put in a query. 
//. > s - String to quote. 
string quote(string s) 
{ 
  return(replace(s, "\'", "\'\'")); 
} 
 
//. - fallback 
//.   Throw an error in case an unimplemented function is called. 
void fallback() 
{ 
  throw(({ "Function not supported in this database.", backtrace() })); 
}