Error in Insertion through procedures
Dear all,
I executed below procedure without error, but the rows are not inserted in the table...........
create or replace procedure pq_demo
is
cursor cr_rad is select * from rad where radius<10;
cr_val cr_rad%rowtype;
area number;
begin
open cr_rad;
fetch cr_rad into cr_val;
while(cr_rad%NOTFOUND)
loop
--cr_val.sal:=cr_val.sal+(0.10*cr_val.sal);
dbms_output.put_line('Hello');
area:=3.14159*power(cr_val.radius,2);
dbms_output.put_line(cr_val.radius||' : '||area);
insert into area values(cr_val.radius,area);
fetch cr_rad into cr_val;
end loop;
close cr_rad;
commit;
end;
Why dont you simply use a insert, Why are you complicating things by using cursors ,loops etc.
isnt the below very simple?
CREATE OR REPLACE PROCEDURE pq_demo
IS
BEGIN
INSERT INTO area
SELECT radius, 3.14159 * POWER ( radius, 2)
FROM rad
WHERE radius < 10;
COMMIT;
END;G.
Similar Messages
-
Hi,
I want to insert into another table based on join condition between driver and detail table .I have tried with below code but no records are being loaded into Target table .
1 create or replace procedure test as
2 v_empno number;
3 v_ename varchar2(20);
4 v_dname varchar2(20);
5 v_loc varchar2(20);
6 v_job varchar2(20);
7 v_deptno number;
8 v_msg varchar2(100);
9 cursor c1 is select empno,ename,job,deptno into v_empno,v_ename,
10 v_job,v_deptno from emp;
11 begin
12 select dname,loc into v_dname,v_loc from dept where deptno=v_deptno;
13 exception
14 when no_data_found then
15 v_msg:='No data exist beween source and reference table';
16 when too_many_rows
17 then
18 v_msg:='There are many rows for single row';
19 --when others
20 --then
21 --v_msg:='unexpected error(code: '||SQLCODE ||');
22 --end;
23 --begin
24 insert into emp_t values(v_empno,v_ename,v_job,v_dname,v_loc);
25 COMMIT;
26* end;
SQL> /
Procedure created.
SQL> SELECT * FROM EMP_T;
no rows selected
SQL> EXEC TEST;
PL/SQL procedure successfully completed.
SQL> SELECT * FROM EMP_T;
no rows selected
Thanks and Regards,
MMHi!
If u want to take department name and location in ur table then u've to modify the cursor --
Old Cursor
cursor c1
is
select empno,ename,job,deptno
from emp;
New Cursor
cursor c1(deno in number)
is
select empno,ename,job,deptno
from emp a, dept b
where a.deptno = b.deptno
and deptno = deno;And in that case the STEP -2 will as follows --
SQL> ed
Wrote file afiedt.buf
1 create or replace procedure test_satyaki(depno in number)
2 as
3 v_dname varchar2(20);
4 v_loc varchar2(20);
5 v_msg varchar2(100);
6 cursor c1
7 is
8 select empno,ename,job,deptno
9 from emp;
10 rec1 c1%rowtype;
11 begin
12 select dname,loc
13 into v_dname,v_loc
14 from dept
15 where deptno=depno;
16 exception
17 when no_data_found then
18 v_msg:='No data exist beween source and reference table';
19 when too_many_rows then
20 v_msg:='There are many rows for single row';
21 --when others
22 --then
23 --v_msg:='unexpected error(code: '||SQLCODE ||');
24 --end;
25 open c(depno);
26 loop
27 fetch c1 into rec1;
28 exit when c1%notfound;
29 insert into emp_t values(rec1.empno,rec1.ename,rec1.job,rec1.deptno);
30 end loop;
31 close c1;
32 COMMIT;
33* end;
SQL> / Hope this will clear ur confusion.
Regards.
Satyaki De.
Message was edited by:
Satyaki_De -
ERROR WHILE INSERTING BLOBS AS PARAMETERS OF EXISTING STORED PROCEDURE
I have 2 simple tables to keep large application data (as XMLDOCUMENT in one table and BLOB in another):
SQL> desc bindata_tbl;
Name Null? Type
BDATA_ID NOT NULL NUMBER(10)
BDATA NOT NULL BLOB
SQL> desc metadata_tbl;
Name Null? Type
MDATA_ID NOT NULL NUMBER(10)
MDATA NOT NULL SYS.XMLTYPE
and stored preocedure to input new data into those tables:
"SP_TEST_BIN_META_DATA"
i_MetaData in METADATA_TBL.MDATA%TYPE,
i_BinData in BINDATA_TBL.BDATA%TYPE
as
begin
if i_MetaData is not null then
insert into METADATA_TBL (MDATA_ID, MDATA)
values (METADATA_SEQ.nextval, i_MetaData);
end if;
if i_BinData is not null then
insert into BINDATA_TBL (BDATA_ID, BDATA)
values (BINDATA_SEQ.nextval, i_BinData);
end if;
COMMIT;
-- Handle exceptions
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
RAISE;
end;
I communicate with database from .Net application using "Oracle.DataAccess 10.1.0.200 (Runtime version v1.0.3705)" component.
Following procesure is a [simplified] examlple of the code I use, which demonstrates the errors while inserting XMLDOCUMENT and BLOB values simultaneously.
In my application those should be quite big objects (~200 K XML and ~5-25M binary image data), but following sample keeps failing even with very small-sized objects:
Line Number
1 private void PureTest()
2 {
3 OracleConnection conn = null;
4 OracleTransaction tx = null;
5 OracleCommand command = null;
6
7 try
8 {
9 // Open connection
10 string strConn = "Data Source=AthenaWf; User ID=AthenaWf; Password=Poseidon";
11 conn = new OracleConnection( strConn );
12 conn.Open();
13
14 // Begin transaction (not sure if really needed)
15 tx = conn.BeginTransaction();
16
17 // Create command
18 string strSql = "SP_TEST_BIN_META_DATA";
19 command = new OracleCommand();
20 command.Connection = conn;
21 command.CommandText = strSql;
22 command.CommandType = CommandType.StoredProcedure;
23
24 // Create parameters
25 // 1) XmlType parameter
26 string strXml = "<?xml version=\"1.0\"?><configuration testValue=\"123456789\"/>";
27 XmlDocument xmlDoc = new XmlDocument();
28 xmlDoc.LoadXml( strXml );
29 OracleXmlType oraXml = new OracleXmlType( conn, xmlDoc );
30 //oraXml = null;
31 //
32 OracleParameter xmlPrm = new OracleParameter();
33 xmlPrm.ParameterName = "i_MetaData";
34 xmlPrm.Direction = ParameterDirection.Input;
35 xmlPrm.OracleDbType = OracleDbType.XmlType;
36 xmlPrm.Value = oraXml;
37 command.Parameters.Add( xmlPrm );
38
39 // 2) Blob type
40 byte[] buf = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
41 OracleBlob oraBlob = new OracleBlob( conn, true );
42 //oraBlob.Write( buf, 0, buf.Length );
43 oraBlob = null;
44 //
45 OracleParameter blobPrm = new OracleParameter();
46 blobPrm.ParameterName = "i_BinData";
47 blobPrm.Direction = ParameterDirection.Input;
48 blobPrm.OracleDbType = OracleDbType.Blob;
49 blobPrm.Value = oraBlob;
50 command.Parameters.Add( blobPrm );
51
52
53 // Execute command finally
54 command.ExecuteNonQuery();
55 tx.Commit();
56 }
57 catch( Exception ex )
58 {
59 // Clean-up
60 if( command != null )
61 {
62 command.Dispose();
63 }
64 if( tx != null )
65 {
66 tx.Dispose();
67 }
68 if( conn != null )
69 {
70 conn.Dispose();
71 }
72
73 // Display error message
74 MessageBox.Show( ex.Message, "Error" );
75 }
76 }
If I try insert only XMLDOCUMENT object (lines 30, 42 are commented out, 43 IS NOT) - everything is OK.
If I try to insert only BLOB object (lines 30, 42 are NOT COMMENTED OUT, line 43 is commented out) - everything is OK again.
If I try to insert them both having some values (lines 30, 43 are commented out, 42 is not commented out) - it fails right on "command.ExecuteNonQuery();" (line 54)
with the following exception:
"ORA-21500: internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%]".
Even when I nullify oraBlob before assigning it to OracleParameter value (line 30 is commented out, line 42 and 43 are not) I have the same exception.
XMLDOCUMENT and DLOB data logically are very coupled objects (in my application), so I really want to insert them simultaneously in one stored procedure in transactional way.
Is it bug of drivers, server, .net environment, or I miss something in implementation?
PS. In some articles on Oracle web and in MSDN site I found a mention about necessity of wrapping all write/update operations in a transaction, while working with temporary LOBs. I use it here, but it does not look like changing anything.Hello,
I tested your code with the 10.1.0.4.0 ODP and 10.1.0.4.0 Client and it worked fine.
Can you please apply the 10.1.0.4.0 patches for both ODP and client to see if this resolves the issue for you.
Here is the output from the same execution of the ODP application you provided as a testcase. These rows were inserted at the same time when I executed the application and passed the data as parameters to the SP you provided.
Results of Testing with 10.1.0.4.0
==========================
SQL> select count(*) from BINDATA_TBL
2 ;
COUNT(*)
1
SQL> select count(*) from METADATA_TBL;
COUNT(*)
1
SQL> select dbms_lob.getlength(bdata) from BINDATA_TBL;
DBMS_LOB.GETLENGTH(BDATA)
10
SQL> select mdata from METADATA_TBL;
MDATA
<?xml version="1.0"?><configuration testValue="123456789" /> -
Insert Into Vs Insert through a Procedure
Hi All,
I want to make a comparison between insertion into a table through normal insert into staement and through a procedure.
I create a table call test_table with 6 columns and a procedure to insert in that table.
I opened a session that make normal insert for 32 times and another session that uses the procedure to insert for 39 times. My experience says that insertion through a procedure is faster than normal insert into statement. but when i make trace for both sessions here is the results:
Session1(Normal Insert)
INSERT INTO TEST_TABLE
VALUES(:"SYS_B_0", :"SYS_B_1", :"SYS_B_2", :"SYS_B_3", :"SYS_B_4", :"SYS_B_5")
call count cpu elapsed disk query current rows
Parse 32 0.00 0.00 0 0 0 0
Execute 32 0.01 0.02 0 32 129 32
Fetch 0 0.00 0.00 0 0 0 0
total 64 0.01 0.03 0 32 129 32
Misses in library cache during parse: 1
Optimizer mode: CHOOSE
Parsing user id: 125 (CALLCNTR44)
Rows Execution Plan
0 INSERT STATEMENT MODE: CHOOSE
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 32 0.00 0.00 0 0 0 0
Execute 32 0.01 0.02 0 32 129 32
Fetch 0 0.00 0.00 0 0 0 0
total 64 0.01 0.03 0 32 129 32
Misses in library cache during parse: 1
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 0 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 0 0.00 0.00 0 0 0 0
Misses in library cache during parse: 0
32 user SQL statements in session.
0 internal SQL statements in session.
32 SQL statements in session.
1 statement EXPLAINed in this session.
Trace for Session2(Procedure Insert)
BEGIN sec1.INSERT_INTO_TEXT_TABLE (); END;
call count cpu elapsed disk query current rows
Parse 39 0.04 0.00 0 0 0 0
Execute 39 0.00 0.00 0 0 0 39
Fetch 0 0.00 0.00 0 0 0 0
total 78 0.04 0.01 0 0 0 39
Misses in library cache during parse: 1
Optimizer mode: CHOOSE
Parsing user id: 125 (CALLCNTR44)
INSERT INTO TEST_TABLE
VALUES('TEST COL1', 'TEST COL2', 'TEST COL3', 'TEST COL4', 'TEST COL5', 'TEST COL6')
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 39 0.03 0.00 0 0 80 39
Fetch 0 0.00 0.00 0 0 0 0
total 39 0.03 0.00 0 0 80 39
Misses in library cache during parse: 0
Optimizer mode: CHOOSE
Parsing user id: 474 (SEC1) (recursive depth: 1)
Rows Execution Plan
0 INSERT STATEMENT MODE: CHOOSE
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 117 0.04 0.02 0 0 0 0
Execute 117 0.03 0.03 0 0 0 78
Fetch 39 0.03 0.00 0 312 0 0
total 273 0.10 0.06 0 312 0 78
Misses in library cache during parse: 3
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 2 0.00 0.00 0 0 0 0
Execute 41 0.04 0.01 0 0 80 39
Fetch 2 0.00 0.00 1 5 0 2
total 45 0.04 0.02 1 5 80 41
Misses in library cache during parse: 2
118 user SQL statements in session.
2 internal SQL statements in session.
120 SQL statements in session.
1 statement EXPLAINed in this session.
So in session 2 parsing of the procedure it self is still done in each execution but for the statment inside it no and in session1 parsing for the insert is done for every execution. So does this proof my knowledge or it is wrong?
I see that instead of parsing the insert in session1 there is parsing for the procedure in session2 is that correct?
Thanks in advanceTomy3k_Bakr, you are doing the comparison wrong. Are you running these from sqlplus over and over again? Sqlplus parses every statement you send, this is not the correct way to compare.
Try this instead.
YAS@10G>create table t (a number,b number,c number);
Table created.
YAS@10G>r
1 create or replace procedure insert_t(pa number,pb number,pc number) as
2 begin
3 insert into t values(pa,pb,pc);
4* end;
Procedure created.Run this and see the results.
exec RUNSTATS_PKG.rs_start;
begin
for i in 1..10000 loop
insert /*+ sql */ into t values(i,i,i);
end loop;
end;
exec RUNSTATS_PKG.rs_middle;
begin
for i in 1..10000 loop
insert_t(i,i,i);
end loop;
end;
exec RUNSTATS_PKG.rs_stop;
Run1 ran in 124 hsecs
Run2 ran in 139 hsecs
run 1 ran in 89.21% of the time
Name Run1 Run2 Diff
LATCH.list of block allocation 1 0 -1
STAT...redo ordering marks 92 91 -1
STAT...table scans (short tabl 3 2 -1
LATCH.session idle bit 27 26 -1
LATCH.In memory undo latch 0 1 1
LATCH.file cache latch 3 2 -1
LATCH.redo allocation 8 7 -1
LATCH.archive process latch 1 0 -1
LATCH.Consistent RBA 2 3 1
LATCH.lgwr LWN SCN 3 2 -1
LATCH.mostly latch-free SCN 3 2 -1
LATCH.KMG MMAN ready and start 1 0 -1
LATCH.compile environment latc 3 2 -1
LATCH.session timer 0 1 1
LATCH.shared pool 2 3 1
STAT...change write time 11 12 1
STAT...table scan blocks gotte 6 4 -2
STAT...messages sent 2 4 2
STAT...data blocks consistent 3 1 -2
LATCH.channel operations paren 8 6 -2
STAT...rollbacks only - consis 3 1 -2
STAT...cleanout - number of kt 27 31 4
STAT...index fetch by key 6 2 -4
STAT...cluster key scans 6 2 -4
STAT...active txn count during 27 31 4
STAT...deferred (CURRENT) bloc 6 2 -4
STAT...consistent changes 20 24 4
STAT...consistent gets - exami 39 35 -4
STAT...session cursor cache hi 11 7 -4
STAT...CR blocks created 6 2 -4
STAT...commit cleanouts succes 6 2 -4
STAT...commit cleanouts 6 2 -4
STAT...workarea memory allocat 5 1 -4
STAT...calls to kcmgcs 27 31 4
STAT...execute count 10,014 10,009 -5
LATCH.active checkpoint queue 5 0 -5
STAT...opened cursors cumulati 14 8 -6
STAT...db block changes 20,324 20,318 -6
LATCH.redo writing 14 8 -6
STAT...parse count (total) 14 8 -6
STAT...CPU used when call star 131 138 7
STAT...calls to kcmgas 101 94 -7
LATCH.undo global data 50 43 -7
STAT...no work - consistent re 15 7 -8
LATCH.dml lock allocation 12 4 -8
STAT...DB time 132 140 8
STAT...cluster key scan block 12 4 -8
LATCH.library cache lock 16 8 -8
STAT...buffer is not pinned co 12 4 -8
LATCH.messages 27 17 -10
STAT...db block gets from cach 10,484 10,473 -11
STAT...db block gets 10,484 10,473 -11
STAT...enqueue releases 24 13 -11
STAT...enqueue requests 24 13 -11
STAT...recursive cpu usage 96 107 11
STAT...Elapsed Time 127 140 13
LATCH.enqueues 35 22 -13
STAT...redo entries 10,181 10,195 14
STAT...CPU used by this sessio 124 138 14
LATCH.library cache pin 20,072 20,056 -16
LATCH.cache buffers lru chain 135 153 18
STAT...table scan rows gotten 54 36 -18
STAT...calls to get snapshot s 37 19 -18
LATCH.library cache 20,094 20,073 -21
LATCH.enqueue hash chains 50 26 -24
STAT...bytes received via SQL* 1,210 1,185 -25
STAT...consistent gets 91 63 -28
STAT...consistent gets from ca 91 63 -28
STAT...free buffer requested 118 152 34
STAT...session logical reads 10,575 10,536 -39
LATCH.row cache objects 153 106 -47
LATCH.checkpoint queue latch 57 0 -57
LATCH.SQL memory manager worka 73 6 -67
LATCH.cache buffer handles 16 84 68
STAT...recursive calls 10,132 10,053 -79
LATCH.object queue header oper 334 437 103
LATCH.cache buffers chains 51,652 51,526 -126
LATCH.session allocation 258 104 -154
STAT...free buffer inspected 448 188 -260
LATCH.simulator lru latch 440 865 425
LATCH.simulator hash latch 458 892 434
STAT...hot buffers moved to he 1,222 276 -946
STAT...undo change vector size 684,064 682,932 -1,132
STAT...redo size 2,586,108 2,583,908 -2,200
Run1 latches total versus runs -- difference and pct
Run1 Run2 Diff Pct
94,017 94,489 472 99.50%For runstats see http://asktom.oracle.com/tkyte/runstats.html. -
Inserting the column values into table from view through procedure!!!
below is my example code
Create or replace procedure test_proc
is
cursor test_cur is
select a.col1 , b.col2, c.col3, d.col4, e.col5
from tableA a, tableB b, tableC c, tableD d, tableE e;
test_cur_rec test_cur%rowtype;
Begin
insert into test_stg ( col1, col2, col3, col4, col5, col6, col7)
Values ( test_cur_rec. col1,
test_cur_rec .col2,
test_cur_rec .col3,
test_cur_rec .col4,
test_cur_rec .col5
-- col6, col7 );
create view test2 (
select f.col6, g.col7 from tableF f,tableG g);
I m trying to insert values into the table test_stg but for col6 and col7 i need to get the data from the view test2.
In simple word, all i need to do is get the 2 columns data from view and insert into a table through procedure. The above code is the example which looks very much like my actual code.
How do i accomplish this task ??well there is joining condition for a, b,c ,d, e tables, i have not mentioned here. The where condition has nothing to do with the other two columns of the view.
There is no relation ship between the these tables the view. The col 6 and 7 i m inserting from view is sysdate timestamp and the job_id number.
so its pretty straight forward insertion into the table from view columns. These two columns has just one row with id number and timestamp. so i need to insert these data into the the table when i run a procedure.
Thank you so much!!! -
Error While executing a procedure
Hello FOlks,
When i try to execute this procedure below i get the error saying "Compiled with errors"
ORA--00942-Table or View does not exist
SQL Statement ignored at Line 17.
I tried querying the table and it returns no data. How do i debug this error.
create or replace procedure Load_FADM_Staging_Area_test(p_data_load_date date) is
v_start_date date;
v_end_date date;
begin
if p_data_load_date is null then
select (sysdate - 7), (sysdate - 1) into v_start_date, v_end_date from dual;
elsif p_data_load_date is not null then
select (p_data_load_date - 7), (p_data_load_date - 1) into v_start_date, v_end_date from dual;
else
raise_application_error('-20042', 'Data control - GetDataControlAuditData : Date parameter must be a date of this or a previous week.');
end if;
insert into STAGE_FADM_HRI_STAGE_BILL
(select
a.batch_id
,a.beginning_service_date
,a.bill_id
,a.bill_method
,a.bill_number
,a.bill_received_date
,a.bill_status
,a.bill_type
,a.change_oltp_by
,a.change_oltp_date
,a.client_datafeed_code
,a.client_id
,a.created_date
,a.date_of_incident
,a.date_paid
,a.deleted_oltp_by
,a.deleted_oltp_date
,a.duplicate_bill
,a.ending_service_date
,a.event_case_id
,a.event_id
,a.from_oltp_by
,a.oltp_bill_status
,a.review_status
,'HRI' schema_name
, sysdate Load_date
,'ETLPROCESS001' Load_user
,sysdate
from stage_bill@hri1_read_only_remote a
where
--created_date >= to_date('20101031 235959', 'YYYYMMDD HH24MISS')
created_date >= v_start_date
and
--created_date <= to_date('20101111 235959', 'YYYYMMDD HH24MISS')
created_date <= v_end_date
and not exists
(select
b.batch_id
,b.beginning_service_date
,b.bill_id
,b.bill_method
,b.bill_number
,b.bill_received_date
,b.bill_status
,b.bill_type
,b.change_oltp_by
,b.change_oltp_date
,b.client_datafeed_code
,b.client_id
,b.created_date
,b.date_of_incident
,b.date_paid
,b.deleted_oltp_by
,b.deleted_oltp_date
,b.duplicate_bill
,b.ending_service_date
,b.event_case_id
,b.event_id
,b.from_oltp_by
,b.oltp_bill_status
,b.review_status
,b.Row_Effective_Date
from STAGE_FADM_HRI_STAGE_BILL b))
select
e.action_plan e_action_plan
,e.action_plan_status e_action_plan_status
,e.batch_id e_batch_id
,e.client_cause_code e_client_cause_code
,e.client_id e_client_id
,e.client_datafeed_code e_client_datafeed_code
,e.client_policy_identifier e_client_policy_identifier
,e.close_date e_close_date
,e.created_date e_created_date
,e.date_of_incident e_date_of_incident
,e.date_typed e_date_typed
,e.discovery_source e_discovery_source
,e.employer_group_id e_employer_group_id
,e.event_id e_event_id
,e.event_status_code e_event_status_code
,e.event_type_code e_event_type_code
,e.exclude_from_invoice e_exclude_from_invoice
,e.from_ncoa_date e_from_ncoa_date
,e.group_contract_funding_type e_group_contract_funding_type
,e.hmo_ppo_indemnity_type e_hmo_ppo_indemnity_type
,e.insurance_product_name e_insurance_product_name
,e.insured_termination_date e_insured_termination_date
,e.invoice_date e_invoice_date
,e.letter_status e_letter_status
,e.letter_status_date e_letter_status_date
,e.liability_analysis e_liability_analysis
,e.loss_city e_loss_city
,e.loss_description e_loss_description
,e.loss_state_code e_loss_state_code
,e.manually_moved e_manually_moved
,e.moved_by_user_id e_moved_by_user_id
,e.ncoa_code e_ncoa_code
,e.next_steps e_next_steps
,e.open_date e_open_date
,e.policy_holder_address1 e_policy_holder_address1
,e.policy_holder_address2 e_policy_holder_address2
,ec.action_plan
,ec.action_plan_status
,ec.batch_id
,ec.case_status_code
,ec.client_datafeed_code
,ec.client_id
,ec.client_party_identifier
,ec.close_date
,ec.created_date
,ec.damaged_party_address1
,ec.damaged_party_address2
,ec.damaged_party_city
,ec.damaged_party_dob
,ec.damaged_party_first_name
,ec.damaged_party_gender
,ec.damaged_party_last_name
,ec.damaged_party_ssn
,ec.damaged_party_state_code
,ec.damaged_party_zip
,ec.deductible
,ec.deductible_applied
,ec.deductible_recovered
,ec.deductible_recovered_full
,ec.event_case_id
,ec.event_id
,ec.fee_schedule_code
,ec.internal_coverage_code
,ec.litigation_flag
,ec.loss_injury_description
,ec.next_steps
,ec.open_date
,ec.payment_coverage_code
,ec.pursuit_level_code
,ec.reject_code
,ec.reject_comments
,ec.reject_date
,ec.reject_date
,ec.reject_user_id
,ec.setup_type
,ec.tot_paid_at_close
,eccf.Client_field_data eccf_client_fleld_data
,eccf.Client_field_name eccf_client_field_name
,eccf.Client_id eccf_client_id
,eccf.Event_case_id eccf_event_case_id
,ecf.client_field_data ecf_client_field_data
,ecf.client_field_name ecf_client_field_name
,ecf.client_id ecf_client_id
,ecf.event_id ecf_event_id
from
event@hri1_read_only_remote e,
event_case@hri1_read_only_remote ec,
event_case_client_field@hri1_read_only_remote eccf,
event_client_field@hri1_read_only_remote ecf,
stg_fadm_hri_stage_bill sb
where
e.event_id = ec.event_id and
e.event_id = ecf.event_id and
ec.event_case_id = eccf.event_case_id and
e.event_id = ecf.event_id and
e.client_id = ecf.client_id and
e.client_id = ec.client_id and
ec.client_id = ecf.client_id and
e.event_id = sb.event_id and
ec.event_case_id = sb.event_case_id and
eccf.event_case_id = sb.event_case_id and
ecf.event_id = sb.event_id;
end Load_FADM_Staging_Area_TEST;Just noticed
I tried querying the table and it returns no data.Could be your NOT EXISTS clause, you are missing something? - "Something" exists, unless the table is empty.
Should probably be something like:
AND NOT EXISTS (SELECT NULL -- You are actually not selecting anything, just probing for existence
WHERE <<Correlation to table "a">>Furthermore, you'll never manage to compile the procedure since your second select does not select INTO anything.
(A more apprpriate subject would be "Error while compiling a procedure".)
Finally, When would the ELSE be reached here?
if p_data_load_date IS NULL then
select (sysdate - 7), (sysdate - 1) into v_start_date, v_end_date from dual;
elsif p_data_load_date IS NOT NULL then
select (p_data_load_date - 7), (p_data_load_date - 1) into v_start_date, v_end_date from dual;
ELSE
raise_application_error('-20042', 'Data control - GetDataControlAuditData : Date parameter must be a date of this or a previous week.');
end if;Regards
Peter -
Error when inserting or changing in a sorted table
Hi Experts,
When i am executing a webdynpro application it says Error when inserting or changing in a sorted table. Can any one help for this.
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: GET_CATEGORY_LIST of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
Method: IF_COMPONENTCONTROLLER~GET_CATEGORY_LIST of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
Method: WDDOMODIFYVIEW of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
Method: IF_WDR_VIEW_DELEGATE~WD_DO_MODIFY_VIEW of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
Method: DO_MODIFY_VIEW of program CL_WDR_DELEGATING_VIEW========CP
Method: MODIFY_VIEW of program CL_WDR_VIEW===================CP
Method: DO_MODIFY_VIEW of program CL_WDR_CLIENT_COMPONENT=======CP
Method: DO_MODIFY_VIEW of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP
in ST22
Object Definition
DATA: lo_node TYPE REF TO if_wd_context_node,
lo_node_info TYPE REF TO if_wd_context_node_info,
lo_element TYPE REF TO if_wd_context_element.
Additional Data declarations
DATA: lv_key TYPE string.
Get context node.
lo_node = wd_context->get_child_node( name = 'DROPDOWNLISTS' ).
lo_node_info = lo_node->get_node_info( ).
Call method to fetch the categories.
CALL METHOD cl_hap_wd_start_page_ui=>category_get_list
EXPORTING
add_on_application = add_on_application
IMPORTING
t_categories = lt_categories.
Append Default selection entry 'All'.
lw_category-category_id = '00000000'.
lw_category-category_name = 'All'.
APPEND lw_category TO lt_categories.
Sort table after appending the new entry.
SORT lt_categories ASCENDING.
Loop through the category list and populate key(category_id) value(category_name) pair for
LOOP AT lt_categories INTO lw_category.
lw_key_value-key = lw_category-category_id.
625 lw_key_value-value = lw_category-category_name.
>>>>> APPEND lw_key_value TO lt_key_values.------>Here it throws an error
627 CLEAR: lw_key_value, lw_category.
628 ENDLOOP.
629
630 * Bind the category key-value pair to the context attribute.
631 CALL METHOD lo_node_info->set_attribute_value_set
632 EXPORTING
633 name = 'CATEGORY_LIST'
634 value_set = lt_key_values.
635
636 * Make the entry 'All' as default selected.
637 CALL METHOD lo_node->set_attribute
638 EXPORTING
639 value = '00000000'
640 name = 'CATEGORY_LIST'.
641
642 ENDMETHOD.
643
644 method GET_EMPLOYEES.
645Hello Durga,
from the error what I understood is lt_key_values is a sorted table and you are trying append a new line to it. Incase of sorted table you need to use the INSERT statement and not the APPEND statement.
INSERT lw_key_value INTO table lt_key_values.
BR, Saravanan -
Error while executing the procedure
Hi,
I tried the following example it's compiled but while executing giving the errors
create or replace PROCEDURE createRZGSet (
rNm IN VARCHAR2,
rDsc IN VARCHAR2,
rId OUT NUMBER
) IS
cId INTEGER;
BEGIN
cId := 1;
SELECT q_id.NEXTVAL
INTO rId
FROM DUAL;
INSERT INTO t_set (rid,
r_nm,
r_dsc,
o_id,
flag) VALUES (rId,rNm,rDsc,cid,'P');
END;
/The above is compiled ... but while executing
SQL> declare
2 optval number;
3 begin
4 execute createRZGSet('myp','miyapur',optval);
5 dbms_output.put_line('val returned is:'||optval);
6 end;
7 /
execute createRZGSet('myp','miyapur',optval);
ERROR at line 4:
ORA-06550: line 4, column 10:
PLS-00103: Encountered the symbol "CREATERZGSet" when expecting one
of the following:
:= . ( @ % ; immediate
The symbol ":=" was substituted for "CREATERZGSet" to continue.could you please hint me in this error..
thanxThe above is compiled ... but while executing
SQL> declare
2 optval number;
3 begin
4 execute createRZGSet('myp','miyapur',optval);
5 dbms_output.put_line('val returned is:'||optval);
6 end;
7 /remove the execute key word. it belongs to SQL Plus. in pl/sql you can just give the procedure name thats enought.
SQL> declare
2 optval number;
3 begin
4 createRZGSet('myp','miyapur',optval);
5 dbms_output.put_line('val returned is:'||optval);
6 end;
7 / -
I'm replicating between two servers in two sites (Server A - Server 2012 R2 STD, Server B - Server 2008 R2) over a VPN (Sonicwall Firewall). Though the initial replication seems to be
happening it is very slow (the folder in question is less than 3GB). I'm seeing these in the event viewer every few minutes:
The DFS Replication service is stopping communication with partner PPIFTC for replication group FTC due to an error. The service will retry the connection periodically.
Additional Information:
Error: 1726 (The remote procedure call failed.)
and then....
The DFS Replication service successfully established an inbound connection with partner PPIFTC for replication group FTC.
Here are all my troubleshooting steps (keep in mind that our VPN is going through a SonicWall <--I increased the TCP timeout to 24 hours):
-Increased TCP Timeout to 24 hours
-Added the following values on both sending and receiving members and rebooted server
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Value =DisableTaskOffload
Type = DWORD
Data = 1
Value =EnableTCPChimney
Type = DWORD
Data = 0
Value =EnableTCPA
Type = DWORD
Data = 0
Value =EnableRSS
Type = DWORD
Data = 0
---------------------------------more troubleshooting--------------------------
-Disabled AntiVirus on both members
-Made sure DFSR TCP ports 135 & 5722 are open
-Installed all hotfixes for 2008 R2 (http://support.microsoft.com/kb/968429) and rebooted
-Ran NETSTAT –ANOBP TCP and the DFS executable results are listed below:
Sending Member:
[DFSRs.exe]
TCP 10.x.x.x:53 0.0.0.0:0
LISTENING 1692
[DFSRs.exe]
TCP 10.x.x.x:54669
10.x.x.x:5722 TIME_WAIT 0
TCP 10.x.x.x:54673
10.x.x.x:5722 ESTABLISHED 1656
[DFSRs.exe]
TCP 10.x.x.x:64773
10.x.x.x:389 ESTABLISHED 1692
[DFSRs.exe]
TCP 10.x.x.x:64787
10.x.x.x:389 ESTABLISHED 1656
[DFSRs.exe]
TCP 10.x.x.x:64795
10.x.x.x:389 ESTABLISHED 2104
Receiving Member:
[DFSRs.exe]
TCP 10.x.x.x:56683
10.x.x.x:389 ESTABLISHED 7472
[DFSRs.exe]
TCP 10.x.x.x:57625
10.x.x.x:54886 ESTABLISHED 2808
[DFSRs.exe]
TCP 10.x.x.x:61759
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61760
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61763
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61764
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61770
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61771
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61774
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61775
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61776
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61777
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61778
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61779
10.x.x.x:57625 TIME_WAIT 0
TCP 10.x.x.x:61784
10.x.x.x:52757 ESTABLISHED 7472
[DFSRs.exe]
TCP 10.x.x.x:63661
10.x.x.x:63781 ESTABLISHED 4880
------------------------------more troubleshooting--------------------------
-Increased Staging to 32GB
-Opened the ADSIedit.msc console to verify the "Authenticated Users" is set with the default READ permission on the following object:
a. The computer object of the DFS server
b. The DFSR-LocalSettings object under the DFS server computer object
-Ran
ping <var>10.x.x.x</var> -f -l 1472 and got replies back from both servers
-AD replication is successful on all partners
-Nslookup is working so DNS is working
-Updated NIC drivers on both servers
- I ran the following to set the Primary Member:
dfsradmin Membership Set /RGName:<replication group name> /RFName:<replicated folder name> /MemName:<primary member> /IsPrimary:True
Then Dfsrdiag Pollad /Member:<member name>
I'm seeing these errors in the dfsr logs:
20141014 19:28:17.746 9116 SRTR 957 [WARN] SERVER_EstablishSession Failed to establish a replicated folder session. connId:{45C8C309-4EDD-459A-A0BB-4C5FACD97D44} csId:{7AC7917F-F96F-411B-A4D8-6BB303B3C813}
Error:
+ [Error:9051(0x235b) UpstreamTransport::EstablishSession upstreamtransport.cpp:808 9116 C The content set is not ready]
+ [Error:9051(0x235b) OutConnection::EstablishSession outconnection.cpp:532 9116 C The content set is not ready]
+ [Error:9051(0x235b) OutConnection::EstablishSession outconnection.cpp:471 9116 C The content set is not ready]
---------------------------------------more troubleshooting-----------------------------
I've done a lot of research on the Internet and most of it is pointing to the same stuff I've tried. Does anyone have any other suggestions? Maybe I need to look somewhere
else on the server side or firewall side?
I tried replicating from a 2012 R2 server to another 2012 server and am getting the same events in the event log so maybe it's not a server issue.
Some other things I'm wondering:
-Could it be the speed of the NICs? Server A is a 2012 Server that has Hyper-V installed. NIC teaming was initially setup and since Hyper-V is installed the NIC is a "vEthernet
(Microsoft Network Adapter Multiplexor Driver Virtual Switch) running at a speed of 10.0Gbps whereas Server B is running a single NIC at 1.0Gbps
-Could occasional ping timeout's cause the issue? From time to time I get a timeout but it's not as often as the events I'm seeing. I'm getting 53ms pings. The folder
is only 3 GB so it shouldn't take that long to replicate but it's been days. The schedule I have set for replication is mostly all day except for our backup times which start at 11pm-5am. Throughout the rest of the time I have it set anywhere from
4Mbps to 64 Kbps. Server A is on a 5mb circuit and Server B is on a 10mb circuit.I'm seeing the same errors, all servers are running 2008 R2 x64. Across multiple sites, VPN is steady and reliably.
185 events from 12:28:21 to 12:49:25
Events are for all five servers (one per office, five total offices, no two in the same city, across three states).
Events are not limited to one replication group. I have quite a few replication groups, so I don't know for sure but I'm running under the reasonable assumption that none are spared.
Reminder from original post (and also, yes, same for me), the error is: Error: 1726 (The remote procedure call failed.)
Some way to figure out what code triggers an Event ID 5014, and what code therein specifies an Error 1726, would extremely helpful. Trying random command line/registry changes on live servers is exceptionally unappealing.
Side note, 1726 is referenced here:
https://support.microsoft.com/kb/976442?wa=wsignin1.0
But it says, "This RPC connection problem may be caused by an unstable WAN connection." I don't believe this is the case for my system.
It also says...
For most RPC connection problems, the DFS Replication service will try to obtain the files again without logging a warning or an error in the DFS Replication log. You can capture the network trace to determine whether the cause of the problem is at the network
layer. To examine the TCP ports that the DFS Replication service is using on replication partners, run the following command in a
Command Prompt window:
NETSTAT –ANOBP TCP
This returns all open TCP connections. The connections in question are "DFSRs.exe", which the command won't let you filter for.
Instead, I used the NETSTAT command as advertised, dumping output to info.txt:
NETSTAT -ANOBP TCP >> X:\info.txt
Then I opened Excel and manually opened the .TXT for the open wizard. I chose fixed-width fields based on the first row for each result, and then added a column:
=IF(A3="Can not", "Can not obtain ownership information", IF(LEFT(A3,1) = "[", A3&B3&C3, ""))
Dragging this down through the entire file let me see that row (Row F) as the file name. Some anomalies were present but none impacted DFSrs.exe results.
Finally, you can sort/filter (I sorted because I like being able to see everything, should I choose to) to get just the results you need, with the partial rows removed from the result set, or bumped to the end.
My server had 125 connections open.
That is a staggering number of connections to review, and I feel like I'm looking for a needle in a haystack.
I'll see if I can find anything useful out, but a better solution would be most wonderful. -
ERROR-Logging of Stored Procedure (Stop / Going on after error + logging)
Hi @all,
I am using a Stored Procedure which is very simple:
=>The stored procedure is selecting many tousands of records from table1 + table2.
=> Some values (records) will be summarized (aggregated/group by).
=>After this selection and summarizing, this records will be deleted from table3 (if they exist in table3).
=>Then the selected records will be inserted in table3.
Now I want to do the following:
Is there a way to log the errors of the stored procedure?
For example, the stored procedure is copying many thousands of records.
If there is a problem on copying/ inserting a record to table3, then I want a error-log in a loggin_table.
Is there a way to write the error-logs from a stored procedure to a special table in database?
I want to do this in 2 ways:
1) On error the error is logged and the stored procedure is stopped.
2) On error the error is logged and the stored procedure is going on to insert/summarize the next record.
I don't know how I can get these errors of a stored procedure. Maybe it isn't possible? Or is it better to use a function?
Hope anyone can give me a hint?
Thanks a lot.
Best regards,
TimHi
option one:
as i know you can have another table without primer key (log table).
then before you insert into table, select the record count using primary key. if it is duplicate then put those record into the table.
option two:
write the log into file.
declare
f utl_file.file_type;
s varchar2(200);
begin
f := utl_file.fopen('SAMPLEDATA','sample1.txt','R');
loop
utl_file.get_line(f,s);
dbms_output.put_line(s);
end loop;
exception
when NO_DATA_FOUND then
utl_file.fclose(f);
end;
refer : http://www.psoug.org/reference/OLD/utl_file.html
regards
upul.
Edited by: Upul Indika on Apr 9, 2009 12:45 PM -
SQL*Loader-930: Error parsing insert statement for column
we upload data on daily basis in application throug apps user and these table are invloved
1. DEV_RA_INTERFACE_LINES_ALL(owner is a apps)
2.RA_INTERFACE_LINES_ALL(owner is a AR)
we do steps
1 delete record from DEV_RA_INTERFACE_LINES_ALL table
2 delete record from RA_INTERFACE_LINES_ALL table
3 load data using sql loader with apps user
4 insert in RA_INTERFACE_LINES_ALL table
we want to change user i mean these step do dataupload user not apps
we give the proper rights to dataupload like select,delete and insert rights on these table to dataupload user but when i going to load data throug sql loader we receive error
SQL*Loader-930: Error parsing insert statement for column APPS.DEV_RA_INTERFACE_
LINES_ALL.ORIG_SYSTEM_BILL_ADDRESS_ID.
ORA-00904: "F_ORIG_SYSTEM_BILL_ADDR_REF": invalid identifier
and if i insert data through apps then done.make sure that u have no speces left
between lines.
give the path of control file path correctly. -
Hello guys,
I am trying to write a simple procedure that does an insert in to employee and department tables. when i just did only insert ito employee table it worked. but when i put another insert for department table in the procedure it giving me error. cant we have multiple inserts in procedure?
-- Procedure
CREATE OR REPLACE PROCEDURE put_data
(emp_id employee.emp_id%TYPE,
emp_name employee.emp_name%TYPE,
supervised_by employee.supervised_by%TYPE,
pay_rate employee.pay_rate%TYPE,
pay_type employee.pay_type%TYPE,
dept_id employee.dept_id%TYPE,
dept_name department.dept_name%TYPE ) AS
BEGIN
INSERT INTO EMPLOYEE VALUES (emp_id, emp_name,supervised_by, pay_rate, pay_type,dept_id);
INSERT INTO department values(dept_id, dept_name);
END;
-- calling the procudure
BEGIN
execute put_data(106,'swetha',502,45000, 'Y',10,'sales');
END;
Error
ERROR at line 2:
ORA-06550: line 2, column 11:
PLS-00103: Encountered the symbol "PUT_DATA" when expecting one of the
following:
:= . ( @ % ; immediate
The symbol ":=" was substituted for "PUT_DATA" to continue.
thanksEither get rid of BEGIN and END and issue:
execute put_data(106,'swetha',502,45000, 'Y',10,'sales');Or get rid of EXECUTE:
BEGIN
put_data(106,'swetha',502,45000, 'Y',10,'sales');
END;SY. -
Error when inserting a new record (Ctrl+Down)
Hello,
[http://img402.imageshack.us/my.php?image=12846351.jpg]
Here the problem is : when i press Ctrl+Down (Insert new record), i enter data into all those fields, but i got an error
Cannot Insert Record ("ROGER"."NUME") cannot be null (roger is my username which i logged on). And i completed all fields
Also, when inserting data into fields, when i click on another field, it points me back automatically to the last completed field, then when i click again on the next field, i can enter data in that field. why the cursor cannot be on the next field when i first click there?
i changed the property of the items Required = No (but however, in the database cannot be null).
Please help if you can.
ThanksFor your other issue, with null fields on your forms.
have you ever tried to log those fields value into a log table?
A better and simple idea is:
Create a temp table, with four columns: seq, section, message, type
Where section is the column to condition any search you want to make
message is the column to write anything you want
type is the column which holds the tpe of the record, like info, debug, warn, etc.
then create a database procedure
this procedure must recieve the section, message, type and insert them into the log table and do commit.
in yiour pre-insert trigger [forms level] or in your when-button-pressed or even better on your on-commit trigger [forms level]
write the following code:
begin
database_procdure('MY_FORM_NAME', 'THE VALUES ARE: 1='||:1||' 2='||:2||' 3='||:3, 'INFO');
end;
After that you can do a select in your sql*plus with the following statement:
select *
from temp_table
where selction like 'MY_FORM_NAME';
then you can track if any of the values you think is null or has a value, in fact, has a value.
best regards,
Abdel Miranda
AEMS Global Group
Panama -
ME 807: System error: error during insert in table KONV
Hi,
I got the below error when creating PO using ME21N, what should I do?
ME 807: System error: error during insert in table KONV
Thanks.During the creation of Purchasing Orders the system displays the message "Error during insert in table KONV". The problem is solved and I would like to share the steps we use to solve the problem.
You can get details of the error in the Business Workplace (T-Code SBWP) or through the transaction SM13. The details of the error are:
Function Module
ME_CREATE_DOCUMENT
Status
Update was terminated
Report
LEINUU03
Row
167
Message
ME807 System error: error during insert in table KONV
I applied the SAP Note 1610553 - BAPI_PO_CHANGE: Header conditions are not transferred which describes exactly the problem but it was not solved.
The solution was creating a new Purchasing Record and, before saving, remove all the conditions in Header level and save the document. After that, it's possible to create documents without problem. -
System Error During Insert (Table KNMT SUBRC 4)
Hi All,
I am getting a peculiar error when i try to update KNMT table using the FM RV_CUSTOMER_MATERIAL_UPDATE.
When i run it directly in debug mode, entries are getting created perfectly.
But when i run it through RFC, before the FM is executed itself, during validation, i am getting an error in the message queue stating "System Error During Insert (Table KNMT SUBRC 4).
I cheked that KNMT table is empty. Also i had deleted all entries using the standard transaction VD52.
I found that there is a certain FM RV_CUSTOMER_MATERIAL_UPDATE_C which is described as Posting program for customer-material info (CALL mode).
But i am not sure what this does. I cannot view the documentation in my system and also this FM does not have any parameters.
Kindly let me know if anyone has encountered an error like this... Please let me know of any suggestions for resolution.
Thanks & Regards,
Mz
P.S : The Functionality seems to work intermittently... though not when i want it.
Edited by: Mazin Mahmood on Dec 8, 2011 9:09 AMHi,
The issue was that i was calling the function module RV_CUSTOMER_MATERIAL_UPDATE using an RFC.(ABAP Proxy) For some reason, while using an RFC, there is some issue with this function module and the database commit .
I had to recode using BDC (for transaction vd51) approach for creating a record in KNMT.
Thanks All,
Cheers,
Mz
Maybe you are looking for
-
Problem in mapping existing schema in SunOne8
I am trying to deploy an CMP application in Sun Java System Application Server Platform Edition 8.0.0_01 (build b08-fcs) and facing the following issues: 1. I am generating an existing oracle schema file using deploy tool. I am able to choose the sch
-
Question about Restoring from an iTunes Backup
I just did a restore from an iTunes backup on my iPhone 5 and noticed that the restore process seemed different than before. iTunes went through the restore process and once it appeared that it had finished restoring, I went to the home screen and a
-
String function in oracle plz help
my input parameter is p1:=%01%01%01 p2:= 5 and my out put should like as below (%01%01%01nn)
-
Reversal Document Type in FI module
Hi, I would like to ensure that when A/P payment reverse, then SAP will generate KA document type in their respective table? regards, Syed Tayab Shah
-
Are folders for Process Chains available?
We are getting more and more process chains in our production environment. It would be so much nicer if we could put these in folders for organization. Is this available in BW 3.5? If not, I assume it will be in 2004s?