Link to home
Start Free TrialLog in
Avatar of alsatham hussain
alsatham hussainFlag 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
Avatar of Sean Stuber
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
Avatar of alsatham hussain

ASKER

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

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you

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

One stores function calling here


Thanks
ASH