Skip to content
Advertisement

Ignore hash character in a query on sqlplus

i’ve launched this query on sql developer without error.

But when i launch it with sqlplus i’ve the following errors:

SP2-0734: unknown command beginning “foreach($d…” – rest of line ignored.
SP2-0042: unknown command “end” – rest of line ignored.

There is a way to ignore special character ‘#’ inside the string?

Advertisement

Answer

This is what you have now:

Row actually is inserted, but with errors.

Why is that so? Because you hit the SQLPREFIX issue.

Sets the SQL*Plus prefix character. While you are entering a SQL command or PL/SQL block, you can enter a SQL*Plus command on a separate line, prefixed by the SQL*Plus prefix character. SQL*Plus will execute the command immediately without affecting the SQL command or PL/SQL block that you are entering. The prefix character must be a non-alphanumeric character.

By default, hash # is the SQLPREFIX character. So, change it to something different (what you don’t have in a value you’re inserting, e.g. !) and then repeat the action:

Right; no more errors, length is now as it should be (295 characters).

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement