how to increase sqlplus column output length?

I’ve just used the following command: SET LIN[ESIZE] 200 (from http://ss64.com/ora/syntax-sqlplus-set.html). EDIT: For clarity, valid commands are SET LIN 200 or SET LINESIZE 200. This works fine, but you have to ensure your console window is wide enough. If you’re using SQL Plus direct from MS Windows Command Prompt, the console window will automatically wrap … Read more

When or Why to use a “SET DEFINE OFF” in Oracle Database

By default, SQL Plus treats ‘&’ as a special character that begins a substitution string. This can cause problems when running scripts that happen to include ‘&’ for other reasons: SQL> insert into customers (customer_name) values (‘Marks & Spencers Ltd’); Enter value for spencers: old 1: insert into customers (customer_name) values (‘Marks & Spencers Ltd’) … Read more

Escaping ampersand character in SQL string

Instead of node_name=”Geometric Vectors \& Matrices” use node_name=”Geometric Vectors ” || chr(38) || ‘ Matrices’ 38 is the ascii code for ampersand, and in this form it will be interpreted as a string, nothing else. I tried it and it worked. Another way could be using LIKE and an underline instead the ‘&’ character: node_name … Read more

ORA-12514 TNS:listener does not currently know of service requested in connect descriptor

I had this issue and the fix was to make sure in tnsnames.ora the SERVICE_NAME is a valid service name in your database. To find out valid service names, you can use the following query in oracle: select value from v$parameter where name=”service_names” Once I updated tnsnames.ora to: TEST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS … Read more