473,383 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Using the same type in 2 instance

Hi,
On my first oracle instance, I have a global type 'productarray'
(CREATE OR REPLACE TYPE productarray AS TABLE OF VARCHAR(30)), I have
a package procedure having myArray OUT productarray as parameter.
No problem to manage this OUT parameter from a function or procedure
in the same instance, even if schemas are different.
But if I try to use this package procedure from procedure in another
instance, I have the error :
PLS-00306 : wrong number or types of arguments in call of
'myfunction'.

the strict same global type has been created in both instances and the
package 1 is visible in instance 2 via a synonym, user 2 has execute
right on package 1.

Anyone has an idea about what is wrong ?

Thanks a lot.

Stephane
Jul 19 '05 #1
3 4708
Jan
If you want to call a procedure on DB_2 from DB_1, try this:

1) Create types in each database, say in DB_1 - my_type_1, in DB_2 - my_type_2

2) In DB_2, you will have a procedure P_2

--------------------
CREATE OR REPLACE PROCEDURE P_2 (p_out OUT my_type_2)
IS

BEGIN
.... some processing

END P_2;
--------------------

3) then in DB_1, you will have a procedure

CREATE OR REPLACE PROCEDURE P_1 (p_out OUT my_type_1)
IS

l_out_2 DB_2@my_type_2;

BEGIN

p_2@DB_2(l_out_2); -- calling the procedure on DB_2 with the parameter
-- referenced to my_type_2@DB_2

-- if your types e.g. associative arrays, then loops through it, you
-- should add also checks if l_out_2 is not empty

FOR i IN l_out_2.FIRST .. l_out_2.LAST LOOP
p_out(i):=l_out_2(i);
END LOOP;

END P_2;


kl***********@netscape.net (Steph) wrote in message news:<e0**************************@posting.google. com>...
Hi,
On my first oracle instance, I have a global type 'productarray'
(CREATE OR REPLACE TYPE productarray AS TABLE OF VARCHAR(30)), I have
a package procedure having myArray OUT productarray as parameter.
No problem to manage this OUT parameter from a function or procedure
in the same instance, even if schemas are different.
But if I try to use this package procedure from procedure in another
instance, I have the error :
PLS-00306 : wrong number or types of arguments in call of
'myfunction'.

the strict same global type has been created in both instances and the
package 1 is visible in instance 2 via a synonym, user 2 has execute
right on package 1.

Anyone has an idea about what is wrong ?

Thanks a lot.

Stephane

Jul 19 '05 #2
I did a mistake : I have the same error when I try to call this
package function since another schema of the same instance.
So my problem remains
Jul 19 '05 #3
kl***********@netscape.net (Steph) wrote in message news:<e0**************************@posting.google. com>...
Hi,
On my first oracle instance, I have a global type 'productarray'
(CREATE OR REPLACE TYPE productarray AS TABLE OF VARCHAR(30)), I have
a package procedure having myArray OUT productarray as parameter.
No problem to manage this OUT parameter from a function or procedure
in the same instance, even if schemas are different.
But if I try to use this package procedure from procedure in another
instance, I have the error :
PLS-00306 : wrong number or types of arguments in call of
'myfunction'.

the strict same global type has been created in both instances and the
package 1 is visible in instance 2 via a synonym, user 2 has execute
right on package 1.

Anyone has an idea about what is wrong ?

Thanks a lot.

Stephane


Steph, I do not think you want to create the same type in both
instances. Doing so would not guarentee to Oracle that the two
objects matched. I believe what you want to do is reference the same
type definition from both instances. You normally define the base
type in a package specification and then reference this, %type, when
you allocate and pass the array. Try it that way.

If this change does not eliminate your problem then when you repost
please include the actual Oracle error message and matching code
pieces to increase the odds someone will be able to spot the problem.

HTH -- Mark D Powell --
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Pure Krome | last post by:
How do i serialize two instances (of some object) in the same class? I'm not sure how i would de-serialize a class that has two or more instances of some object type, and how the deserialize...
9
by: Andrew | last post by:
It seems that in C#, given an instance "a" of some value type "A", one can pass a by reference to functions with signatures of either "void f(object obj)" or "void g(ref A obj)". But passing a into...
6
by: crook | last post by:
I have code below and it works properly but when I'm compiling it with "--pedantic" flag, GCC(3.4.2) shows such warning: "ISO C forbids casting nonscalar to the same type". How can I change this...
5
by: tarnap | last post by:
Hello, I have an instance of a form, lets say formA. This form is passed to a method that must create a new form, lets say formB of the same type. How can this be accomplished except by using...
1
by: batista | last post by:
Hello all, I have a DLL, created using VC7 and that DLL is to be used by two EXEs.... I need to know, whether it is possible load the DLL only once, so that the same instance is used by both...
15
by: shuisheng | last post by:
Dear All, Assume I have a class named Obj. class Obj { }; And a class named Shape which is derived from Obj. class Shape: public Obj
2
by: =?Utf-8?B?VmFubmk=?= | last post by:
Hello, I have the requirement of being able to load different versions of the same type (same class name) in the executing AppDomain. I am aware that I would not be able to unload obsolete...
3
by: Steph | last post by:
Hi, On my first oracle instance, I have a global type 'productarray' (CREATE OR REPLACE TYPE productarray AS TABLE OF VARCHAR(30)), I have a package procedure having myArray OUT productarray as...
1
by: Felix T. | last post by:
I have a class called Interval(type.ObjectType) that is supposed to mimic closed mathematical intervals. Right now, it has a lot of methods like this: def __add__(self,other): if type(other) in...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.