Modeling tables with objects from Sys Schema
I want to model some tables that have Object Columns of type AnyData.
Problem is I can't model them in Designer without screwing up generation.
If I create an AnyData object in Designer it gets created in my Schema and the table points to that AnyData instead of the Sys.AnyData.
How can this be resolved?
I have above mention script utlrp.sql many times it is going into loop and unable to compile below 6 objects
select owner,object_name ,count(*) from dba_objects where status='INVALID' Group by owner,object_name
OWNER OBJECT_NAME COUNT(*)
SYS DBMS_IJOB 1
SYS DBMS_DEFER 1
SYS DEFLOB 1
PUBLIC DEFLOB 1
SYS DBMS_DEFER_SYS 1
SYS DBMS_DEFER_SYS_PART1 1
6 rows select
Kindly check above invalid objects. I am unable to copile.
**Kindly tell me the procedure how can I compile manually**.
Regards.
Muzafar
Similar Messages
-
How can I fill a table of objects from cursor with select * bulk collect???
Hi All, I have a TYPE as OBJECT
create or replace type dept2_o as object (
deptno NUMBER(2),
dname VARCHAR2(14),
loc VARCHAR2(13));
I can fill a table of objects from cursor with out select * bulk collect...., row by row
declare
TYPE dept2_t IS TABLE of dept2_o;
dept_o_tab dept2_t:=dept2_t();
i integer;
begin
i:=0;
dept_o_tab.extend(20);
for rec in (select * from dept) loop
i:=i+1;
dept_o_tab(i):=dept2_o(
deptno => rec.deptno,
dname => rec.dname,
loc =>rec.loc
end loop;
for k IN 1..i loop
dbms_output.put_line(dept_o_tab(k).deptno||' '||dept_o_tab(k).dname||' '||dept_o_tab(k).loc);
end loop;
end;
RESULT
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
But I can't fill a table of objects from cursor with select * bulk collect construction ...
declare
TYPE dept2_t IS TABLE of dept2_o;
dept_o_tab dept2_t:=dept2_t();
begin
dept_o_tab.extend(20);
select * bulk collect into dept_o_tab from dept;
end;
RESULT
ORA-06550: line 6, column 39;
PL/SQL: ORA-00947: not enough values ....
How can I fill a table of objects from cursor with select * bulk collect???create or replace type dept_ot as object (
deptno NUMBER(2),
dname VARCHAR2(14),
loc VARCHAR2(13));
create table dept
(deptno number
,dname varchar2(14)
,loc varchar2(13)
insert into dept values (10, 'x', 'xx');
insert into dept values (20, 'y', 'yy');
insert into dept values (30, 'z', 'zz');
select dept_ot (deptno, dname, loc)
from dept
create type dept_nt is table of dept_ot
declare
l_depts dept_nt;
begin
select dept_ot (deptno, dname, loc)
bulk collect
into l_depts
from dept
for i in l_depts.first .. l_depts.last
loop
dbms_output.put_line (l_depts(i).deptno);
dbms_output.put_line (l_depts(i).dname);
dbms_output.put_line (l_depts(i).loc);
end loop;
end;
/ -
Count total number of record of table with deletion from archiving object
Does anyone know is there any SAP standard program to count the total number of record of the table with deletion from Archiving Object and display in repprt?
Not sure of the question. Are you looking to get the sql "select count(*) from table" from using the TopLink expression framework or are you getting that SQL already and want something else?
If you are looking just to get the count from a table/class, you can use a ReportQuery:
ReportQuery rquery = new ReportQuery(ClassToQueryOn.class);
rquery.addCount(); //equivalent to count(*);
session.executeQuery(rquery);
You can use a report query to return data instead of objects, and use selection criteria just like a normal read query.
Best Regards,
Chris -
Script to generate all the tables and objects in a schema
how to write a script to generate all the tables and objects in a schema.
with toad the no of tables generated is not matching when i check from schema .Dear Sidhant,
Try this script:
set termout off
set feedback off
set serveroutput on size 100000
spool ddl_schema.sql
begin
dbms_output.put_line('--');
dbms_output.put_line('-- DROP TABLES --');
dbms_output.put_line('--');
for rt in (select tname from tab order by tname) loop
dbms_output.put_line('DROP TABLE '||rt.tname||' CASCADE CONSTRAINTS;');
end loop;
end;
declare
v_tname varchar2(30);
v_cname char(32);
v_type char(20);
v_null varchar2(10);
v_maxcol number;
v_virg varchar2(1);
begin
dbms_output.put_line('--');
dbms_output.put_line('-- CREATE TABLES --');
dbms_output.put_line('--');
for rt in (select table_name from user_tables order by 1) loop
v_tname:=rt.table_name;
v_virg:=',';
dbms_output.put_line('CREATE TABLE '||v_tname||' (');
for rc in (select table_name,column_name,data_type,data_length,
data_precision,data_scale,nullable,column_id
from user_tab_columns tc
where tc.table_name=rt.table_name
order by table_name,column_id) loop
v_cname:=rc.column_name;
if rc.data_type='VARCHAR2' then
v_type:='VARCHAR2('||rc.data_length||')';
elsif rc.data_type='NUMBER' and rc.data_precision is null and
rc.data_scale=0 then
v_type:='INTEGER';
elsif rc.data_type='NUMBER' and rc.data_precision is null and
rc.data_scale is null then
v_type:='NUMBER';
elsif rc.data_type='NUMBER' and rc.data_scale='0' then
v_type:='NUMBER('||rc.data_precision||')';
elsif rc.data_type='NUMBER' and rc.data_scale<>'0' then
v_type:='NUMBER('||rc.data_precision||','||rc.data_scale||')';
elsif rc.data_type='CHAR' then
v_type:='CHAR('||rc.data_length||')';
else v_type:=rc.data_type;
end if;
if rc.nullable='Y' then
v_null:='NULL';
else
v_null:='NOT NULL';
end if;
select max(column_id)
into v_maxcol
from user_tab_columns c
where c.table_name=rt.table_name;
if rc.column_id=v_maxcol then
v_virg:='';
end if;
dbms_output.put_line (v_cname||v_type||v_null||v_virg);
end loop;
dbms_output.put_line(');');
end loop;
end;
declare
v_virg varchar2(1);
v_maxcol number;
begin
dbms_output.put_line('--');
dbms_output.put_line('-- PRIMARY KEYS --');
dbms_output.put_line('--');
for rcn in (select table_name,constraint_name
from user_constraints
where constraint_type='P'
order by table_name) loop
dbms_output.put_line ('ALTER TABLE '||rcn.table_name||' ADD (');
dbms_output.put_line ('CONSTRAINT '||rcn.constraint_name);
dbms_output.put_line ('PRIMARY KEY (');
v_virg:=',';
for rcl in (select column_name,position
from user_cons_columns cl
where cl.constraint_name=rcn.constraint_name
order by position) loop
select max(position)
into v_maxcol
from user_cons_columns c
where c.constraint_name=rcn.constraint_name;
if rcl.position=v_maxcol then
v_virg:='';
end if;
dbms_output.put_line (rcl.column_name||v_virg);
end loop;
dbms_output.put_line(')');
dbms_output.put_line('USING INDEX );');
end loop;
end;
declare
v_virg varchar2(1);
v_maxcol number;
v_tname varchar2(30);
begin
dbms_output.put_line('--');
dbms_output.put_line('-- FOREIGN KEYS --');
dbms_output.put_line('--');
for rcn in (select table_name,constraint_name,r_constraint_name
from user_constraints
where constraint_type='R'
order by table_name) loop
dbms_output.put_line ('ALTER TABLE '||rcn.table_name||' ADD (');
dbms_output.put_line ('CONSTRAINT '||rcn.constraint_name);
dbms_output.put_line ('FOREIGN KEY (');
v_virg:=',';
for rcl in (select column_name,position
from user_cons_columns cl
where cl.constraint_name=rcn.constraint_name
order by position) loop
select max(position)
into v_maxcol
from user_cons_columns c
where c.constraint_name=rcn.constraint_name;
if rcl.position=v_maxcol then
v_virg:='';
end if;
dbms_output.put_line (rcl.column_name||v_virg);
end loop;
select table_name
into v_tname
from user_constraints c
where c.constraint_name=rcn.r_constraint_name;
dbms_output.put_line(') REFERENCES '||v_tname||' (');
select max(position)
into v_maxcol
from user_cons_columns c
where c.constraint_name=rcn.r_constraint_name;
v_virg:=',';
select max(position)
into v_maxcol
from user_cons_columns c
where c.constraint_name=rcn.r_constraint_name;
for rcr in (select column_name,position
from user_cons_columns cl
where rcn.r_constraint_name=cl.constraint_name
order by position) loop
if rcr.position=v_maxcol then
v_virg:='';
end if;
dbms_output.put_line (rcr.column_name||v_virg);
end loop;
dbms_output.put_line(') );');
end loop;
end;
begin
dbms_output.put_line('--');
dbms_output.put_line('-- DROP SEQUENCES --');
dbms_output.put_line('--');
for rs in (select sequence_name
from user_sequences
where sequence_name like 'SQ%'
order by sequence_name) loop
dbms_output.put_line('DROP SEQUENCE '||rs.sequence_name||';');
end loop;
dbms_output.put_line('--');
dbms_output.put_line('-- CREATE SEQUENCES --');
dbms_output.put_line('--');
for rs in (select sequence_name
from user_sequences
where sequence_name like 'SQ%'
order by sequence_name) loop
dbms_output.put_line('CREATE SEQUENCE '||rs.sequence_name||' NOCYCLE;');
end loop;
end;
declare
v_virg varchar2(1);
v_maxcol number;
begin
dbms_output.put_line('--');
dbms_output.put_line('-- INDEXES --');
dbms_output.put_line('--');
for rid in (select index_name, table_name
from user_indexes
where index_name not in (select constraint_name from user_constraints)
and index_type<>'LOB'
order by index_name) loop
v_virg:=',';
dbms_output.put_line('CREATE INDEX '||rid.index_name||' ON '||rid.table_name||' (');
for rcl in (select column_name,column_position
from user_ind_columns cl
where cl.index_name=rid.index_name
order by column_position) loop
select max(column_position)
into v_maxcol
from user_ind_columns c
where c.index_name=rid.index_name;
if rcl.column_position=v_maxcol then
v_virg:='';
end if;
dbms_output.put_line (rcl.column_name||v_virg);
end loop;
dbms_output.put_line(');');
end loop;
end;
spool off
set feedback on
set termout on Best Regards,
Francisco Munoz Alvarez
www.oraclenz.com -
Cant view objects from another schemas
Hi everybody!
I have a 10.1.2 Jdeveloper and a 9.2.4 Oracle database.
I successfully created a database connection.
With provided login I can access to tables from another schemas in SQL Worksheet, but I cant see any objects from those schemas in the connection tree.
What's wrong?The Schemas are being filtered so that you only automatically see the schema for the connection that you logged on with. To change the schemas that are visible you need to :
1) Select the connection name in the Navigator (you should see that it has a filter icon overlaid showing that it is being filtered)
2) Invoke the context menu and select 'Apply filters'
3) Shuttle over the other Schemas you wish to see and press OK
Regards,
Lisa Sherriff
JDev QA -
How to Copy complete structure of a table with data from one database table to another databse table
I need a sql query to copy structure of table with data from production table of ONLINEBTREKDB database to production table of Archive database.
I tried this query
select * into Archive.dbo.Production from ONLINEBTREKDB.dbo.Production p
but problem is I am able to copy the table schema and data but not able to copy constraints(PK)
Any Help?
seemaYou've multiple options
1. Use generate scripts wizard available in SQL management studio. This is particularly helpful when you want to script out lot of objects. You can also choose to script data as well inside this. This can be launched by right clicking the db, choosing tasks
-> generate scripts and then selecting required options inside the wizard
2. Use object explorer and right click and script out table. You can also use search functionality to find object you want inside object explorer
http://visakhm.blogspot.in/2013/02/object-filtering-using-ssms-object.html
3. Use query based on INFORMATION_SCHEMA views like TABLES,COLUMNS,CONSTRAINT_COLUMN_USAGE etc to generate the script
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Hi,
In short: How to suppress compiler errors without excluding the object from the "Schema Compare" tool ??
A bit longer:
We have a SQL Server 2008 project in Visual Studio 2013 running SQL Server Data Tool.
An old database, with a lot of history in, has been imported into SSDT and there are many syntax errors preventing the project from compiling/running. An typical error is: "SQL70001: This statement is not recognized in this context".
Running the "faulty" scripts on the server, executes just fine. I understand that there are syntax errors and they should be rewritten, but it's not gonna happen just like that - it is a slow process over a long period of time.
I know it is possible to change Build Action to None, but that also exclude the object from appearing in the Schema Compare function/window.
So - how to ignore some compiler errors and still having the objects to appear when doing "Schema Compare" ??
Thank you in advance.Hi Steven,
Thanks for your comments.
Well, it sure does help in the future, but right now i would prefer the other way - to suppress some errors and still allow the scripts to build.
The thing is that if we "rewrite" the objects into create scripts, then we have a huge test job ahead of us + the database environments (PROD vs DEV and UAT) does not share the same AD or DB users and therefore grants is lost if dropping/creating
objects, right!
If you drop a object before creating it, the drop will also drop the roles and grants and since they don't share user table, the create will not be able to add the permissions again. There might be a solution to that, but it is going to be very complicated
for some newbies like us. We need something we can trust.
BR
Peter -
Some objects in sys schema not imported usinf full database import/export.
Hello All,
We need to migrate database from one server to new server using same database version 11g Release 2 (11.2.0.1.0). We have some production objects in sys schema. We took full export using full=y and then import on new server using full=y. Other objects belonging to different tablespaces and users has successfully imported but production objects i.e table in sys schema not import.
We used following commands for export and import:
# exp system file=/u01/backup/orcl_full_exp.dmp log=/u01/backup/orcl_full_exp.log full=y statistics=none
# imp system file=/u01/backup/orcl_full_exp.dmp log=/u01/backup/orcl_full_imp.log full=y ignore=y
Kind Regards,
SharjeelHi,
First of all it is not good practice to keep user object in the sys schema
second you are useing version 11gr2 what not you go for datapump export/import method.
third, did you get any error in import, what is the error -
Transport Table with Data from Development to Quality
Hi
Requirement:
Transporting Table with Values from Development to Quality System.
I have a Z* - table, appended one field at the end.
I need to transport data along with the table structure from Development System to Quality System.
In Development System, I have assigned the Transport request in Client 100(We can't add data to the table in this client).
What needs to be done to migrate the new table structure with Values.
Thanks in Advance
Regards,
Baburaj
NOTE: the requirement is to transport table and table entries through a transport request.
There should not be any manual update for the table in the target System (Quality System).Check the delivery class assigned to the table. Please see the documentation
Delivery class
The delivery class controls the transport of table data when installing
or upgrading, in a client copy and when transporting between customer
systems. The delivery class is also used in the extended table
maintenance.
There are the following delivery classes:
o A: Application table (master and transaction data).
o C: Customer table, data is maintained by the customer only.
o L: Table for storing temporary data.
o G: Customer table, SAP may insert new data records, but may not
overwrite or delete existing data records. The customer namespace
must be defined in table TRESC. (Use Report RDDKOR54 here).
o E: System table with its own namespaces for customer entries. The
customer namespace must be defined in table TRESC. (Use Report
RDDKOR54 here.)
S: System table, data changes have the same status as program
changes.
W: System table (e.g. table of the development environment) whose
data is transported with its own transport objects (e.g. R3TR PROG,
R3TR TABL, etc.).
or during client copy
the data of client-specific tables is copied.
Classes C, G, E, S: The data records of the table are copied to the
target client.
Classes W, L: The data records of the table are not copied to the
target client.
Class A: Data records are only copied to the target client if
explicitly requested (parameter option). Normally it does not make
sense to transport such data, but is supported to permit you to copy
an entire client environment.
or during installation, upgrade and language import
behavior differs here for client-specific and cross-client tables.
nt-specific tables
Classes A and C: Data is only imported into client 000. Existing
data records are overwritten.
Classes E, S and W: Data is imported into all clients. Existing data
records are overwritten.
Class G: Existing data records are overwritten in client 000. In all
other clients, new data records are inserted, but existing data
records are not overwritten.
Class L: No data is imported.
Cross-client tables
o Classes A, L and C: No data is imported.
o Classes E, S, and W: Data is imported. Exisitng data records with
the same key are overwritten.
o Classe G: Data records that do not exist are inserted, but existing
data records are not overwritten.
ehavior during transport between customer systems
Data records of tables of delivery class L are not imported into the
target system. Data records of tables of delivery classes A, C, E, G, S
and W are imported into the target system (this is done for the target
client specified in the transport for client-specific tables).
se of the delivery class in the extended table maintenance
The delivery class is also analyzed in the extended table maintenance
(SM30). The maintenance interface generated for a table makes the
following checks:
o You cannot transport the entered data with the transport link of the
generated maintenance interface for tables of delivery classes W and
L.
o When you enter data, there is a check if this data violates the
namespace defined for the table in table TRESC. If the data violates
the namespace, the input is rejected.
Thanks, -
Is there a way to access object from other schema?
1. Is there a way to access object from other schema
Without using synonym/public synonym without prefixing schema owner?
2. If you do not see any object in all_objects by same name owned by connected user or public, can there still be objects hidden from this view? for instance synonyms created by SYSTEM
TIA for helpWell, you missed something somewhere. If there is no
ALTER SESSION SET CURRENT_SCHEMA=whoeverthen there must be either public synonym for the object as this shows:
SQL> CREATE USER a identified by a;
User created.
SQL> GRANT CREATE SESSION to a;
Grant succeeded.
SQL> CREATE USER b identified by b;
User created.
SQL> GRANT CREATE SESSION, CREATE PROCEDURE, CREATE PUBLIC SYNONYM to b;
Grant succeeded.
SQL> connect b/b
Connected.
SQL> CREATE PACKAGE test AS
2 PROCEDURE testit;
3 END;
4 /
Package created.
SQL> CREATE PACKAGE BODY test AS
2 PROCEDURE testit IS
3 BEGIN
4 NULL;
5 END;
6 END;
7 /
Package body created.
SQL> connect a/a
Connected.
SQL> desc b.test
ERROR:
ORA-04043: object b.test does not exist
SQL> connect b/b
Connected.
SQL> GRANT EXECUTE ON test TO a;
Grant succeeded.
SQL> connect a/a
Connected.
SQL> desc b.test;
PROCEDURE TESTIT
SQL> desc test;
ERROR:
ORA-04043: object test does not exist
SQL> connect b/b
Connected.
SQL> CREATE PUBLIC SYNONYM test FOR TEST;
Synonym created.
SQL> connect a/a
Connected.
SQL> desc test
PROCEDURE TESTITAnother possibility without public synonyms is that crv had granted the other user privileges on some object, and the other user creates a private synonym for that. When crv granted privileges on a different object with the same name, the private synonym became valid again. Something like:
SQL> connect /
Connected.
SQL> drop public synonym test;
Synonym dropped.
SQL> GRANT CREATE SYNONYM TO a;
Grant succeeded.
SQL> connect a/a
Connected.
SQL> desc test;
ERROR:
ORA-04043: object test does not exist
SQL> desc b.test
PROCEDURE TESTIT
SQL> CREATE SYNONYM test FOR b.test;
Synonym created.
SQL> desc test;
PROCEDURE TESTIT
SQL> connect b/b
Connected.
SQL> REVOKE EXECUTE ON test FROM a;
Revoke succeeded.
SQL> connect a/a
Connected.
SQL> desc test;
ERROR:
ORA-04043: object "B"."TEST" does not exist
SQL> desc b.test
ERROR:
ORA-04043: object b.test does not exist
SQL> connect b/b
Connected.
SQL> DROP PACKAGE test;
Package dropped.
SQL> CREATE FUNCTION test (p_num IN NUMBER) RETURN NUMBER AS
2 BEGIN
3 RETURN p_num * 10;
4 END;
5 /
Function created.
SQL> GRANT EXECUTE ON test TO a;
Grant succeeded.
SQL> connect a/a
Connected.
SQL> desc test;
FUNCTION test RETURNS NUMBER
Argument Name Type In/Out Default?
P_NUM NUMBER INSo, I would go looking for the synonyms.
TTFN
John -
Populate SQL table with data from Oracle DB in ODI
Hi,
I am trying to populate a source SQL table with fields from an Oracle db in ODI. I am trying to perform this using a procedure and I am am getting the following error:
ODI-1226: Step PROC_1_Contract_Sls_Person_Lookup fails after 1 attempt(s).
ODI-1232: Procedure PROC_1_Contract_Sls_Person_Lookup execution fails.
ODI-1228: Task PROC_1_Contract_Sls_Person_Lookup (Procedure) fails on the target MICROSOFT_SQL_SERVER connection Phys_HypCMSDatamart.
Caused By: weblogic.jdbc.sqlserverbase.ddc: [FMWGEN][SQLServer JDBC Driver][SQLServer]Invalid object name 'C2C_APP.CON_V'.
My question is what is the best method to populate SQL db with data from an Oracle db? Using a procedure? A specific LKM?
I found threads referring to using an LKM to populate Oracle tables with data from a SQL table....but nothing for the opposite.
Any information would help.
thanks,
EricHi Eric,
If using an Interface, I would recommend the LKM SQL to MSSQL (BULK) knowledge module. This will unload the data from Oracle into a file, then bulk load the staging db on the target using a BULK INSERT.
Regards,
Michael Rainey -
Export/import with objects in another schema
In 9.2
I created two users: `live` and `world`
`live`> create type nam as object (txt varchar2) not final;
`system`> grant under any type to world;
`world`> create type nam_world under live.nam (txt2 varchar2);
and
create table nams of nam_world;
and new row
insert into nams values ('qwerty', 'ytrewq');
I build dump file:
exp system/manager FILE=live_world.dmp OWNER=live,world
All this successfully!!!
At another server (also 9.2) this export session terminated with errors:
imp SYSTEM/manager FILE=live_world.dmp FROMUSER=live,world TOUSER=live,world
Not help parameter IGNORE=Y
Not help parameter TOID_NOVALIDATE=(live.nam)
In any case: "Skipping table "WORLD"."NAMS" because object type "LIVE"."NAM" cannot be created or has different identifier"
General effect, what import simply not visible type live.nam
How import tables with objects in another users schema?
Please, help me.Hi Vishwanath,
You can export the objects as TPZ's
go to Tools---> Export configuration objects, to export them, and import configuration objects to reimport them.
cheers
Prashanth -
Updating Oracle table with info from Sybase query
I hope this is the correct forum for this question.
I am fairly new to Java and JDBC. I am trying to figure out what the best method for updating information in Oracle tables with data from a Sybase table. I would prefer to use Oracle’s transparent gateway but this is not an option my company will pay for so I am creating a java stored procedure and using JDBC to connect to the Sybase database.
The process I think I need to go thru is
1. Query an Oracle table to get the records that need to be updated and the “key” information to query the Sybase table with.
2. Use that result to query the Sybase database to get the fields that need to be updated in the Oracle table for those records.
3. Update the records on the Oracle table with the data from the Sybase query.
I know I can just do this procedurally, row-by-row, but I was wondering if anyone knows of a way to accomplish this with SQL and no loops. Is there a way to make a result set available as a “SQL table” for another JDBC query?
Basically what I would like to do is:
OraQuery = “ select sybinfo from sometable where updated_date = null”;
Statement orastmt1 = OraConn.createStatement();
ResultSet Orars1 = orastmt1.executeQuery (OraQuery);
SybQuery = “select update_date, sybinfo from sybtable where sybinfo = Orars1.sybinfo”;
Statement sybstmt = SybConn.createStatement();
ResultSet Sybrs = sybstmt1.executeQuery (SybQuery);
OraUpdate = “update (select update_date from sometable, Sybrs where sometable.sybinfo = Sybrs.sybinfo) set update_date = Sybrs.update_date”;
Statement orastmt2 = OraConn.createStatement();
ResultSet Orars2 = orastmt2.executeQuery (OraUpdate);
This may not be possible but if anyone has done something similar and wouldn’t mind sharing I would appreciate it. If there is a “better” way of accomplishing this I am open to suggestions.
Thanksyou can try using cachedRowSet() for the Oracle side query.
The rows in this could be populated using the sybase side query's resultset and then all of this could updated into Oracle in one shot. -
Trying to populate a table with data from WebRowset
Hi,
I want to be able to populate my tables with data from WebRowsets that have been saved to files. Everything goes good until I get to acceptChanges(). At which point I get a NullPointerException.
Here's the code...
WebRowSet wrs = new WebRowSetImpl();
FileReader reader = new FileReader(inputFile);
wrs.readXml(reader);
wrs.beforeFirst();
CachedRowSet crs = new CachedRowSetImpl();
crs.setSyncProvider("com.sun.rowset.providers.RIXMLProvider");
crs.populate(wrs);
crs.beforeFirst();
crs.acceptChanges(con);
Results in...
java.lang.NullPointerException
at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:867)
at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:919)
I'm using Java 1.5_02. I looked at the source code for CachedRowSetImpl, and the only thing I could think of is that maybe "provider.getRowSetWriter()" in the following snippet is returning null....
public void setSyncProvider(String s)
throws SQLException
provider = SyncFactory.getInstance(s);
rowSetReader = provider.getRowSetReader();
rowSetWriter = (TransactionalWriter)provider.getRowSetWriter();
Any ideas?? Thanks!I have the same problem after setting com.sun.rowset.providers.RIXMLProvider.
Looks like a bug to me.
By the way, why are you creating a new CachedRowSet and populate it with a WebRowset (which extends CachedRowSet)? -
Moving objects from one schema to another
Hi,
again as part of my learning exercise, I was trying to move objects from a schema in 10GR2 to 11GR2 database.
I am able to use exp and imp commands to achieve this objective -
On source database -
$> exp userid=scott/tiger owner=(schemaname) file=data.dmp statistics=none
Copied the dump file on target server and then
$> imp userid=scott/tiger file=data.dmp fromuser=uname touser=scott
And this works fine.
What I am not able to understand is how I can achieve this by using datapump instead?
Your help is much appreciated.
Thanks.Thanks.
Worked perfectly.
This is what I did (in case someone is in my position)-
On source database-
expdp scott/tiger schemas=<source schema>directory=DATA_PUMP_DIR dumpfile=data.dmp job_name=some_job
Copied dump file to target server.
On target database-
$> impdp scott/tiger directory=DATA_PUMP_DIR dumpfile=data.dmp remap_schema=<source schema>:<target schema> job_name=imp_kob
Maybe you are looking for
-
How can I add a page or pages in the MIDDLE of a photo book I'm making?
I found some photos I want to put in a page in the middle of a photo book that I'm making, not at the end. Is there a way to add pages in the middle of the book?
-
Using AIR for all application.
Hi to all! In this days i'm trying to use Adobe AIR with FLEX to build RIA on Desktop and other application (like company managment and other:) In past i used VB .NET, C++, C#, and JAVA. I know that this are the language for "antonomasia" to build co
-
How to Convert Calender to Date
Hi. I have Calender object (MM dd,yyyy), I wanted to convert this into Date object in the format of "yyyy-mm-dd". Can any one please give me code to do this ? Thanks Sarav.
-
Any way to print from Finder?
Sorry about my last post...I really messed up! Here I go again. Is there any way to print from the finder? I have a DVD inserted into my drive, and I want to print the contents to have as a reference. I tried to print the contents of the disk from To
-
"Include control entries"-Function
Hello, i found a SAP-article about a problem im trying to solve - to add a new field to the coding-block (account assignment). The url is: http://help.sap.com/saphelp_40b/helpdata/es/ba/e92c7dd435d1118b3f0060b03ca329/content.htm Now they write: <i>"U