Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alter Session

Status
Not open for further replies.

jcs1953

IS-IT--Management
Nov 28, 2007
53
US
I have a website in asp.net that uses queries to pull data from MSSQL and Oracle 10g and combine the data into one table. What I am having trouble with is date formats. The date format has to be the same for both the data retrieved from Oracle and MSSQL. MSSQL returns the date as mm/dd/yyyy through the query. Oracle returns as dd-mon-rr. I can format the date in Oracle as a string in the proper order but then it's no longer a date. I happened upon the "alter session set nls_date_format = 'mm/dd/yyyy'" which seems to work. My questions are:
1. Is there any downside to doing this? I understand that this only stays modified as long as I am logged in and doesen't affect anyone else. I have a read only access to the database.
2 Can I combine an alter statement and a select statement? The reason I ask is that in my asp.net code the database connection is closed after each query.
 
JCS,

Your question 1: No downsides. Correct, such a change has no effect on anyone else.

Your question 2: You may certainly create consecutive statements: "ALTER SESSION..." then "SELECT...", but there is no syntax to combine the two into a single construct.

Let us know if you have follow-on questions.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top