SQL & PL/SQL :: Insert Data Into View
Mar 27, 2010
I have created a view in that the primary key column is not included,so that we cannot insert data into that view,but i want to insert data into that view without using Instead of Triggers.
CM: swapped version and title so they're the right way round.
View 12 Replies
ADVERTISEMENT
Jul 9, 2010
The functionality I want to accomplish is accomplished at the database level by creating a select * view of a table in a remote database (through a database link) and inserting a record in the view and getting the update written to the remote table.
The issue is that the call must be made from an application using JDBC and the database is required to run dedicated not shared. If I can change either of those, I can get it to work but those are not acceptable solutions. Materialized views would be fine except that the remote system will not implement any master site requirements (they will not make any non-data changes).
The error is ORA-24777: use of non-migratable database link not allowed.
The current focus is on a stored procedure that the application would call that would write the insert/update/delete locally.
View 4 Replies
View Related
Mar 30, 2012
how to insert values through view.
View 5 Replies
View Related
Jun 13, 2012
I'm trying to insert data in my_second_table using a trigger and a view when I insert the data in my_first_table but there's something wrong in the code.
CREATE OR REPLACE TRIGGER my_trigger
AFTER INSERT ON my_first_table
FOR EACH ROW
BEGIN
[Code]...
I'm suspecting that the problem is in the :new.cod_emp
P.S.: I'm using: Oracle Database 11g Release 11.2.0.1.0 - 64bit Production on Enterprise Linux Server release 5.5 (Carthage)
View 15 Replies
View Related
May 15, 2010
how to insert data in oracle table without writing insert statement in oracle 9i or above. i am not going to write insert all, merge, sqlloder and import data.
View 2 Replies
View Related
Aug 5, 2011
I have a question related with VIEWS
I would like INSERT data in a VIEW with a INNER JOIN, like this example:
CODECREATE VIEW MYVIEW (order_id,list_price,customer_id) AS
SELECT order_id, list_price, customer_id FROM ORDERS o
INNER JOIN PRODUCT_INFO p ON (o.order_id= p.pdt_id);
INSERT INTO MYVIEW VALUES (4,500,10); /* will cause an error*/
But when I try to execute the insert statement, the "SQL Developer" returns a error:
ORA-01779 - "cannot modify a column which maps to a non key-preserved".
Why can't I do it? Are there some way to do it?
View 3 Replies
View Related
Feb 27, 2012
when i tried to insert the details from oracle froms..the data inserts twice to the DB..
my table structure:
create table app_sri
(a_id integer primary key,
p_first_name varchar2(30),
p_last_name varchar2(20),
p_age number(3)
);
here a_id can be genarated through simple sequence(pid_seq)...
trigger on app_sri
create or replace trigger pid_trg
[Code]....
form insertion code..
Begin
insert into app_sri(null,'robo','Big',100);
commit
End;
the data inserted...but twice
what is the reason behind the double insertion?
View 8 Replies
View Related
Aug 9, 2010
I've created a materialized view log on table with the following statement:
CREATE MATERIALIZED VIEW LOG ON table_a
WITH ROWID, SEQUENCE (column_a, column_b, column_c)
INCLUDING NEW VALUES;
The insert is done with the following statement:
INSERT
/*+ APPEND PARALLEL("table_a") */
INTO
"table_a"
("column_a",
"column_b",
"column_c",
"column_d_sum")
(select
column_a",
"column_b",
"column_c",
"column_d_sum"
from table_B)
But the Log is empty when the insert is finished. When I insert rows without the APPEND hint, rows are created in the log table. So, doesn't the log record bulk loads?
View 6 Replies
View Related
Feb 25, 2011
I'm in a situation where i have to design dynamical XML table that gonna get inserted in a view:
late'si consider the following table:
CREATE TABLE FB_XML
(
ID NUMBER(10) NOT NULL,
FB_ID NUMBER(10),
XMLCONTENT CLOB
)
the XML content field have content like the following:
XMLROOT(XMLELEMENT (
"Form",
XMLELEMENT ("elements",
(SELECT XMLAGG (
[code].......
so late consider for the first row i insert for the
* id:1
* fb_id : 25
* xmlcontent:
XMLROOT(XMLELEMENT (
"Form",
[code]........
the code works "fine" here but the xml in the fb_xml table is not EXECUTED it simply escaped by oracle , i know i should add something so that the XML have to execute and generate.
View 3 Replies
View Related
May 30, 2011
I created a data warehouse in oracle 10g n with three Dimension and one cube after that it crates 4 tables . How to use an insert sql statement to insert data in those tables n how to access them.
View 7 Replies
View Related
Aug 24, 2013
My scenario is I need to insert into History table when a record is been updated into a tabular form(insert the updated record along with the additional columns Action_by,Action_type(Like Update or delete) and Action Date Into History table i.e History table contains all the records as the main table which is been visible in tabular form along with these additional columns ...Action_by,action_type and action_date.
So now i dont want to create a befor/after update trigger on base table rather i would like to create a generic procedure which will insert the updated record into history table taking the page alias and pade ID as the parameters(GENERIC procedure is nothing but whcih applies to all the tabular forms(Tables) contained int he application ).
View 2 Replies
View Related
Nov 1, 2011
Question 1) I have read the following statement in a PL/SQL book.
Quote:To check whether an existing procedure is compiled for native execution or not, you can query the following data dictionary views:
[USER | ALL | DBA]_STORED_SETTINGS
[USER | ALL | DBA ]_PLSQL_OBJECTS
However, I when i query the view USER_PLSQL_OBJECTS I get the following error message:
Quote:ORA-00942: table or view does not exist
Question 2) I have read the PLSQL_WARNING can be set to DEFERRED at the system level. However, I am unable to defer it. tell me how to apply defer caluse to following statement:
Quote:ALTER SYSTEM SET PLSQL_WARNINGS ='DISABLE:ALL'
View 10 Replies
View Related
Jul 16, 2013
I want know how the values in view DBA_FEATURE_USAGE_STATISTICS gets updated i have already checked the metadata of this view but unable to find how / when the values are being updated.
View 3 Replies
View Related
Apr 14, 2011
I have a PL/SQL procedure which gathers data from multiple places as well as calculates some data. I want to store all this in a materialized view.
So, I created an object type (I've shortened the definitions):
CREATE OR REPLACE TYPE mf_record_type AS OBJECT
(identifier VARCHAR2(6),
name VARCHAR2(100));
Then created the table type of the object:
CREATE OR REPLACE TYPE mf_table_type IS TABLE OF mf_record_type;
Then in the stored procedure defined a variable of the table type:
v_mf_record mf_table_type := mf_table_type();
Then I loop and populate the record type:
v_mf_record.EXTEND(1);
v_mf_record(x) := mf_record_type(v_rec.identifier, v_mf_detail.name);
When all that is done I try and create the materialized view:
EXECUTE IMMEDIATE ('CREATE MATERIALIZED VIEW mf_snapshot_mv AS
SELECT * FROM TABLE (CAST (v_mf_record AS mf_table_type))');
ORA-00904: "V_MF_RECORD": invalid identifier
Am I doing something wrong here? Can't I create the materialized view based on something other than a physical table?
View 4 Replies
View Related
Jan 11, 2012
I have a column which holds the data in the below format.
Source Data :
>SNO_SDSDQ-8192-BN>SNO_54-99-24120-8192
>SNO_SDSDQ-8192-BN>SNO_54-99-24120-8192>SNO_54-90-16489-008G
>SNO_SDPMDB-008G-11>SNO_54-90-18008-008G>SNO_54-62-08791-008G>SNO_20-81-00327
>SNO_SDPMDB-008G-12>SNO_54-90-17830-008G>SNO_54-62-08598-008G>SNO_20-81-00327
[code]..
Problem Statement :
Split the above data into individual components and create columns / aliases dynamically.If the column is present then place the data under the created column.
Example 1) :
>SNO_SDSDQ-8192-BN>SNO_54-99-24120-8192
Result
Column Name : SKUCol_54-99
Data :SNO_SDSDQ-8192-BNSNO_54-99-24120-8192
Example 2)
>SNO_SDSDAA-002G-101-J>SNO_54-90-16002-002G>SNO_54-62-05781-002G>SNO_20-81-00135-5
Column Name : SKU54-90Col_54_62Col_20_81
Data :SNO_SDSDAA-002G-101-JSNO_54-90-16002-002GSNO_54-62-05781-002GSNO_20-81-00135-5
Column Name can be derieved from the components like SNO_54-62-05781-002G
i.e. SNO_54-62-05781-002G ==> SNO_-05781-002G
"54-62" will give the Col_Name
The First Column will always have data starting with
SNO_SD%
This column is constant and will be named as SKU.
I need this data to be placed in the same record / row but under different columns as per the data set.Basically, Can the data be split into multiple parts based on delimeters and the columns are created based on the unique data in the parts that form the data in the column.
View 1 Replies
View Related
Feb 27, 2012
How can i load the data into a new table from view,when ever scheduler runs in the night, the data gets loaded in to a view and data coming from different tables and i should load that data every day and i dont want previous data again.The data should be loaded along with view .
View 6 Replies
View Related
Jul 25, 2012
My boss make a requirement in exist database as some user can view salary column at employment table by SQL and some user can view salary column at employment table by SQL.
The boss do not like to make changes front SQL. Ooracle 11g vault or Oracle Label Security is best for this requirement?
my oS is 2008 32 bit window and DB is 11.2.0.1
View 4 Replies
View Related
Jan 26, 2010
Is it possible to use Data grid view in Forms6i just as in Visual Basic?
View 7 Replies
View Related
Nov 15, 2012
I have got a simple materialized view question.
I have a view which is taking long time to get back results and this view is being used in various user queries. I noticed that the SQL of the view access some tables, data of them changes rarely. So it makes sense to retrieve that data in a materialized view and somehow re-use it.
My question is how can I use the materialized view and it's data from a query.
View 2 Replies
View Related
Nov 22, 2011
I have a question how to do this.
I'm using JAVA class. I'm try to put "data" to database(INSERT data to database - PL/SQL).
I have simple JDBC problem:
Steps.
1) SELECT table_seq.NEXTVAL FROM DUAL;
(Question: How can I make sequence to table ? I see lot of examples on google but all is just to create sequence but not for table. Maybe sequence can be put on table ?)
2) INSERT table_seq.....
3) INSERT table (values) values ('data')
Tables look like this:
table1 [Where I need to take `id`]
------------
id .....
------------
table2 [Where I need this sequence to be taken]
------------
seq_id .....
------------
table2 [Where I need to put `seq_id` into table2.id and data]
------------
id data
------------
I don't get it why can't I just do this ?:
INSERT table2 (data) values ("this is data");
View 6 Replies
View Related
Aug 2, 2010
i have source table having 1000 records, i want insert first 100 rows in table1,second 200 rows in table2 and remaining row in table3.
View 12 Replies
View Related
Jan 21, 2013
I have the following XML structure .
I am new to using XML .
Any simplest and fastest way to extract or insert data from the below structure and insert in to oracle tables .
<id>
<id1> 123</id1>
<fe>
<fe1>1</fe1>
<fe2>1</fe2>
</fe>
[Code]....
View 2 Replies
View Related
Mar 25, 2010
I'm trying to insert data into a table, but can't seem to get the actual code right, when I put it in, Here is the code I have that is giving me the error:
INSERT INTO Orders VALUES('00001', 'c001', 'ca01', '20.5', TO_DATE('12032009', 'DDMMYYYY');
View 4 Replies
View Related
Jun 27, 2007
I have a form which has three detail portions. I want that when I press SAVE, it should insert data in two tables & then run the specific code & then insert data in other two tables.
I am using Developer 6i. Couldn't find out the proper trigger or related thing.
View 2 Replies
View Related
Jul 12, 2013
I have a database rac with two nodes. While inserting a row in the database, I am getting the following error: Error starting at line 1 in command:
INSERT INTO DocMeta(dID,xComments,xExternalDataSet,xIdcProfile,xPartitionId,xWebFlag,xStorageRule,xCpdIsTemplateEnabled,.........,xPageID,xNDDate) VALUES(7897,'','','WebStyle','','','default',0,.........,'',null)
Error report:SQL Error: ORA-29875: failed in the execution of the ODCIINDEXINSERT routineORA-20000: Oracle Text error:DRG-50857: oracle error in textindexmethods.ODCIIndexInsertORA-00604:
error occurred at recursive SQL level 1ORA-01950: no privileges on tablespace 'SYSAUX'ORA-06512: at "CTXSYS.DRUE", line 160ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 75129875. 00000 - "failed in the execution of the ODCIINDEXINSERT routine"*Cause:
Failed to successfully execute the ODCIIndexInsert routine.*Action: Check to see if the routine has been coded correctly. If I try inserting in the nodes individually, sometimes it gets inserted in one node. The other node gives above error. And at times, both nodes give the same error.
View 0 Replies
View Related
Oct 7, 2012
i have one table name called TRXN with 43gb data with primary key...i have other table named TRXN_P with 15gb data...some of the records of TRXN_P are already there in TRXN table....i want to insert that remaining data in TRXN_P into TRXN table?
how can i insert ?
View 6 Replies
View Related
May 4, 2013
i created and inserted data to my database using SQL plus. all tables has been created sucsefully and i can see them in OUI. but all tables rows shown empety(it means under the rows, column is empety not 0). now how can see the data which i inserted to tables ? can i see them in OUI?(web interface)
View 12 Replies
View Related
May 10, 2013
Is there a function that allows the following?
select SOME_FUNCTION('N','E','S','W') from dual;
That returns
N
E
S
W
Currently I'm just doing the following
WITH direction AS
(SELECT 'N' dir FROM DUAL
UNION
SELECT 'E' FROM DUAL
UNION
SELECT 'S' FROM DUAL
UNION
SELECT 'W' FROM DUAL)
SELECT *
FROM direction;
View 4 Replies
View Related
Nov 5, 2008
How I can create a Materialized View without having any data in it.
For e.g.
I create a Materialialized View based on a View.
CREATE MATERIALIZED VIEW test_mv
REFRESH FORCE ON DEMAND
AS
SELECT * FROM test_view
In the above case the data fetched by the view test_view gets stored in the Materialized View test_mv. Suppose I want materialized view test_mv to get created with all the columns of test_view but not the data. I will refresh the materialized view test_mv later for data as and when required.
What shall I do for immidiate formation of materialized view test_mv without data.
View 4 Replies
View Related
Jan 25, 2011
I have two tables:
Table 1:
CONTENT_ID number primary key,
URL VARCHAR2(1024) not null,
TITLE VARCHAR2(200) not null
Table 2:
CONTENT_ID number primary key,
URL VARCHAR2(1024) not null,
TITLE VARCHAR2(200) not null
Both tables are the same layout however I need to merge the data to a DB View on demand. What would the SQL look like to join like this?
View 7 Replies
View Related