How to create materialized view based on a synonym
Hi all,
I am trying to create simple materialized view based on a synonym and that synonym is pointing a view in other database (using dblink). I am getting table or view not found error . I am able to select synonym if i use select but not in materialized view. Please help me.
Thanks,
The best way to do this is to create a materialzed view based on the underlying code of the original view. If you don't have this handy, issue the following in sqlplus:
select text
from user_views
where view_name = 'NAME_OF_VIEW'
You can then cut and paste the sql statement into your create materialized view statement.
Please note, you will probable have to set the long parameter to a higher value to reveal the complete statement for example:
SQL> set long 2048
Similar Messages
-
How to create materialized view based on a view?
Hi,
I hope this is not very far fetched idea.
I have a very complex view and I would like to replicate it 'in place' that is I would like to make a materialized view that is based on this view complex view. I would like to use this materialized view (i.e table) to query data instead of using the original view, since it takes Oracle some 10-15 seconds to execute my query on the original view and I am not allowed to create indexes on most of the tables that are included in the original view.
Can this be done?
Best regards,
Tamas SzecsyThe best way to do this is to create a materialzed view based on the underlying code of the original view. If you don't have this handy, issue the following in sqlplus:
select text
from user_views
where view_name = 'NAME_OF_VIEW'
You can then cut and paste the sql statement into your create materialized view statement.
Please note, you will probable have to set the long parameter to a higher value to reveal the complete statement for example:
SQL> set long 2048 -
Create Materialized View based on Results from LDAP Query
Hi -- I'm trying to create a materialized view based on results from an LDAP query. Unfortunately, it looks like a materialized view can't be created based on a stored procedure, which is where the LDAP results are obtained (using nested loops).
Does anyone have any idea how to do this without first kicking off a stored procedure that populates a temp table which would be used to create the materialized view? I'm trying to minimize the steps that the DBA's will need to go through when refreshing this new view.
Thanks,
~ChristineCan you give us more details about the stored procedure you're calling. It will help to know what parameters are involved and what data types they are.
Off the top of my head though it looks like, at the very least, you would need a stored function that calls the stored procedure. I don't think there is any way to call stored procedures from CREATE ... commands. If you're going to create a stored function anyway ... well, you might as well just create a procedure that inserts values into a regular table instead of fussing with functions and materialized views. You'll probably want to schedule your new procedure to run periodically since it sounds like you'll need the values refreshed from time to time. -
How to create a view based on Lookup Column?
Hi All,
I am working as a SharePoint developer 2013.
When i tried to create a view based on look up column it is not showing lookup column.
How to fix this problem?
Please help me out here.
Thanks & Regards,
Santhoshican you elaborate the issue? Do you mean you cannot view the column name in the filter section when creating a new view for the list or the column is not getting displayed in the view created?
--Cheers -
How to create materialized view log on remote database
How do you create materialized view logs on a remote database.
I tried
create materialized view log on global_express_views.vccs438_project_work_request@h92edwp with sequence, rowid ( columns...)
ERROR at line 1:
ora-00949 illegal reference to remote databaseHi,
I am not getting the error exactly. But have some suggestion:
If the schema owner does not own the master tables, then the schema owner must have the GLOBAL QUERY REWRITE privilege or the QUERY REWRITE object privilege on each table outside the schema.
Hope, this may help you?
Thanx.. Ratan -
How to CREATE MATERIALIZED VIEW LOG (MV fast refresh) with some JOINS
Hi @ all,
i'm trying to create a MATERIALIZED VIEW LOG for a fast refresh of a MATERIALIZED VIEW.
It works fine with a simple Request in the MATERIALIZED VIEW:
CREATE MATERIALIZED VIEW MV_ZOTD43_P
TABLESPACE GDII
BUILD IMMEDIATE
REFRESH FORCE AS
SELECT * FROM ZOTD43_P;
COMMIT;
CREATE MATERIALIZED VIEW LOG ON ZOTD43_P
TABLESPACE "GDII"
WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
call DBMS_MVIEW.REFRESH('MV_ZOTD43_P', 'f');
But when I use a complex SQL-Request with some JOINS (one of the Table with spatial Data) in the MATERIALIZED VIEW, I get an error:
CREATE MATERIALIZED VIEW MV_TEST
TABLESPACE GDII
BUILD IMMEDIATE
REFRESH FORCE AS
SELECT lptd04_p.sst_nr AS sst_nr,
lptd03_p.aaaa AS aaaa,
lptd04_geom.geom as geom
FROM lptd04_p lptd04_p
JOIN lptd01_p lptd01_p ON lptd01_p.cre_nr = lptd04_p.sst_nr
JOIN lptd04_geom ON lptd04_geom.sst_nr = lptd04_p.sst_nr
JOIN lptd03_p lptd03_p ON lptd03_p.lief_nr = lptd04_p.lief_nr;
COMMIT;
CREATE MATERIALIZED VIEW LOG ON LPTD04_P
TABLESPACE "GDII"
WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
call DBMS_MVIEW.REFRESH('MV_TEST', 'f');
Error report:
SQL Error: ORA-12004: REFRESH FAST kann für Materialized View "GDI"."MV_GDI_SST_STAMM" nicht benutzt werden
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2255
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2461
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2430
ORA-06512: in Zeile 1
12004. 00000 - "REFRESH FAST cannot be used for materialized view \"%s\".\"%s\""
*Cause: The materialized view log does not exist or cannot be used. PCT
refresh is also not enabled on the materialized view
*Action: Use just REFRESH, which will reinstantiate the entire table.
If a materialized view log exists and the form of the materialized
view allows the use of a materialized view log or PCT refresh is
possible after a given set of changes, REFRESH FAST will
be available starting the next time the materialized view is
refreshed.
Am I doing something wrong or is it not possible CREATE MATERIALIZED VIEW LOG when the MATERIALIZED VIEW got some JOINS?
Regards,
GreqThanks for the link Alessandro ,
the error seems something to do with the Column-Type SDO_GEOMETRY, so
i create a new thread in the Spatial Discussion forum:
FAST REFRESHing of Oracle Materialized Views containing SDO_GEOMETRY column
Regards,
Greq -
Create Materialized View based on another database table using db link?
SQL> SELECT sysdate
2 FROM dual@CBRLINK ;
SYSDATE
21-NOV-12
SQL> CREATE MATERIALIZED VIEW USERCBR.V_T24_COUNTRY1
2 REFRESH COMPLETE
3 START WITH SYSDATE NEXT SYSDATE + (5/24)
4 AS
5 SELECT sysdate
6 FROM dual@CBRLINK ;
CREATE MATERIALIZED VIEW USERCBR.V_T24_COUNTRY1
ERROR at line 1:
ORA-04052: error occurred when looking up remote object SYS.DUAL@CBRLINK
ORA-00600: internal error code, arguments: [ORA-00600: internal error code,
arguments: [qksfroFXTStatsLoc() - unknown KQFOPT type!], [0], [], [], [], [],
ORA-02063: preceding line from CBRLINKIt works for me:orcl>
orcl> CREATE MATERIALIZED VIEW scott.V_T24_COUNTRY1
2 REFRESH COMPLETE
3 START WITH SYSDATE NEXT SYSDATE + (5/24)
4 AS
5 SELECT sysdate
6 FROM dual@l1 ;
Materialized view created.
orcl> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for 32-bit Windows: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
orcl>so there is no problem with the code. HTH. -
How to create materialized view with parameter and index ?
Hi all,
i am using oracle 11g.
i want to create parameter materialized view with two parameter (STORED_VALUE, LOV_NAME) with an index .
i have below view
CREATE OR REPLACE FORCE VIEW SR_MY_TEST(DISPLAYED_VALUE, STORED_VALUE, LOV_NAME) AS
SELECT DISPLAYED_VALUE , LOVVALUE.STORED_VALUE , lovname.lov_name
FROM (SELECT T.LOV_VALUE_ID,
T.LOV_ID,
T.ORG_ENTITY_ID,
T.STORED_VALUE,
T.DISPLAYED_VALUE,
T.ENTERPRISE_ID
FROM MS_QS_LIST_OF_VALUES_T T) lovvalue, ms_qs_lov_names lovname
WHERE lovvalue.lov_id = lovname.lov_id
AND lovvalue.org_entity_id = 1
and LOVVALUE.ENTERPRISE_ID = 100000
AND LOVNAME.ENTERPRISE_ID = 100000;
i want to create index on STORED_VALUE, LOV_NAME
Thanks
DambyNo.AFAIK, there's nothing called as "parameterized MV".
Materialized View store data like tables (and not like Views). So, does it make sense when you say - "table with parameters" ?
Could you please explain your business requirement?
What is the purpose behind those 2 parameters? -
Create a view based on a public synonym
Hi I'm trying to create a view based on a public synonym, but getting "ORA-01031: insufficient privileges" error.
When i retrieve records from the same public synonym, i could able to do so. But when i try to create a view based on that synonym, it is not possible. Why is it? Can anyone please explain?
11:58:04 IT00053.it0053@SCOTT> connect sys as sysdba
Enter password: ******
Connected.
11:58:14 IT00053.it0053@SYS> create role general_user_role;
Role created.
Elapsed: 00:00:00.14
11:58:33 IT00053.it0053@SYS> connect scott
Enter password: *****
Connected.
11:58:41 IT00053.it0053@SCOTT> select * from tab;
TNAME TABTYPE CLUSTERID
DEPT TABLE
EMP TABLE
BONUS TABLE
SALGRADE TABLE
DEPT_TAB SYNONYM
Elapsed: 00:00:00.01
11:58:47 IT00053.it0053@SCOTT> create public synonym scott_emp for scott.emp;
Synonym created.
Elapsed: 00:00:00.06
11:59:14 IT00053.it0053@SCOTT> grant select on scott_emp to general_user_role;
Grant succeeded.
Elapsed: 00:00:00.14
11:59:35 IT00053.it0053@SCOTT> connect sys as sysdba
Enter password: ******
Connected.
12:00:13 IT00053.it0053@SYS> create user beginning_user
12:00:31 2 identified by beginning_user
12:00:38 3 default tablespace users
12:00:45 4 temporary tablespace temp;
User created.
Elapsed: 00:00:00.04
12:00:53 IT00053.it0053@SYS> grant connect, resource, create table, create view to beginning_user;
Grant succeeded.
Elapsed: 00:00:00.01
12:01:13 IT00053.it0053@SYS> grant general_user_role to beginning_user;
Grant succeeded.
Elapsed: 00:00:00.01
12:01:35 IT00053.it0053@SYS> connect beginning_user/beginning_user
Connected.
12:01:49 IT00053.it0053@SYS> connect beginning_user
Enter password: **************
Connected.
12:02:01 IT00053.it0053@SYS> show user
USER is "BEGINNING_USER"
12:02:06 IT00053.it0053@SYS> select * from scott_emp;
EMPNO ENAME JOB MGR HIREDATE SAL
COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800
20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600
300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250
500 30
7566 JONES MANAGER 7839 02-APR-81 2975
20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250
1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850
30
7782 CLARK MANAGER 7839 09-JUN-81 2450
10
7788 SCOTT ANALYST 7566 19-APR-87 3000
20
7839 KING PRESIDENT 17-NOV-81 5000
10
7844 TURNER SALESMAN 7698 08-SEP-81 1500
0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100
20
7900 JAMES CLERK 7698 03-DEC-81 950
30
7902 FORD ANALYST 7566 03-DEC-81 3000
20
7934 MILLER CLERK 7782 23-JAN-82 1300
10
14 rows selected.
Elapsed: 00:00:00.21
12:02:16 IT00053.it0053@SYS> create or replace view new_view_1 as select empno, ename, job from
12:02:50 2 scott_emp;
scott_emp
ERROR at line 2:
ORA-01031: insufficient privileges
Why is this error?
Your help will be much appreciated...
Thanks and regards
Muthucreate any view privilege
10:15:07 IT00053.it0053@SYS> connect sys as sysdba
Enter password: ******
Connected.
10:22:27 IT00053.it0053@SYS>
10:22:28 IT00053.it0053@SYS>
10:22:28 IT00053.it0053@SYS> grant create any view to beginning_user;
Grant succeeded.
Elapsed: 00:00:00.00
10:22:53 IT00053.it0053@SYS> connect beginning_user/beginning_user
Connected.
10:22:59 IT00053.it0053@SYS> create or replace view new_view_1 as select empno, ename, job from scot
t_emp;
create or replace view new_view_1 as select empno, ename, job from scott_emp
ERROR at line 1:
ORA-01031: insufficient privileges
---> Same result
But When creating a view, the owner must have granted the select directly.
10:23:08 IT00053.it0053@SYS> connect scott/tiger
Connected.
10:25:43 IT00053.it0053@SCOTT> grant select on scott_emp to beginning_user;
Grant succeeded.
Elapsed: 00:00:00.07
10:26:14 IT00053.it0053@SCOTT> connect beginning_user/beginning_user
Connected.
10:26:19 IT00053.it0053@SCOTT> create or replace view new_view_1 as select empno, ename, job
10:26:25 2 from scott_emp;
View created.
Elapsed: 00:00:00.03
This works. Thanks a lot for your timely help.
danke shun herr bochum. thanks to mr.ankara -
How to create classification view for material?
HI All,
How to create classification view for material? is there any function module?
pls let me know.
Bandicheck the standard include "LCLBPAU14" this is using the following F.M
call function 'BAPI_OBJCL_CREATE'
exporting
objectkeynew = l_object
objecttablenew = l_objecttable
classnumnew = classnum_new
classtypenew = l_classtype
status = status
standardclass = standardclass
changenumber = changenumber
keydate = keydate
no_default_values = no_default_values
importing
classif_status = classif_status
tables
allocvaluesnum = allocvaluesnum
allocvalueschar = allocvalueschar
allocvaluescurr = allocvaluescurr
return = return. -
How to create one procedure which can drop and create materialized view
Hi,
I want to create one pl/sql procedure which can first drop materialized view CATEGORY_PK and after that create same materialized view CATEGORY_PK.
programme is as follows:
DROP MATERIALIZED VIEW CATEGORY_PK;
CREATE MATERIALIZED VIEW CATEGORY_PK REFRESH FORCE WITH PRIMARY KEY AS
SELECT cav1.ownerid AS categoryid, p.uuid AS productid ,p.domainID AS productdomainid,pav.stringvalue AS NAME
,pav2.stringvalue AS ID, pav3.stringvalue AS SHORT
FROM product p, product_av pav, catalogcategory_av cav1, catalogcategory_av cav2,product_av pav2,product_av pav3
WHERE
cav1.NAME = 'PRODUCT_BINDING_ATTRIBUTE' AND
cav2.NAME = 'PRODUCT_BINDING_VALUE' AND
cav1.ownerid = cav2.ownerid AND
p.uuid = pav.ownerid AND
p.uuid = pav2.ownerid AND
p.uuid = pav3.ownerid AND
pav.NAME = cav1.stringvalue AND
pav2.NAME = cav1.stringvalue AND
pav2.NAME = cav1.stringvalue AND
pav.stringvalue = cav2.stringvalue AND
pav2.stringvalue = cav2.stringvalue AND
pav3.stringvalue = cav2.stringvalue
UNION
SELECT catalogcategoryid AS categoryid, productid, repdomainid AS productdomainid,pav1.stringvalue AS NAME
,pav2.stringvalue AS ID, pav3.stringvalue AS SHORT
FROM productcategoryassignment ,product_av pav1,product_av pav2,product_av pav3
WHERE pav1.ownerid=productid
AND pav2.ownerid=productid
AND pav3.ownerid=productid
AND pav1.NAME='name'
AND pav2.NAME='productID'
AND pav3.NAME='shortDescription';user498566 wrote:
I want to create one pl/sql procedure which can first drop materialized view CATEGORY_PK and after that create same materialized view CATEGORY_PK.That sounds like a waste of time and resources. What do you hope to achieve by this? A refresh? If so, a simple refresh of the old materialized view will do.
If you truly want to continue this road, you'll have to use the EXECUTE IMMEDIATE command to execute DDL commands from within PL/SQL.
Regards,
Rob. -
Create Materialized View with GROUP BY
I have a table
treecluster NUMBER(3)
treenumber NUMBER(3)
treedate DATE
nestnumber NUMBER(3)
eggs NUMBER(3)
nestlings NUMBER(3)
fledglings NUMBER(3)
nestfate VARCHAR2(10)
nestfailurecode NUMBER(2)
I want to group the data by treecluster, treenumber, year, and nest number and get a max eggs, nestlings, fledglings. I am doing this with the following:
SELECT treecluster, treenumber, to_char(nestchecksdate, 'YYYY'), nestnumber,
max(eggs), max(nestlings), max(fledglings)
FROM nestchecks
GROUP BY treecluster, treenumber, to_char(nestchecksdate, 'YYYY'), nestnumber;
This works fine.
The last record for a year has a nestfate and nestfailurecode value.
I need to group all information and then also get the nestfate and nestfailurecode for the year. How do I go about getting this information?
I am really trying to create a summary materialized view based on a data table so the select I am trying to craft would be a part of a create materialized view as SELECT...
so I want to be able to group the info and add in the nestfate and failurecode in one step.
Thanks!try this:
SQL> select * from table_tree;
TREECLUSTER TREENUMBER NESTCHECK NESTNUMBER EGGS NESTLINGS FLEDGLINGS NESTFATE NESTFAILURECODE
4 167 17-MAY-00 2 0 0
4 167 24-MAY-00 2 3 0
4 167 30-MAY-00 2 3 0
4 167 12-JUN-00 2 0 1 FAILURE 2
select a.treecluster, a.treenumber, to_char(a.nestyear,'YYYY') nestyear,
a.nestnumber, a.eggs, a.nestlings, a.fledglings, a.nestfate, a.nestfailurecode
from (select max(treecluster) treecluster, max(treenumber) treenumber,
max(nestchecksdate) nestyear,
max(nestnumber) nestnumber, max(eggs) eggs, max(nestlings) nestlings,
nvl(max(FLEDGLINGS),0) FLEDGLINGS, max(NESTFATE) NESTFATE,
max(nestfailurecode) nestfailurecode
from table_tree) a
TREECLUSTER TREENUMBER NEST NESTNUMBER EGGS NESTLINGS FLEDGLINGS NESTFATE NESTFAILURECODE
4 167 2000 2 3 1 0 FAILURE 2hope this helps -
Is it possible to create materialized view log file for force refresh
Is it possible to create materialized view log file for force refresh with join condition.
Say for example:
CREATE MATERIALIZED VIEW VU1
REFRESH FORCE
ON DEMAND
AS
SELECT e.employee_id, d.department_id from emp e and departments d
where e.department_id = d.department_id;
how can we create log file using 2 tables?
Also am copying M.View result to new table. Is it possible to have the same values into the new table once the m.view get refreshed?You cannot create a record as a materialized view within the Application Designer.
But there is workaround.
Create the record as a table within the Application Designer. Don't build it.
Inside your database, create the materialized with same name and columns as the record created previously.
After that, you'll be able to work on that record as for all other within the Peoplesoft tools.
But keep in mind do never build that object, that'll drop your materialized view and create a table instead.
Same problem exists for partitioned tables, for function based-indexes and some other objects database vendor dependant. Same workaround is used.
Nicolas. -
How to create a report based on a DataSet programatically
I'm working on a CR 2008 Add-in.
Usage of this add-in is: Let the user choose from a list of predefined datasets, and create a totally empty report with this dataset attached to is. So the user can create a report based on this dataset.
I have a dataset in memory, and want to create a new report in cr2008.
The new report is a blank report (with no connection information).
If I set the ReportDocument.SetDataSource(Dataset dataSet) property, I get the error:
The report has no tables.
So I must programmatically define the table definition in my blank report.
I found the following article: https://boc.sdn.sap.com/node/869, and came up with something like this:
internal class NewReportWorker : Worker
public NewReportWorker(string reportFileName)
: base(reportFileName)
public override void Process()
DatabaseController databaseController = ClientDoc.DatabaseController;
Table table = new Table();
string tabelName = "Table140";
table.Name = tabelName;
table.Alias = tabelName;
table.QualifiedName = tabelName;
table.Description = tabelName;
var fields = new Fields();
var dbField = new DBField();
var fieldName = "ID";
dbField.Description = fieldName;
dbField.HeadingText = fieldName;
dbField.Name = fieldName;
dbField.Type = CrFieldValueTypeEnum.crFieldValueTypeInt64sField;
fields.Add(dbField);
dbField = new DBField();
fieldName = "IDLEGITIMATIEBEWIJS";
dbField.Description = fieldName;
dbField.HeadingText = fieldName;
dbField.Name = fieldName;
dbField.Type = CrFieldValueTypeEnum.crFieldValueTypeInt64sField;
fields.Add(dbField);
// More code for more tables to add.
table.DataFields = fields;
//CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo info =
// new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
//info.Attributes.Add("Databse DLL", "xxx.dll");
//table.ConnectionInfo = info;
// Here an error occurs.
databaseController.AddTable(table, null);
ReportDoc.SetDataSource( [MyFilledDataSet] );
//object path = @"d:\logfiles\";
//ClientDoc.SaveAs("test.rpt", ref path, 0);
The object ClientDoc referes to a ISCDReportClientDocument in a base class:
internal abstract class Worker
private ReportDocument _ReportDoc;
private ISCDReportClientDocument _ClientDoc;
private string _ReportFileName;
public Worker(string reportFileName)
_ReportFileName = reportFileName;
_ReportDoc = new ReportDocument();
// Load the report from file path passed by the designer.
_ReportDoc.Load(reportFileName);
// Create a RAS Document through In-Proc RAS through the RPTDoc.
_ClientDoc = _ReportDoc.ReportClientDocument;
public string ReportFileName
get
return _ReportFileName;
public ReportDocument ReportDoc
get
return _ReportDoc;
public ISCDReportClientDocument ClientDoc
get
return _ClientDoc;
But I get an "Unspecified error" on the line databaseController.AddTable(table, null);
What am i doing wrong? Or is there another way to create a new report based on a DataSet in C# code?Hi,
Have a look at the snippet code below written for version 9 that you might accommodate to CR 2008, it demonstrates how to create a report based on a DataSet programmatically.
//=========================================================================
+ * the following two string values can be modified to reflect your system+
+ ************************************************************************************************/+
+ string mdb_path = "C:
program files
crystal decisions
crystal reports 9
samples
en
databases
xtreme.mdb"; // path to xtreme.mdb file+
+ string xsd_path = "C:
Crystal
rasnet
ras9_csharp_win_datasetreport
customer.xsd"; // path to customer schema file+
+ // Dataset+
+ OleDbConnection m_connection; // ado.net connection+
+ OleDbDataAdapter m_adapter; // ado.net adapter+
+ System.Data.DataSet m_dataset; // ado.net dataset+
+ // CR variables+
+ ReportClientDocument m_crReportDocument; // report client document+
+ Field m_crFieldCustomer;+
+ Field m_crFieldCountry;+
+ void CreateData()+
+ {+
+ // Create OLEDB connection+
+ m_connection = new OleDbConnection();+
+ m_connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + mdb_path;+
+ // Create Data Adapter+
+ m_adapter = new OleDbDataAdapter("select * from Customer where Country='Canada'", m_connection);+
+ // create dataset and fill+
+ m_dataset = new System.Data.DataSet();+
+ m_adapter.Fill(m_dataset, "Customer");+
+ // create a schema file+
+ m_dataset.WriteXmlSchema(xsd_path);+
+ }+
+ // Adds a DataSource using dataset. Since this does not require intermediate schema file, this method+
+ // will work in a distributed environment where you have IIS box on server A and RAS Server on server B.+
+ void AddDataSourceUsingDataSet(+
+ ReportClientDocument rcDoc, // report client document+
+ System.Data.DataSet data) // dataset+
+ {+
+ // add a datasource+
+ DataSetConverter.AddDataSource(rcDoc, data);+
+ }+
+ // Adds a DataSource using a physical schema file. This method require you to have schema file in RAS Server+
+ // box (NOT ON SDK BOX). In distributed environment where you have IIS on server A and RAS on server B,+
+ // and you execute CreateData above, schema file is created in IIS box, and this method will fail, because+
+ // RAS server cannot see that schema file on its local machine. In such environment, you must use method+
+ // above.+
+ void AddDataSourceUsingSchemaFile(+
+ ReportClientDocument rcDoc, // report client document+
+ string schema_file_name, // xml schema file location+
+ string table_name, // table to be added+
+ System.Data.DataSet data) // dataset+
+ {+
+ PropertyBag crLogonInfo; // logon info+
+ PropertyBag crAttributes; // logon attributes+
+ ConnectionInfo crConnectionInfo; // connection info+
+ CrystalDecisions.ReportAppServer.DataDefModel.Table crTable;+
+ // database table+
+ // create logon property+
+ crLogonInfo = new PropertyBag();+
+ crLogonInfo["XML File Path"] = schema_file_name;+
+ // create logon attributes+
+ crAttributes = new PropertyBag();+
+ crAttributes["Database DLL"] = "crdb_adoplus.dll";+
+ crAttributes["QE_DatabaseType"] = "ADO.NET (XML)";+
+ crAttributes["QE_ServerDescription"] = "NewDataSet";+
+ crAttributes["QE_SQLDB"] = true;+
+ crAttributes["QE_LogonProperties"] = crLogonInfo;+
+ // create connection info+
+ crConnectionInfo = new ConnectionInfo();+
+ crConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;+
+ crConnectionInfo.Attributes = crAttributes;+
+ // create a table+
+ crTable = new CrystalDecisions.ReportAppServer.DataDefModel.Table();+
+ crTable.ConnectionInfo = crConnectionInfo;+
+ crTable.Name = table_name;+
+ crTable.Alias = table_name;+
+ // add a table+
+ rcDoc.DatabaseController.AddTable(crTable, null);+
+ // pass dataset+
+ rcDoc.DatabaseController.SetDataSource(DataSetConverter.Convert(data), table_name, table_name);+
+ }+
+ void CreateReport()+
+ {+
+ int iField;+
+ // create ado.net dataset+
+ CreateData();+
+ // create report client document+
+ m_crReportDocument = new ReportClientDocument();+
+ m_crReportDocument.ReportAppServer = "127.0.0.1";+
+ // new report document+
+ m_crReportDocument.New();+
+ // add a datasource using a schema file+
+ // note that if you have distributed environment, you should use AddDataSourceUsingDataSet method instead.+
+ // for more information, refer to comments on these methods.+
+ AddDataSourceUsingSchemaFile(m_crReportDocument, xsd_path, "Customer", m_dataset);+
+ +
+ // get Customer Name and Country fields+
+ iField = m_crReportDocument.Database.Tables[0].DataFields.Find("Customer Name", CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault);+
+ m_crFieldCustomer = (Field)m_crReportDocument.Database.Tables[0].DataFields[iField];+
+ iField = m_crReportDocument.Database.Tables[0].DataFields.Find("Country", CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault);+
+ m_crFieldCountry = (Field)m_crReportDocument.Database.Tables[0].DataFields[iField];+
+ // add Customer Name and Country fields+
+ m_crReportDocument.DataDefController.ResultFieldController.Add(-1, m_crFieldCustomer);+
+ m_crReportDocument.DataDefController.ResultFieldController.Add(-1, m_crFieldCountry);+
+ // view report+
+ crystalReportViewer1.ReportSource = m_crReportDocument;+
+ }+
+ public Form1()+
+ {+
+ //+
+ // Required for Windows Form Designer support+
+ //+
+ InitializeComponent();+
+ // Create Report+
+ CreateReport();+
+ //+
+ // TODO: Add any constructor code after InitializeComponent call+
+ //+
+ }+//========================================================================= -
Error while creating materialized view which using database link
Helo!
I'm getting error "ORA-00942: table or view does not exist" when I want to create materialized view.
Details:
1. On destination database I create a database link:
CREATE DATABASE LINK SDATABASE
CONNECT TO MYUSER
IDENTIFIED BY MYUSERPASS
USING 'ORCL';
=> Command "SELECT * FROM TABLE1@SDATABASE" returns data normally!
2. On source database I create MATERIALIZED VIEW LOG:
CREATE MATERIALIZED VIEW LOG
ON TABLE1
WITH PRIMARY KEY
INCLUDING NEW VALUES;
3. Now, when I want to create MATERIALIZED VIEW on destination database:
CREATE MATERIALIZED VIEW TABLE1
REFRESH FAST
START WITH SYSDATE
NEXT SYSDATE + 1/1440
WITH PRIMARY KEY
AS SELECT * FROM TABLE1@SDATABASE;
...I get error "ORA-00942: table or view does not exist"!
How is that possible if command "SELECT * FROM TABLE1@SDATABASE" returns data normally?
Thanks,
VorancAnd, I'm using Oracle 10g.
Voranc
Maybe you are looking for
-
Unable to access claim digger in P6 Professional R8.3.2
Hi I cannot access claim digger in P6 Professional R8.3.2. The programme shows the following message: The selected application: c:\progra~1\java\jre1.7.0_15\bin\javaw.exe cannot be found. How could this problem be solved? Thanks
-
Upgrade 5510 ASA 7.0(7) ADSM 5.0(7)
I'm doing an upgrade this weekend, and a bit out of my realm at the moment. I have a 5510 running ASA 7.0(7) ADSM 5.0(7), and I'm not sure what I need to upgrade to, or what path to take. The ASA 5510 only has 256mb of RAM in it, so I see 8.3 is out
-
.Tiff files show as RAW files
I have an Olympus C-770 Ultra Zoom and have just shot some .Tiff files and loaded them into my 5th G. iPod via the Apple camera connector. They have shown up as RAW files for some unknown reason so I can't view them on the iPod. What is going on and
-
Logic receives MIDI but Mainstage WON'T!
Sorry this is sort of a repost but not quite... *(Midi port working in garageband but not in mainstage)* http://discussions.apple.com/thread.jspa?messageID=11179374� Mainstage 2.1.1 doesn't receive any MIDI from my controller. Audio-MIDI set
-
Can't login to Game Center after updating my iPad to iOS7
Hi there I can't seem to login to Game Center after updating my iPad. I don't know whether it's the update, or the fact that I forgot my password. Anyway, how do I get back into my account? Just to let you guys know, the email account I used to setup