Sto provando a interrogare una determinata riga per nome nel mio database sql e ha una e commerciale. Ho provato a impostare un carattere di escape e quindi a scappare dalla e commerciale, ma per qualche motivo questo non funziona e sono incerto su quale sia esattamente il mio problema.Escaping carattere e commerciale in stringa SQL
Set escape '\'
select * from V1144engine.T_nodes where node_id in(
select node2_id from V1144engine.T_edges where node1_id in(
select node2_id from V1144engine.T_edges where node1_id in(
select node2_id from V1144engine.T_edges where node1_id =
(select node_id from V1144engine.T_nodes where node_name = 'Geometric Vectors \& Matrices')))
and edge_type_id = 1)
and node_type_id = 1
and node_id in (
select node2_id from V1144engine.T_edges where node1_id =
(select node_id from V1144engine.T_nodes where node_name = 'Algebra II')
and edge_type_id = 2);
Anche se questo ha una soluzione simile a this question, i problemi sono poste in modo molto diverso. Possono finire per avere la stessa soluzione, ma ciò non significa che le domande siano le stesse.
Non credo che sia necessario il preventivo attorno al carattere di escape ('\') – mcalex
'set define off' è il modo più semplice per farlo. – Annjawn
Duplicato di http://stackoverflow.com/questions/118190/how-do-i-ignore-ampersands-in-a-sql-script-running-from-sql-plus – LordScree