celtician
asked on
Retreiving column names in Windows but not in Unix
Certain SQL sentences return a value, however, the SAME sentence, against the same database would return also the column (field) name by doing it in windows, and write out to the output file, and from unix it will not.
The SQL file is the same in both windows and unix
So i guess it has to do with environment? What environment variables or what should i do in order to get in unix also the output column names?
Thank you!!!
The SQL file is the same in both windows and unix
So i guess it has to do with environment? What environment variables or what should i do in order to get in unix also the output column names?
Thank you!!!
please post screen captures of a Windows cmd session using sql*plus and a Unix sh (or ksh,bash, etc) using sql*plus where both windows demonstrate the problem you are trying to describe.
Look for a glogin.sql or a local login.sql in the folder you are running the SQL scripts from.
Those can change sqlplus' environment.
http://docs.oracle.com/database/121/SQPUG/ch_two.htm#SQPUG337
Those can change sqlplus' environment.
http://docs.oracle.com/database/121/SQPUG/ch_two.htm#SQPUG337
ASKER
Sure, im trying to demonstrate this. When i run this code:
In windows i get this output (within a file)
set feedback off
col user for a25
select nvl(username,'???') USUARIO, count(*) SESIONES from v$session
group by nvl(username,'???');
set feedback on
In windows i get this output (within a file)
USER SESSIONS
------------------------- ----------
??? 23
AB3
SISTEMA 1
SOPORTE 2
SU 10
What does it look in in unix?
ASKER
Sorry i was trying to edit this, as i posted before i finished the unix part. this is what i get in unix:
The same ouput but with no column names (fields)
??? 23
AB 3
SYSTEM 1
SUPPORT 2
SB 10
The same ouput but with no column names (fields)
From each system post the results of (from inside sqlplus):
show all
Look for differences.
Look specifically for pagesize and heading. If there are differences, then something is setting them for you. That is likely a login.sql or a glogin.sql file.
show all
Look for differences.
Look specifically for pagesize and heading. If there are differences, then something is setting them for you. That is likely a login.sql or a glogin.sql file.
ASKER
Whre do i check for those differences?
In sqlplus a "show all" will return all the curent parameters set in the sqlplus environment.
There aren't that many. Can you not check them manually?
If you want you can spool them out and use some diff program.
SQL> spool myfile.txt
SQL> show all
SQL> spool off
That places all the output into a file in the current folder named myfile.txt. Change the names on both servers and compare them.
There aren't that many. Can you not check them manually?
If you want you can spool them out and use some diff program.
SQL> spool myfile.txt
SQL> show all
SQL> spool off
That places all the output into a file in the current folder named myfile.txt. Change the names on both servers and compare them.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
When i change that i dont see a change in the output file
it must be something else
it must be something else
Please post the complete output from a SHOW ALL on the Unix server.