home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / database / sybase / 564 < prev    next >
Encoding:
Internet Message Format  |  1992-12-24  |  1.2 KB

  1. Path: sparky!uunet!olivea!spool.mu.edu!agate!ucbvax!mtxinu!sybase!andy
  2. From: andy@sybase.com (Andy Cohen)
  3. Newsgroups: comp.databases.sybase
  4. Subject: Re: Matching quotes
  5. Message-ID: <27411@sybase.sybase.com>
  6. Date: 21 Dec 92 23:57:02 GMT
  7. References: <1foqtpINNah1@agate.berkeley.edu>
  8. Sender: news@Sybase.COM
  9. Distribution: usa
  10. Organization: Sybase, Inc.
  11. Lines: 22
  12.  
  13. jeklund@jeklund.berkeley.edu writes:
  14.  
  15. > Has anyone got an elegant, user-friendly solution to the
  16. > Sybase ""matching quotes"" requirement in a character field?
  17. > I expect that some kind of stored procedure that is
  18. > executed on update is the answer but has anyone done this?
  19. > I find it a bit awkward to enter two single quotes
  20. > every time I want to include an apostrophe or two
  21. > double quotes whenever I want to include a ""quote.""
  22. > There doesn't appear to be any way to change the delimiter
  23. > in Sybase.  
  24.  
  25. This may or may not qualify as either elegant or user-friendly,
  26. but an application program can use the dbsafestr() call, which is
  27. part of DB-Library. This routine will double any and all quotes in
  28. a character string, making that string "safe" for inclusion within
  29. any SQL statement.
  30.  
  31. Hope this helps,
  32.  
  33.     Andy Cohen
  34.     Sybase, Inc.
  35.