SNP_POP equivalent in ODI 12C? - groovy

I am trying to get the mapping details like expressions used, KM used ,etc. Previously in 11g ,I was able to query it from SNP_POP and SNP_POP_MAPPING. However in 12c these tables are empty. What're the equivalent tables for these two in 12C?
I am trying to edit the KM's of specific mappings through SNP tables instead of writing a Groovy script.

Interfaces have been replaced by mappings in 12c. You will find the mappings metadata in SNP_MAPPING and all the tables starting with SNP_MAP_. It's a bit more complex than interfaces because there could be a lot more components and multiples target tables.
Here is an example of a query to retrieve the target table names of a mapping : https://www.rittmanmead.com/blog/2016/02/di-tips-odi12c-repo-query-mapping-target-table/
You can find the repository documentation in this article : Doc ID 1903225.1 : Oracle Data Integrator 11g and 12c Repository Description
However I would strongly recommend not to change the KMs from the repository. Select statements on the repositories are allowed but DML statement are not supposed to happen and are not supported by Oracle.
A groovy script using the SDK is definitely the way to go. Luckily, it's already written for you : http://www.ateam-oracle.com/getting-groovy-with-odi-upgrades-and-owb-migrations/

Related

How Can I see the Sql query of the excel file I uploaded Oracle DB

I am learning pl/sql. I want to ask a question for importing excel files.
I create a table after that import data from excel nearly 100 rows.
I wonder how can i see this query basic like;
insert into table_name (column1,colum2,...,columnn )
values (value1, value2, ... , value n); and other 100 rows..
Sincerely
I'm not sure whether there is a feature within Oracle engine itself, but I can think of two ways to get those queries:
1. Use Oracle SQL Developer (Or another GUI with the same features) :
Oracle SQL Developer (Download link here) is a free tool developed by Oracle to interact with the database. Add the connection for your database and connect to it, then follow these guidelines carefully to generate your insert script.
2. Use v$sql (Experimental) :
Right now I have no access to an Oracle database to check this, but theoretically, if the database is a development/training one, there should not be a lot of activities and queries inside, so you can query the v$sql table to find the last 100 (or whatsoever) queries:
SELECT SQL_FULLTEXT FROM V$SQL WHERE ROWNUM < 1000 ORDER BY FIRST_LOAD_TIME desc;
Check for the ones starting with INSERT INTO {THE_TABLE_WHICH_HAS_IMPORTED_DATA} to find your insert lines.
As I mentioned, this method is quite experimental and might confuse you, so I strongly suggest using Oracle SQL Developer.

Getting the list of SQL select columns from JOOQ parser

I need to get the list of columns in a select using the JOOQ SQL parser. In the example below it would return the list with two entries: 'sk' and 'aa'. Debugging the program I can see in the Query.select field the list of columns, but I cannot find in the Query class a method to retrieve them. How to get the list of columns?
The Query object model returned by the jOOQ parser API does as of jOOQ 3.12 not provide any corresponding accessors. This feature is however planned for the next minor release (3.13).
The following answer gives you an example how you might be able to use the existing VisitListener SPI to achieve your goal: https://stackoverflow.com/a/54006668/1732086.

How to get list of all databases from arango console?

I do not see any function in help about getting all existing databases in ArangoDB.
To get the list of all existing databases from the Arango console (I am referring to the ArangoShell here), you can use:
db._databases();
In case you are looking for other methods: the shell has auto-completion, so you can type db. and then press the tab key. This will show the list of available properties/functions for the given object if it exists (and is a variable).

Loopback does not discover Oracle relations

Following
Loobback Docs: Discovering models from relational databases, Stackoverflow answer: Loopback not discovering models and Loopback datasource juggler API: Datasource I created a discover js script to get models from an oracle database. The problem is that it never managed to read the relations from the tables. I used the methods
discoverAndBuildModels - The result object had the properties of the table and an array called relations but that array was empty
discoverSchema - I managed to get the actual model JSON file and write it to the appropriate location. As the method is described in the api to not read relations i was not surprised to not find any here
discoverSchemas - Includes option to read relations (called relations but also tried it with associations) which gave me a similar result than discoverSchema but the "relations" tag only had an empty json object assigned to it.
I tried all options with a variety of relations and associations settings but none of them gave me anything but an empty object as the "relations" tag.
Am I missing something in the setup?
Oh boy, we've also had this issue. You just have to make sure that your user has the appropriated rights. Choose a privileged user (maybe admin?) to gather the data and it should work.
Check out this question for reference: How to query the permissions on an Oracle directory?

How to use SubSonic SimpleRepository with NON Plural Table Names

I have found out that SubSonic SimpleRepository expectes plural table names however I have started working on a database that doesn't have this and I am unable to change the table names.
Is there a way I can use Subsonic without making database changes?
I have seen one suggestion but I don't fancy that too much.
I'm not tied to using the SimpleRepository I just thought it would be easiest as I need the ability to swap database connections (SQL & Oracle) based on the clients requirements. The schema is the same on both. With SimpleRepository I can just swap out the connection string in the web.config.
You can apply the SubSonicTableNameOverride attribute on your classes you use with Simple Repo and use an arbitrary table name!

Resources