Avatar of alsatham hussain
alsatham hussain
Flag for India asked on

Migration from sql server to oracle

Hi
I have converted one sample procedure (SQLserver) to oracle.
Kingly suggest me if this conversion is fine or whether need to change ?

I greatly appreciate your help. I am grateful to you for this since I have no knowledge of SQL SERVER
Thank you again,
With kind regards,
ASH
SQL_SERVER_sample_procedure.docx
Oracle-conversion.docx
Oracle Database

Avatar of undefined
Last Comment
alsatham hussain

8/22/2022 - Mon
Sean Stuber

These conditions won't work in Oracle as you intend

If v_FromDt = ''  THEN
ELSIF v_ToDt = '' THEN


A zero-length string is NULL in oracle and you can't check for null with an equality.
Instead write them like this...


If v_FromDt IS NULL THEN
ELSIF v_ToDt IS NULL THEN


Also in Oracle, you don't put column names inside brackets.
If you must use mixed case columns and/or columns with spaces in the names, then put the names in double quotes
For example
Instead of   [Bank Address]  you would use "Bank Address"


I'm not sure what you were trying to do here...

dbo.LON_RPT_fnDayOrderedColln (v_BrID, v_PrdID, v_FromDt, v_ToDt)

If you are using 12c, you can have procedures that return result sets, but that is not normal coding for Oracle
alsatham hussain

ASKER
Thank you for spending few minutes
thanks for your time ( thanx, thanx,,,,,)
thank you.
ASKER CERTIFIED SOLUTION
Sean Stuber

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
alsatham hussain

ASKER
Thank you

ASH
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
alsatham hussain

ASKER
dbo.LON_RPT_fnDayOrderedColln (v_BrID, v_PrdID, v_FromDt, v_ToDt)

One stores function calling here


Thanks
ASH