473,386 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

case, nvl and datetime fields

bon
I have a mssql view I am translating to oracle syntax

One of the lines in the mssql view is like this:
DATO=CASE (isnull(loandate,1)) WHEN 1 THEN 'N' ELSE 'Y' END

In other words, the view will return a Y if loandate has a value, N if
it does not have a value

How can I accomplish the same with Oracle9?
Jul 19 '05 #1
2 5866
VC
Hello,

DECODE(loandate, null, 'N', 'Y')

...or

case when loandate is null then 'N' else 'Y' end

Rgds.
"bon" <ma*********@hotmail.com> wrote in message
news:c7**************************@posting.google.c om...
I have a mssql view I am translating to oracle syntax

One of the lines in the mssql view is like this:
DATO=CASE (isnull(loandate,1)) WHEN 1 THEN 'N' ELSE 'Y' END

In other words, the view will return a Y if loandate has a value, N if
it does not have a value

How can I accomplish the same with Oracle9?

Jul 19 '05 #2
bon
"VC" <bo*******@hotmail.com> wrote in message news:<rqoBb.347574$ao4.1164423@attbi_s51>...
Hello,

DECODE(loandate, null, 'N', 'Y')

..or

case when loandate is null then 'N' else 'Y' end

Rgds.


Thanks

I actually did find out a way to do it eventually, but unlike you I
complicated it more than necessary...
(if you are good at reading between the lines, you probably realize
now my real problem was with conflicting data types in my original
attempt to translate it)

CASE nvl(loandate,to_date(NULL)) WHEN to_date(NULL) THEN 'N' ELSE 'Y'
END
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: fowlertrainer | last post by:
Hi ! I think that I have been found a bug in mx.DateTime... So: I use FireBird, and in this RDBMS the datetime fields are "doubles". So if I set them to 0, the values the fields are '1899-12-30...
7
by: Eddy | last post by:
I have to check whether a given date is between a day and a month. A guided tour is only scheduled from november 1st until april 1st. when i want to make a reservation for the tour Today the query...
2
by: JTWhaler | last post by:
I'm looking for an efficient t-sql script to loop through all user tables in a db and determine/print the value of each row having a datetime field (including cases where there are multiple...
11
by: jguilford | last post by:
I have created a SQL Stored Procedure that uses a Case statement to determine the Order By. For one of the Case statements I am trying to turn a Char field into Datetime in for the Order By,...
2
by: Manfred Braun | last post by:
Hi All, I am on listing a class's fields with reflection and I have to handle fields which are array of type DateTime . I cannot get this to work and I get an unexpected run-time exception: ...
2
by: rdraider | last post by:
Hi, We have a lame app that uses 2 datetime(8) fields, 1 stores the date, the other the time. example query: select aud_dt, aud_tm from orders results: aud_dt ...
5
by: iulian.ilea | last post by:
Is correct to have a varchar field and insert dates of type dd/mm/yyyy into it? I choose this method because I have an application that runs on more than one server. So, if I used a datetime field...
7
by: TheLostLeaf | last post by:
DateTime tTime = DateTime.Now; ------------------------------------------------------------------------------------------- tTime returns "1:59:00 PM" it never returns seconds. Database field...
7
by: billygotee | last post by:
Hi, Okay this is taking longer to figure out than I thought it would. The integer members of a DateTime (such as DateTime.Minutes, DateTime.Seconds, etc.) can only get the value, not set it. ...
2
by: Andy B | last post by:
I have a few questions about xml, DateTime conversions and DateTime fields. 1. in the example of DateTime.Now, how would you save it in the format yyyy-mm-ddThh:mm:ssZ for xml storage? 2. If I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.