SQL & PL/SQL :: Mapping User Defined Object Types On REMOTE Databases
Dec 2, 2010
I need to transfer PL/SQL or NESTED table from LOCAL database to REMOTE.I need to be able to use that transfered table in SELECT statement.I tried:
--ON LOCAL
SELECT SYS_OP_GUID() FROM DUAL;
--966D2DFEAEEB80D6E0430A0166CB80D6
create or replace type varchar_number_oid OID '966D2DFEAEEB80D6E0430A0166CB80D6' as object (
v varchar2(10),
i number);
/
Type created
SELECT SYS_OP_GUID() FROM DUAL;
--966D2DFEAEFB80D6E0430A0166CB80D6
[code]....
I tried using PL/SQL types it worked, but then i have a problem that i can not use local collection in SQL.
View 2 Replies
ADVERTISEMENT
Jul 5, 2013
I have a two different Databases. I created a db link in DB 1 to connect to DB 2 and it is working fine when I select data from any table. but I have one table in the DB2 which has a column with user defined data type . so when I try to select this column from DB 2 by using the DB link it gives me this error :ORA-22804 remote operations not permitted on object tables or user-defined type columns.
View 1 Replies
View Related
Jun 22, 2010
I am migrating sybase to oracle database. A Java developer needs money datatypes.I said to them, please change the cast(<value> as number(19,4) in java code side. but they are not accepted because money data type is used most of the places.
select cast(0 as money) from bank_trans; this sql statements present in java code. I need to create user defined type is equivalent to money datatype.
My steps
I have create user defined data types
create or replace type money as object(money as numbeer(19,4)
select cast(0 as money) from dual;
it shows inconsistent datatypes error.
create or replace type money is table of numbeer(19,4);
select cast(0 as money) from dual;
it shows inconsistent datatypes error.
View 10 Replies
View Related
May 9, 2003
I am having a OCCI problem, I try to retrieve a collection of user-define objects.
The major steps I am using are
1. define database object
CREATE OR REPLACE TYPE my_obj_t AS OBJECT
( id number, name varchar2(10) )
CREATE OR REPLACE
TYPE my_obj_tab_t as table of my_obj_t;
2. A stored procedure return a collection as out paramerter
my_stored_procedure(obj_list out my_obj_tab_t);
3. Using OTT to generate the *.cpp and header files.
4. Register out parameter like
vector<my_obj_t> vect;
stmt->registerOutParam(1, OCCIVECTOR,
sizeof (vect),
"MY_OBJ_TAB_T");
5. stmt->execute();
6. Try to get the results by
getVector(stmt, 1, vect);
I am getting compilation error:
Could not find a match for
oracle::occi::getVector(oracle::occi::Statement*,
int, std::vector<my_obj_t, std::allocator<my_obj_t>>).
Am I doing the right things ?What steps and function should I use ?
View 1 Replies
View Related
Sep 26, 2012
While practicing with Triggers, the following error was encountered. An Object Type and an object Table are created.
create or replace
type typPerson is object
(id number,
firstname varchar2(30),
lastname varchar2(30)
[code].........
I executed the below insert statement, and I got the following error.
SQL> insert into person_obj_tab values (10,'Object1','From Trigger');
insert into person_obj_tab values (10,'Object1','From Trigger')
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 4153
Session ID: 136 Serial number: 305
[code]......
SQL> insert into person_obj_tab values (10,'Object','Original');
1 row created.Question:
1) Trigger of version 1 did not report any error during compilation, but during DML execution, hangs for sometime and gives the above error.
2) Whether direct assignment of Objects of greater size is possible inside triggers built on object Tables?
3) Suppose an object contain multiple attributes (say more than 20), then how to assign them inside a trigger?
View 1 Replies
View Related
Aug 31, 2011
We are trying to use the methods/constructors in the object types and find it more similar to the procedures and functions in the packages. I am wondering how they are different from stored procs and functions and what are the advantages?
View 2 Replies
View Related
Mar 3, 2012
how to display REFS from within a REF. I've not used my exact code here as its quite a big file so i've made a similar scenario to get me point across. Here is the code first:
1 CREATE OR REPLACE TYPE object1 AS OBJECT (
2 object_id NUMBER(5),
3 object_name varchar2(10),
4 object_added DATE);
5 /
6 CREATE TABLE object1_tab OF object1 (object_id PRIMARY KEY);
7 /
8 INSERT INTO object1_tab
9 VALUES (1,'Daniel',sysdate);
10 /
11 show errors;
12 /
13 CREATE OR REPLACE TYPE object2 AS OBJECT (
14 object_id NUMBER(5),
15 object_job varchar2(10),
16 object1_ref REF object1 );
17 /
18 CREATE TABLE object2_tab OF object2(object_id PRIMARY KEY);
19 /
20 INSERT INTO object2_tab
21 VALUES (1,'Developer',(SELECT REF(p) FROM object1_tab P
22 WHERE VALUE(p).object_id = &object_id));
23 /
24 select DEREF(object1_ref)
25 FROM object2_tab;
26 /
27 CREATE OR REPLACE TYPE object3 AS OBJECT (
28 object_id NUMBER(5),
29 object_location VARCHAR2(20),
30 object2_ref REF object2);
31 /
32 CREATE TABLE object3_tab OF object3 (object_id PRIMARY KEY);
33 /
34 INSERT INTO object3_tab
35 VALUES (1,'New York',(SELECT REF(p) FROM object2_tab P 36 WHERE VALUE(p).object_id = &object_id));
37 /
38 show errors;
39 /
40 select object_id,object_location,DEREF(object2_ref)
41 FROM object3_tab;
42 /
As yot can see in the code each object refernces from the previous. When I view the DEREF in the third table (object3_tab) i get the following output:
OBJECT_ID OBJECT_LOCATION DEREF(OBJECT2_REF)
--------- -------------------- ----------------------------------
1 New York [SANTA.OBJECT2]
Contained within the object2 is the following:
SANTA.OBJECT2(1,'Developer','oracle.sql.REF@c4cb4aa6')
How would i view the ref for object1 within object3? I will also need to be able to verify the data in these REF in the new table they are used in.
View 3 Replies
View Related
Oct 17, 2013
I am using 11.2 DB. I have created 2 object types. The contact_t has been embedded into the student_t object and I have created a view with the nested object.How do you select the values from the contact_t object type in SQL from the view? i want to see the values of the contact_t object in speerate fields (ie. contact_name, city, state...)
CREATE OR REPLACE TYPE contact_t AS OBJECT ( dcid NUMBER(10), contact_name VARCHAR2(50), city VARCHAR2(50), state VARCHAR2(10), zip VARCHAR2(10), email VARCHAR2(100) )
CREATE OR REPLACE
[Code]....
View 2 Replies
View Related
Oct 16, 2006
i have flash item on canvas weh nthe nw form insatance i have that erros frm 41344 ole object not defined
View 5 Replies
View Related
Aug 5, 2013
How can I reference an Object Type created on a remote database?This is the escenario:
In DATABASE A: CREATE OR REPLACETYPE USERA.EXPO_EXPEDIENTES_RECAUDOS OID 'DCADCB2EA2344DFAB1D205C03D708359' AS OBJECT ( exer_cd_expediente VARCHAR2 (50), exer_id_ident_expediente VARCHAR2 (30), exer_cd_sucursal NUMBER (3), exer_cd_ramo NUMBER (2), exer_nu_poliza NUMBER (7), exer_nu_certificado NUMBER (9), exer_nu_contrato NUMBER (7), exer_cd_nacionalidad VARCHAR2 (1), exer_nu_cedula_rif NUMBER (9), exer_nm_titular VARCHAR2 (70), exer_st_expediente VARCHAR2 (2), exer_de_status_exp VARCHAR2 (240), exer_fe_status_exp DATE, exer_cd_productor NUMBER (5), exer_nm_productor VARCHAR2 (60), exer_cd_mail_productor VARCHAR2 (50), exer_in_habilitado VARCHAR2 (1), exer_in_permite_habilitar VARCHAR2 (1), exer_in_carga_consulta VARCHAR2 (1), exer_cd_ramo_aplicacion VARCHAR2 (200), exer_cd_producto VARCHAR2 (6) )/ In DATABASE B:
After creating the public synonym and asigning the required privileges on the object in DATABASE A, I try to execute the following:
DECLARE x EXPO_ EXPEDIENTES_RECAUDOS;BEGIN null;END;
But i got the following error:
ORA-06550: line 2, column 12:PLS-00331: illegal reference to
USERA. EXPC_ EXPEDIENTES_RECAUDOS@DATABASEA
After investigating a little i found the following, but i dont know how to apply it, "The CREATE TYPE statement has an optional keyword OID, which associates a user-specified object identifier (OID) with the type definition. It should be used by anyone who creates an object type that will be used in more than one database."
View 4 Replies
View Related
Feb 16, 2010
As a part of requirement need to clean up some of database objects from database. Before cleaning up need to check for dependencies with in database and also on remote database.
Is there any data dictionary in oracle which proivides information about remote dependencies.
Any other way to get a list of remote dependencies other then manual checking.
View 3 Replies
View Related
Jul 18, 2012
Does it possible to pass object (or) table as an argument to a remote procedure?
View 2 Replies
View Related
Mar 25, 2013
I have two databases (say DATABASE 1 with user USER1 with table A and DATABASE2 with user USER1 with table A). I want to select the table A in USER1 DATABASE2 from DATABASE1 USER1.
View 5 Replies
View Related
Jun 19, 2012
I am trying to create a new data type but keeping getting a ORA-0902 invalid data type error. I am using the example show at:
Guess I cannot post a link until I have posted more than 5 messages so here is the link another way:
www(dot)psoug.org/reference/type.html
Specifically, all the steps work up to Create Table which fails with the error.
By work -- I mean the type gets created & the 3 select statements prior to Create Table confirm the existence of the ssn_t data type.
View 5 Replies
View Related
Jul 24, 2011
We have an application with many separate databases (one per customer). Given they share the same business requirements (service hours, change mgmt etc), we're interested in potentially consolidating the separate DBs (which are relatively small) into separate schemas within a fewer no of databases to reduce the overhead.
Our issue is that the application is hard-coded to use a specific administrator and application connection user name. Changing this is unfortunately not an option.
Given this limitation, is there any possibility to map a generic user into a customer-specific schema based on the database service that they connect to? Each customer connects to different database services but may use the same user name. We considered using private synonyms but this seems to acheive the opposite (i.e. many different users could connect and map to a single users schema). One thing to point out is that where there is a single user name, it is acceptable for a single password to be used across the different customer DBs as they will be a single admin/user.
View 5 Replies
View Related
Jun 19, 2012
I am trying to create & use a new data type but keep getting a ora-0902 invalid data type error running on 10g express. The create type and select statements execute fine and select confirms the ssn_t is a type. The create table statement fails with the invalid data type error.
Here is an example.
CREATE TYPE ssn_t AS OBJECT ssn_type CHAR(11));
SELECT object_name, object_type
FROM user_objects WHERE object_type = 'TYPE';
CREATE TABLE Z (A CHAR(4), B SSN_T);
View 14 Replies
View Related
Oct 13, 2009
That is I have created the User Defined Data Type as following. CREATE OR REPLACE TYPE Bit_Type AS OBJECT(Bit NUMBER(1,0));
After completing this creation of new UDT, I am trying to create the table with this UDT as follows, CREATE OR REPLACE TABLE Sample_Bit ( RegID Bit_Type);
I received an Error Message like:
SQL Error: ORA-22913: must specify table name for nested table column or attribute
22913. 00000 - "must specify table name for nested table column or attribute"
*Cause: The storage clause is not specified for a nested table column or attribute.
*Action: Specify the nested table storage clause for the nested table column or attribute.
View 1 Replies
View Related
Dec 28, 2010
Is it possible to easily set up a single User Defined Metric, to monitor all the users quotas? I know I can do it, if I make individual metrics for each user. But was hoping there was a simple way of combining them all into a single metric.
I am using Oracle 10G2 Standard Edition on a windows 2003 Server.
View 1 Replies
View Related
Jun 29, 2011
I'm calculating a Z score based on some simple numerical data thus:
create table t (id number, val number);
insert into t values(1, 1795);
insert into t values(2, 1753);
insert into t values(3, 1743);
insert into t values(4, 1876);
insert into t values(5, 1848);
[Code] .....
the logic is quite simple - calculate a moving average over the previous 12 rows, and a stdev over the same window. Then subtract the prior row's moving average from the current value, and divide by the prior row's stdev.
The issue is I want to expose this logic in a BI tool (OBI EE v10g), meaning I can't use the nested analytic functions. How to achieve this logic in a single analytic pass? The sql above took about 2 minutes to write this morning, then I've spent all day looking at user-defined aggregate functions, but haven't even been able to get the first step, the moving average, working. I can understand that I can probably create an udaf to replicate the avg(val) over (order by id ROWS BETWEEN 11 PRECEDING AND 0 FOLLOWING) functionality, but I can't see how to bundle the logic for the other three steps in the calculation into this.
From what I've read, the ODCIAggregateMerge should allow me to combine different threads that can return the different values I need for the current row calculation. Is this correct?
The only example udafs I can find are either not relevant (STRAGG) or very simple (ie don't appear to invoke multiple passes). I've also had a look at the COLLECT function, but again I can't see a way to use this.
View 6 Replies
View Related
May 3, 2011
I have designed a Login form which takes username, password and connect string is hardcoded.I have compiled it, made an fmx file. created a shortcut to desktop. given the BIN path in shortcut.
when i want to lauch it, oracle's default login popup is shown.It can be by passed while defining username/password@string in shortcut properties but it reveals the password. every one can access it. I want to launch my own form without logging in to oracle. how can i avoid default login popup?
View 8 Replies
View Related
Jan 25, 2011
Can we able to declare a user define exception name as per defined exception name?Ex: we have predefined exception called :"NO_DATA_FOUND "
Now in my PL/SQL block can i able to declare "NO_DATA_FOUND" like
Begin
no_data_found exception;
//statements
raise no_data_found;
end
View 6 Replies
View Related
Apr 12, 2012
I have made a function to add two number create or replace function add_num(a in number, b in number) return number
as
begin
return a+b;
end;
/
i run it via
select add_num(2,5) from dual;
my question is how to call add_num in procedure.
View 9 Replies
View Related
Jan 12, 2012
If a user defined function in Oracle may throw and catch exceptions depending on input, now does the Oracle logs the exception? Fundamentally we are asking if Oracle logs any random DML errors (not bulk operation). We hope not, as we do not want our client DBA get concerned. There might be many levels of settings in Oracle to log or not log. So if Oracle may log it depending on setting, how do we suppress it either at Oracle specific schema level, or function level?
This is my user defined function:
create or replace FUNCTION ISNUMERIC(char_in CHAR) RETURN NUMBER IS
n NUMBER ;
BEGIN
n := TO_NUMBER(char_in);
RETURN 1;
EXCEPTION
WHEN OTHERS THEN
RETURN 0;
END;
View 2 Replies
View Related
Aug 25, 2012
Through sql*plus, how can I copy a user-defined type from other schema to mine?
I've granted the execute object privilege over the user-defined type to my user, so I can use the type.
I know I can manually write and create the type, but I wanna learn (if exist) a statement to copy the user-defined type, something like:
CREATE TABLE x2 AS
(SELECT *
FROM x1);
I'm testing ORACLE DATABASE 11g R2 over Windows O. S.
View 3 Replies
View Related
Nov 25, 2012
How can I apply a user metric for DB (single database) using a script or cli?
clear my question:
Can I create a User Defined Metric using SQL code, and not via the graphical interface?
View 1 Replies
View Related
Dec 18, 2010
I'm attempting configure User-defined Metric to send mails when happen warning or critical alerts .My environment is Cluster Database and I'm using OEM Grid Control
I created User-defined Metric for monitoring invalid object for example and scheduled this collect to every 5 minutes.On initial OEM page, I see alert violation, but don't receive mail for this. In my Notification Rules page, I added "User-Defined Numeric Metric" and includes object Check_Invalid_Objects, wich is my UDM.I receive several alerts violations, but don't UDM.
UDM_Violation.png ( 116.68K )
Number of downloads: 0
NotificationRule.jpg ( 218.78K )
Number of downloads: 0
ScheduleNotification.jpg ( 373.64K )
Number of downloads: 0
View 6 Replies
View Related
Sep 7, 2012
how to define user defined exceptions for cases like, ==> when anyone tries to insert string values without using single quotation marks " '...' "? ==> update the column which is not present in table.
how can I define user defined exceptions for such cases?
View 3 Replies
View Related
Sep 26, 2012
In one of the interviews , I have attended the guy asked me to write a user defined function which will take the column name and list all the values .
For example
Table Name:Employees
Column Name: Employee_Name
Employee_name
Scott
Ivgun
Jack
Shane
The query should be in this fromat
SELECT col_agg(Employee_name) emp_name from Employees;
The output should be
Emp_names
scott,ivgun,jack,shane
View 6 Replies
View Related
Sep 24, 2012
Is it Possible to create User - defined Search forms in runtime oracle forms 6i . If One Having sample Forms
View 1 Replies
View Related
Dec 19, 2011
Is it possible to hide/suppress an user defined alert message in Oracle Forms application?
View 1 Replies
View Related