We help IT Professionals succeed at work.

Migration from sql server to oracle

alsatham hussain
on
158 Views
Last Modified: 2017-03-20
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
Comment
Watch Question

Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
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 hussainOracle developer

Author

Commented:
Thank you for spending few minutes
thanks for your time ( thanx, thanx,,,,,)
thank you.
Database Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
alsatham hussainOracle developer

Author

Commented:
Thank you

ASH
alsatham hussainOracle developer

Author

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

One stores function calling here


Thanks
ASH

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions