ORACLE ODI - ORA -00904-invalid-identifier - oracle

New to oracle. I have a dimension with a primary key. I create an interface. Mapping from staging area to analytics area. I set the primary key for target to execute on target. I click active mapping and set mapping to ROWNUM via the expression editor so the mapping looks like a screen shot I have.
When I execute I'm getting the above error and I've reached a dead end. Can anyone help? I don't want to map it to anything. I just want it to have a int ID created when records are inserted
Thanks
Debbie

Related

how to Insert SQL query from previous database table value to pass to another database table with dynamic value in Katalon

Hi any one can help me on this issue which i have problem insert a dynamic value which is from previous database table value to pass to another table in Katalon.
Please find my information below:-
This screenshot is ab.dbo.DOCUMENT table which DOCUMENT_ID is auto populate with value
which mean it will appear random number by itself.
Another screenshot is bc.dbo.DOCUMENT_IC table which i need to manually key in DOCUMENT_ID in
the value base on on what it is given from ab.dbo.DOCUMENT table DOCUMENT_ID.
Attached of a screenshot for bc.dbo.DOCUMENT_IC
In Katalon i am using a keyword to connect my database, insert query and close
connection. I am aware of this step and able to connect to database with katalon. But i
am not very sure how to pass a dynamic value from ab.dbo.DOCUMENT table DOCUMENT_ID which
it can randomly appear a number value to bc.dbo.DOCUMENT_IC table DOCUMENT_ID which i need to
manually key in a value base on the value given.
Below is my Katalon script:-
Hopefully someone can help me on this
Thank you.
If I have a table with an auto incrementing ID in one table and I need that value elsewhere I would typically write sql like this :
insert into firsttable (Document_Type) values ('PDF');
insert into secondtable (Document_ID, App_ref_Num) values (##Identity, 'somenumber')
In the databases I have worked with ##Identity will give you the integer or id of the last inserted row. If you can't run multiple statements most connection libraries will have something like a $conn->insert_id that will do the same thing as running select ##identity.

Can't create new columns, constraints, indexes using DBeaver 7 in MySQL 8

I'm attempting to create new tables and add new columns to an existing MySQL 8 database. I'd like to use DBeaver GUI for this task. Creating the new connection with the MySQL 8+ driver, I'm able to connect to my localhost using root user.
I'm able to load the database tables and explore their columns, constraints, properties, etc. But I'm not able to create new columns... I can't see any option similar to New column, New Table, etc. In MySQL Workbench, for example, one just has to right-click over the grid to be able to add new columns.
I've right-clicked everywhere and I've read all menus and I'm not able to find a way to insert something new using the GUI. It seems as if I was in a read-only connection. However, I didn't check Security: Read-only connection when creating the connection (double checked).
Under table properties, if I right-click and I select Generate SQL > INSERT I'm not able to type anything in the resulting window...
Testing my connection I got the following:
Connected (30 ms)
Server:
MySQL 8.0.21
Driver:
MySQL Connector/J mysql-connector-java-8.0.17 (Revision: 16a712ddb3f826a1933ab42b0039f7fb9eebc6ec)
Finally, in table properties, if I change the table description, click de Save button and then the Persist button, I'm able to update the description. What am I doing wrong then?
I'm missing something obvious for sure.
Thanks in advance.
You can make changes to your tables with SQL. Click on the 'New SQL Editor' button here:
Then type up your SQL:
ALTER TABLE db_name.my_table,
ADD COLUMN column_1 NULL,
ADD COLUMN column_2 TEXT,
ADD COLUMN first_name VARCHAR(255);
Make sure you check the syntax for your specific version of MySql, and when you've got what you want there, click the 'Execute SQL Script' button:
That should do the trick.
Checked on windows machine on DBeaver 21.3.2, right the respective table on which you want to add column, click on "create column" and then enter the name and default values of the column like Auto increment and not null etc.
Finally click save and persist those changes in the database if you are sure of the changes you did otherwise edit the column and then persist them.
Running on Linux but seeing the same issue. I was able to start adding columns in the left pane, in the Database Navigator. Open a table, then right mouse on a table and you will see the option to add a column. Thereafter you can add columns in the properties tab.

ORACLE APEX / SQL DEVELOPER: Cannot get PK to autoincrement

I am trying to implement my SQLDeveloper DB into Oracle APEX. I cannot figure out how to get the PK's in my table to auto-increment starting from a certain value (i.e. 400001). I have tried making triggers and sequences but when I try to add a row using a form in APEX, my PK increments from 40 for some reason.
Here is my APEX form outcome
enter image description here
Here is how it inserts into SQL Developer
enter image description here
Basically, can someone describe to me how I can edit the existing trigger, or create a sequence, that would make application_id of a new entry auto-increment by 1.
Thanks!
Find max application_id:
select max(application_id) From your_Table;
Suppose it is 400010 (as screenshot suggests). Now recreate the sequence (presuming its name is seq_app):
drop sequence seq_app;
create sequence seq_app start with 400011 increment by 1 nocache;
Trigger is most probably OK, as you see values being inserted into the table.
Side note: sequences will be unique, but not necessarily gapless. CACHE (or NOCACHE) might affect that, but - for performance sake, you'd rather let Oracle cache sequence numbers (default is 20) which means that - if you don't use some of those cached numbers, they will be lost. I wouldn't worry, if I were you.

Populate indexed table in Oracle using Informatica

I'm new to both Oracle and Informatica.
Currently working on a small task where I need to select all records from the source table, filter the results to get only records where field1='Y' and finally insert new rows into the target table that contains only src.field2 and src.field3 values.
These 2 fields are used for the PK and for the Index of the target table.
So i get an error in Informatica:
"ORA-26002: Table has index defined upon it"
I rather not dropping the index? is there a work around?
I've tried alter index to "unusable" but I got the same error.
Please advice.
Thanks.
Try to use Normal load mode instead of Bulk. You can set in session properties for the target.

Update actions from one sql table to another using Message Broker

i wanna use Wepshoere Message Broker to get the actions that any user perform on any table to be applied on another table
Example
1- User insert a record on Table x in TestDB
2- Message broker take this newly added record and add it to Table y in TestDB
could you support me with detailed information. and thanks in advance
I suggest you instead add an insert trigger to Table x, this is a normal function for database triggers.
It would help if you update your question with the DBMS and OS you are using.
You could approach this using a dbInput node to fire a message when the table is updated and then use normal ESQL or the mapping node to do the insert in the target table.
The key thing is going to be configuring your db input node correctly, you can get more info on how to do that here:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/bc34041_.htm

Resources