Oracle designer - table definition - oracle

I've added a new table definition to a project folder and then created a primary key, however when I click on the 'columns' to create a key component its telling me no mandatory columns are in the Table Definition - create one or more mandatory columns. I've gone back to table definitions but I can't see how I do this and then assign columns to the Primary key?
Any help appreciated!!

Related

How to insert data into destination table without having any primary key in Talend

I am using talend for ETL I don't have enough experience in this, I am having two tables for example- account and account_roles account table is having id, name, password etc fields and account_roles table is having account_id which is f.k to account table's pk. and one more field.
Both the fields in account_roles are having duplicates, I want to save account_roles in destination with update and insert logic using talend.
But I am getting error as I don't have any table that can be treated as primary key in the account_roles table, so talend can't update or insert it.
How I deal with this situation I tried tDBOutput advance option use_field_option but still it requires unique entries.
Is there any possible solution to this issue, I also want to know if I can make table Foreign key in the account_roles table will it work then? If yes then How to make F.k in talend OPen studio is my second question.
Attaching Snapshots of my tables and tMap below -
I want to know the way I can put my tables into database if I don't have any primary key! Kindly help me.
First question
I think you should place the primary key in the physical account_roles table. Talend will use the key indication of the dbOutput component, and the physical key of the table.
In order to delete duplicates rows, you can also use a tUniqRow before the dbOutput: The key you indicate in the UniqRow is not directly linked to the database; this is only the key on which tUniqRow will be based.
Second question
It's not possible to delegate the f.k. verification to Talend. But you can do this verification in your database by placing foreign keys in your table. If an id is not present in the reference table, the database returns an error that is returned by Talend.

I don't understand. I'm trying to create the first table for a database in Oracle APEX

It's telling me to provide a FK and a table reference when there is no FK in the table, nor a relevant table to reference.
You do not need to define a FK. Just scroll down and click Next.

How to create form/report on a table which has only primary keys?

Im trying to create a form with a report on a table that has only primary keys.
I have a table:
create table WRITE
(
author varchar(5) references AUTHOR (authorcode) ,
book varchar(20) references BOOK (bookid),
primary key(author,book)
);
I'm using APEX Application Builder to create a form on a table with report;
But When I get to the "Select the columns to include in the form" , I have no options to select from because I only have unique primary keys in my table.
Which Apex version is it? I've tried it on apex.oracle.com which uses 19.1 and it doesn't have that problem.
Anyway, two options I can think of:
temporarily drop primary key constraint
then create report + form pages
after you're done, create the primary key constraint once again
create an interactive report (using the wizard)
then create a form, manually adding items
this isn't as easy as it looks like because you'll have to create all processes as well (initialization one, along with automatic row processing)
I presume that the first option is a lot simpler.

Webmatrix starter site userprofile fkey with othet table

I want to add to the UserProfile table of the StarterSite database created by the WebMatrix Starter Site template another column named email_pk (varchar 50) as primary key and add to id a foreign key constraint that references the Email column (varchar 50) of a new tb_contacts table. The latter column isn't a primary key.
When I try to do that manually in the WebMatrix Database workspace I get the following error:
There are no primary or candidate keys in the referenced table 'dbo.UserProfile' that match the referencing column list in the foreign key 'FK_tb_admin_user_UserProfile'.
Could not create constraint. See previous errors.
System.Data.SqlClient.SqlException (0x80131904): There are no primary or candidate keys in the referenced table 'dbo.UserProfile' that match the referencing column list in the foreign key 'FK_tb_admin_user_UserProfile'.
Could not create constraint. See previous errors.
at Microsoft.WebMatrix.DatabaseManager.SqlDatabase.SqlDatabaseProvider.EditTable(String connectionString, String schema, TableInfo tableInfo)
at Microsoft.WebMatrix.DatabaseManager.IisDbManagerModuleService.EditTable(DatabaseConnection databaseConnection, String schema, Object tableInfoData, String configPathState)
at Microsoft.WebMatrix.DatabaseManager.Client.ClientConnection.EditTable(String schema, Object tableInfoData)
at Microsoft.WebMatrix.DatabaseManager.Client.ClientTable.CommitChanges()
at Microsoft.WebMatrix.DatabaseManager.Client.TableDesignerViewModel.PerformSave()
ClientConnectionId:1da00f40-8f46-4c5b-b423-905c6990fd0d
If you want to add a foreign key to your UserProfile table, the referenced column must be a primary key or have a unique constraint.
You could manually add a unique constraint with a query like this:
ALTER TABLE tb_contacts
ADD UNIQUE (Email)
By the way, the New Relationship dialog of the WebMatrix Databases workspace displays as possible references only the tables with suitable primary keys.
Note that your StarterSite db alterations inhibit the use of the WebSecurity class.

Oracle Materialized View in Entitiy Framework issue

I have the following issue.
1. I created an Oracle Materialized View which contains the "WITH PRIMARY KEY" clause.
2. when I am trying to add that View to my EDMX, I encounter the following error:
"The table/view 'XXX' does not have a primary key defined and no valid primary key could
be inferred..."
Does anyone know how to add a primary key to Materialized View that can be added to EDMX?
Is this issue solvable ?
thanks,
Hagai
This clause refers to the materialised view including a primary key column from the master table, not that it possesses a primary key itself.
A materialised view is simply metadata on a regular (base) table, so you can perform an alter table command using the name of the the materialised view to create a primary key on the base table.

Resources