Ampersand:
SET DEFINE OFF removes SQL+'s special meaning for &, which is to turn a word into a variable.
SET DEFINE OFF
UPDATE EO
SET DIRECTIONS = 'CORNER OF 16TH ST NW & I ST NW'
where eo_id = 1;
SET DEFINE ON
Semicolon:
SET SQLTERMINATOR OFF is supposed to remove the special meaning of ;, but it doesn't seem to work. Instead, change the SQL Terminator to another symbol, e.g. "~":
SET SQLTERMINATOR ~ (or use SET SQLT ~ for short)
To turn semicolon back on use:
SET SQLTERMINATOR ON
Apostrophe (=Single Quote):
Replace all apostrophes with 2 apostrophes in your insert statements; they'll be added to the database as just one.
UPDATE EO
SET DIRECTIONS = 'TODD''S FORK'
where eo_id = 1;
Following is an Excel macro that encloses text (in each selected cell) in single quotes, replaces ' with '', and trims outside spaces, to prepare text for SQL insert statements.
NOTE: to have macros always available in Excel, store them in a file named personal.xls in the XLStart folder.
Sub Add_quotes()
'For data in each selected cell,
'enclose in single quotes, replace ' with '', and trim outside spaces '(to prepare text for SQL insert statements)
For Each c In Selection.Cells
If IsNull(c.Value) Or Trim(c.Value) = "" Then
c.Value = "Null"
Else
c.Value = "''" & Replace(Trim(c.Value), "'", "''") & "'"
End If
Next c
End Sub