Oracle store procedure dies not work

I have a strange problem..

On Oracle 11gR2 database I have a stored procedure (inside a package):
Procedure MyProd(CoreID         In Varchar2);

The body of the procedure has this UPDATE statement:

    UPDATE MyTab
       SET myid = CoreID

The procedure (in package) compiles and runs -- no errors. But it does not Update the table.

But If I change the above to:
Procedure MyProd(Core_ID         In Varchar2);
And The body :

    UPDATE MyTab
       SET myid = Core_ID

It Works.

I tried is numerous times and it is working this strange.
"CoreID" does not seem to be a reserved work in Oracle. It's strange why it is happening.
I need to keep the input parameter as Core_ID as it is called that way in the front-end code and I cannot change that easily..
Is there any other reason that could cause the issue.?

Who is Participating?
slightwv (䄆 Netminder) Commented:
Does the table maybe have a column called coreid?

If not, there may be some other object with that name that is confusing things.  Maybe another function in the package?
toookiAuthor Commented:
Thank you...
Yes the table on which UPDATE is made has a column named "coreid" ... That is the reason then!! Can I still use that parameter name (same as one of the table column names).?
slightwv (䄆 Netminder) Commented:
Off the top of my head I cannot remember if I have ever seen a way around this but that is the reason.

It is a bad coding practice to mix and match variable and object names.  You should have a naming convention of some type.

For example 'variables' start or end with v_ or _v.
toookiAuthor Commented:
Thank you. I think what you suggested in the right way -- so will do.
Thanks again.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.