I want to know if it's possible to create target attributes in ODI 12c directly in execution (temporary table maybe) without create each attribute in target table .
Because if we have a dimension with 200 attributes it wouldn't be funny to add each attribute singly .
Thank you.
yes you can!
just copy model from source database to target database in models in designer tab and on your map set create target table to true . But when your source and target database is different, You should consider datatypes in target model.
No it isn't possible in an ODI 12c mapping unfortunately.
That can be done in a reusable mapping though, by using an output signature. However output signature are not physically persisted the database, it's more like a subquery.
Related
I want to use several versions of databases (with tables, views, procedures) within one instance of MS SQL server. Let's say I have these databases:
db_dev1
db_dev2
db_dev3
...
db_dev10
I always have a current / stable version and want to create a kind of "link". Currently, "db_dev2" is stable and I want a "link" or alias "db_stable" and use all the tables, procedures,... of "db_dev2" but using the name "db_stable". In a filesystem like NTFS or EXT4 I would create a symbolic link. How can I do it within MS SQL server? When developments continues I would change the "link" to "db_dev3" and so on. Doing this I do not have to change the SQL code that access this database(s).
A workaround with a "hardlink" -- a copy of "db_dev2" to be renamed as "db_stable" -- would be no good solution for me since the databases are quite big.
You can use synonyms. Unfortunately you cannot create a synonym for a database.
But you can create a "empty" database db_stable that has synonyms for all the objects.
Just write some script to create/alter the synonyms for every object.
I am attempting to create an indexed view on SQL Server 2008. I have a master database in which I cannot make any changes to (in terms of adding tables, views, etc.). However, I need to create some different views for various reasons that need to work with live data.
I have created a new database along side my master database so I can create views there. I am able to create views just fine, but I want to index some of the larger views. However, when I try to create a schema bound view cross-database, I receive the following error:
Cannot schema bind view 'dbo.Divisions' because name
'master.dbo.hbs_fsdv' is invalid for schema binding. Names must be in
two-part format and an object cannot reference itself.
Since I am going cross-database with the views, I have to reference the name in three-part format.
My creation statement for the view:
CREATE VIEW dbo.Divisions WITH SCHEMABINDING AS
SELECT master.dbo.hbs_fsdv.seq_ AS DivisionID,
master.dbo.hbs_fsdv.fs_division_desc_ AS Description
FROM master.dbo.hbs_fsdv
How can I create an indexed cross-database view in SQL Server?
Plain and simple. You can't. From the MSDN page:
The view must reference only base tables that are in the same database as the view.
https://msdn.microsoft.com/en-us/library/ms191432.aspx
Although (per the docs) it cannot be done directly with a simple SQL statement, this use case is very common and has a solution.
The architecture would have to involve caching the remote tables into your centralized database, and building the indexed view on top of them.
Some good notes on this can be found here:
What is the best way to cache a table from a (SQL) linked server view?
and
https://thomaslarock.com/2013/05/top-3-performance-killers-for-linked-server-queries/
I'm trying to copy a database for use in testing/developing, in SQLDeveloper I can only see the user views, the data objects are not accessible for me.
Is there anyway to copy the views only and get a dll that creates some sort of phantom structure for the data objects that are not reachable but referenced in the sql queries for those views? Problem is there are over a thousand such references,
In the example below I cannot reach the header object due too permissions,
Example:
CREATE OR REPLACE FORCE VIEW "TRADE"."EXCHANGE" ("MSGQUE", "MSGQUE2") AS
select msgque, msgque2
from head.msgqueues;
I have tryed to export the views in SQL developer but when I import it in my Oracle test database the views contain error and are unusable because the data object did not get exported in the export.sql file,
Thanks in advance
I recommend using the expdp utility to perform this. You can explicitly say to grab views and tables.
Example parfile:
SCHEMAS=SCOTT
INCLUDE=TABLE:"IN ('DEPT')"
INCLUDE=VIEW
DIRECTORY=datapump
DUMPFILE=dept.dmp
LOGFILE=dept.log
Then you can impdp that parfile into the DB you wish and you will have the TABLE and the VIEW that goes in the schema. You can modify the IN clause to grab whatever naming scheme you would need.
I have normal sqlite database and want to use fts3.
As mentioned in http://www.sqlite.org/fts3.html tutorial FTS table has to be created for using this search functionality.
Is there any way to convert existing table to FTS table?
I think the solution is to populate the FTS virtual table by yourself. I mean to open a new thread which will read from the exist database then write to the FTS table.
Actually, I might find a better way, hope you are still watching this thread:
Please check this thread:
SQLite create pre-populated FTS table
where the selected answer gave a better approach:
first do CREATE VIRTUAL TABLE in your exist database,
then populate the virtual table using the original table within your database.
I am not at all familiar with Oracle so bear with me!
I am using version Oracle 10G with the web front end called Enterprise Manager. I have been given some CSV files to import however when I use the Load Data from User Files option I think I can set everything up but when the job runs it complains that there are unique constraints, I guess because there is duplicate data trying to be inserted.
How can I get the insert to create a new primary key similar to a MSSQL auto inc number?
Oracle does not have an analog to the MSSQL auto incrementing field. The feature has to be simulated via triggers and Oracle sequences. Some options here are to:
create a trigger to populate the columns you want auto incremented from a sequence
delete the offending duplicate keys in the table
change the values in your CSV file.
You might look at this related SO question.
There is no autoinc type in Oracle. You have to use a sequence.
By using a before insert trigger, you could get something similar to what you get by using an autoinc in SQL Server.
You can see here how to do it.