Sql, sqlplus

[sqlplus] disable header in output result

If you use python and sqlplus, some times you need to get only the result and not the header of the colum.

Ex:

session = Popen(['sqlplus64', '-S', connection_string], stdin=PIPE, stdout=PIPE, stderr=PIPE)
str_cmd = """
            select CONTENT from {0}.xyz
            where DOCUMENT_ID like '{1}'; """.format(db_user, document_id)

the result is:

CONTENT
--------------------------------------------------------------------------------
row1=xxxxx
row2=yyyy

To avoid the header CONTENT do

session = Popen(['sqlplus64', '-S', connection_string], stdin=PIPE, stdout=PIPE, stderr=PIPE)
str_cmd = """
            set head off
            select CONTENT from {0}.xyz
            where DOCUMENT_ID like '{1}'; """.format(db_user, document_id)

the result is:

row1=xxxxx
row2=yyyy

see http://stackoverflow.com/a/13039070/4677155

Annunci
JAVA

[java] Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(…) returned error code 5.

To solve this type of error, to to this post http://stackoverflow.com/a/37896799/4677155

Or create a file (e.g. fix.reg) and put this content

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Prefs]

This work for windows 10, 64bit