Home » SQL & PL/SQL » SQL & PL/SQL » Same source code giving different results (Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production)
Same source code giving different results [message #596467] Mon, 23 September 2013 11:18 Go to next message
manubatham20
Messages: 432
Registered: September 2010
Location: Champaign, IL
Senior Member

Hi,

While I was debugging the code of already existing application (Oracle apps fnd_global package), I copied a package to make changes in it.

It was strange that with Original package fnd_global I am getting below error when I call it over database link:

"ORA-20001: Oracle error -20001: ORA-20001: Oracle error -2074: ORA-02074: cannot SET NLS in a distributed transaction
 has been detected in fnd_global.set_nls.set_parameter('NLS_LANGUAGE','AMERICAN').
 has been detected in fnd_global.set_nls."

PACKAGE CALLS ARE AS FOLLOWS:

Database 1 (Oracle Apps LSH module)
 CUSTOM procedure to call CDR_PUB_API_GVA
  has CDR_PUB_API_GVA
   INITIALIZATION BLOCK OF CDR_PUB_API_GVA CALLS Fnd_Global.apps_initialize (when copied to fnd_global1, then it's call don't throw any error)

Database 2 (External application)
 has dblink to Database1
  calls custom procedure over dblink


While the copied package is not throwing any error (I copied fnd_global to fnd_globa1).

I am not sure why... does anybody know what may be the reason behind it?

Let me know in case any other detail required.

Thanks,
Manu
Re: Same source code giving different results [message #596468 is a reply to message #596467] Mon, 23 September 2013 11:25 Go to previous messageGo to next message
BlackSwan
Messages: 21951
Registered: January 2009
Senior Member
>I am not sure why... does anybody know what may be the reason behind it?
different results occur when some input/condition is different.

Only you can compare & contrast between the two since we can't access you system


Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/

icon13.gif  Re: Same source code giving different results [message #596470 is a reply to message #596467] Mon, 23 September 2013 11:31 Go to previous messageGo to next message
Michel Cadot
Messages: 57613
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

ORA-02074: cannot %s in a distributed transaction
 *Cause: A commit or rollback was attempted from session other than
           the parent of a distributed transaction.
 *Action: Only commit or rollback from the parent session.


Re: Same source code giving different results [message #596471 is a reply to message #596470] Mon, 23 September 2013 11:56 Go to previous messageGo to next message
manubatham20
Messages: 432
Registered: September 2010
Location: Champaign, IL
Senior Member

Blackswan,

Both package source codes and inputs/outputs are same.

Michel,

How come the other package (ditto/copied package source code) is not giving any error?

What should I investigate?

Thanks,
Manu

[Updated on: Mon, 23 September 2013 11:57]

Report message to a moderator

Re: Same source code giving different results [message #596472 is a reply to message #596471] Mon, 23 September 2013 12:01 Go to previous messageGo to next message
BlackSwan
Messages: 21951
Registered: January 2009
Senior Member
Problem Exists Between Keyboard And Chair.

When everything is really the same, then results are the same.
When results are different, by definition SOMETHING is different!
Re: Same source code giving different results [message #596473 is a reply to message #596472] Mon, 23 September 2013 12:19 Go to previous messageGo to next message
manubatham20
Messages: 432
Registered: September 2010
Location: Champaign, IL
Senior Member

I agree Blackswan.

I compared source codes, input parameters and permissions.

What else I should look into.

Thanks,
Manu
Re: Same source code giving different results [message #596474 is a reply to message #596473] Mon, 23 September 2013 12:22 Go to previous messageGo to next message
BlackSwan
Messages: 21951
Registered: January 2009
Senior Member
http://www.orafaq.com/forum/mv/msg/189608/596470/#msg_596470
icon2.gif  Re: Same source code giving different results [message #596482 is a reply to message #596471] Mon, 23 September 2013 12:45 Go to previous messageGo to next message
Michel Cadot
Messages: 57613
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
What should I investigate?


Remove all WHEN OTHERS
Re: Same source code giving different results [message #596848 is a reply to message #596482] Thu, 26 September 2013 13:15 Go to previous message
manubatham20
Messages: 432
Registered: September 2010
Location: Champaign, IL
Senior Member

Hi Michel,

Solved above error through setting up nls parameter in source database itself using trigger in source db.

I am making a entry in a table from remote database, and instead setting nls parameter from remote db, trigger will execute and set it in source db.

Thanks,
Manu
Previous Topic: How to get first Word from string
Next Topic: Problem with Collection
Goto Forum:
  


Current Time: Sun Apr 20 11:28:45 CDT 2014

Total time taken to generate the page: 0.10410 seconds