Strange question - data double on table 12 c JDev
Hello
I have a strange question in my table. I use Oracle JDeveloper 12 c. In my page, I use 2 VO and a secondary has a problem with the display of data - it displays two times. Heard that I deleted the table and put it in my page and always the same problem.
No matter if I have all the data to my record in the table primary or not, when there are data to display then it shows twice. I do not know it can help, but for more information table is located in the popup.
Anyone have this problem?
Kind regards
WK
You must specify exact jdev version (there are two versions of 12 c)
I had this problem in 12.1.2(a il y a longtemps, et à cause de trop de bugs dans cette version je n'a pas pris la peine de trouver la raison), but it seems that this problem went to 12.1.3(at moins, pour mon application)
Dario
Tags: Java
Similar Questions
-
strange question by inserting the data...
Hi everone,
I have a strange question. I'm not looking I do something wrong or is this a bug?
I do a simple ' insert into table (select statement). Everything is ok... It's inclusion. But when I run the
"select statement" separately (actual data I need to insert), I get different data inserted in the table.
-> I have observed something else where there is a "case statement" in the selection m than the data in the table are spoil...
EX:
SELECT TRIM (member_span.member_nbr) member_nbr-> this one I see the correct data
(
CASE
WHEN SUBSTR (member.member_nbr, 10, 2) = '00' THEN TRIM (member.member_nbr)
Of OTHER SUBSTR (member.member_nbr, 1, 9). '00'
END Subsciber_nbr),-> This data are spoil seeing incorrect data in the table...
Database version:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi
PL/SQL Release 10.2.0.2.0 - Production
"CORE 10.2.0.2.0 Production."
AMT for HP - UX: release 10.2.0.2.0 - Production
NLSRTL Version 10.2.0.2.0 - Production
< b > "" "did exactly the same thing in a different database. I don't have any problems out there"" "I'm getting problem only with this database < /b >"
Anyone know a bug related to this problem?
Please help me with this question...INSERT INTO member_load(member_nbr, subscriber, ymdbirth, security_group, group_nbr, network_id, cob_date) (SELECT TRIM(member_span.member_nbr) member_nbr, ( CASE WHEN SUBSTR(member.member_nbr, 10, 2) = '00' THEN TRIM(member.member_nbr) ELSE SUBSTR(member.member_nbr, 1, 9) || '00' END) subsciber_nbr, ( CASE WHEN LENGTH(member.ymdbirth) = 8 THEN member.ymdbirth ELSE NULL END) dob, ( CASE WHEN TRIM(member_span.group_nbr) IN('108076', '108077', '108078', '108079', '108080', '108081') THEN 'E' WHEN TRIM(member_span.group_nbr) IN('107001') THEN 'M' WHEN TRIM(member_span.group_nbr) IN('107005') THEN 'J' ELSE 'A' END) security_grp, TRIM(member_span.group_nbr), ( CASE WHEN TRIM(member_span.business_unit) = '01' THEN 'N' || TRIM(member_span.business_unit) || '-' || TRIM(member_span.prog_nbr) WHEN TRIM(member_span.business_unit) = '03' THEN 'N' || TRIM(member_span.business_unit) || '-' || TRIM(member_span.prog_nbr) || '-' || TRIM(member_span.carrier) ELSE NULL END) network_id, ( CASE WHEN LENGTH(member.ymdverify) = 8 THEN member.ymdverify ELSE NULL END) cob_date FROM member_span @dblink, member @dblink WHERE member_span.ymdeff > 20090908 AND member.member_nbr = member_span.member_nbr AND TRIM(void) IS NULL AND member_span.member_nbr NOT IN (SELECT member_nbr FROM member_span @dblink WHERE(20090908 BETWEEN ymdeff AND ymdend) AND TRIM(void) IS NULL) ) ;
Marella Phani wrote:
sven different NLS settings.... How can i find the NLS setting on both the databases.. can i query some metadata table to find that..
Please let me know how to proceed
Anurag...
It is not the problem with my SQL (that I know of). It gives a correct output that I need when I simply run the SQL query.
I just give a few examples of data (no real data).But when I run Insert in staging_table (select statement). I do not see the correct data in staging_table...
Thanks for all the replies...
You can check your NLS settings with
select name, value, isdefault from v$parameter where name like 'nls%';
or in sql * plus with
SQL> show parameter nls NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ nls_calendar string nls_comp string nls_currency string nls_date_format string nls_date_language string nls_dual_currency string nls_iso_currency string nls_language string AMERICAN nls_length_semantics string BYTE nls_nchar_conv_excp string FALSE nls_numeric_characters string nls_sort string nls_territory string AMERICA nls_time_format string nls_time_tz_format string nls_timestamp_format string nls_timestamp_tz_format string SQL>
Please be careful, that my comment about to_char was that under the assumption that you have a column for the number. If the column is VARCHAR2, do not add an extra TO_CHAR around this column. He could not give problems, but is not necessary (I think it can give problems in 9i, but impossible to find a small example yet).
An idea to find the source of your problem would be to change the NOT IN subquery. At least in a NOT EXISTS a subquery. Or even better find a way to access the remote tables only once instead of twice.
not exist
INSERT INTO member_load (member_nbr, subscriber ) ( SELECT TRIM(ms.member_nbr) member_nbr, ( CASE WHEN SUBSTR(ms.member_nbr, 10, 2) = '00' THEN TRIM(to_char(m.member_nbr)) ELSE SUBSTR(to_char(ms.member_nbr), 1, 9) || '00' END) subsciber_nbr FROM member_span@dblink ms, member@dblink m WHERE ms.ymdeff > 20090908 AND m.member_nbr = ms.member_nbr AND TRIM(ms.void) IS NULL AND NOT EXISTS (SELECT null FROM member_span@dblink ms1 WHERE (20090908 BETWEEN ms1.ymdeff AND ms1.ymdend) AND TRIM(ms1.void) IS NULL AND ms.member_nbr = ms1.member_nbr) ) ;
Is ymdeff a number or a string? If it is a string, then change 20090908 in '20090908'. If it is a number then keep as it is.
-
2.1 RC1 - strange behavior when you change the data in the table
I recently found a new strange behavior of the SQL Developer. On a small table or a table with a filter where all the data is loaded, but not all lines can be displayed on the screen, trying to change the data in the table. When I confirm the editing with the key enter, Developer SQL jumps always until the end of the data. Quite confusing and boring. The cursor seems to remain in the field that I have edited, then moving upward or downward line force SQL developer to this line.
Appears not to be the case when all the data are loaded instead of punch, but if you force Developer SQL to load all the data, I can reproduce this strange behavior.
SvenBug 9205959 is fixed.
-Rambeau
-
Doubt about inserting data into a table
Hi all, when I try to insert data into a table through an anonymous block, the pl/sql block runs successfully, but the data are not get inserted. Can someone please tell me where I am doing wrong?
Thanks in advance!SQL> DECLARE 2 3 V_A NUMBER; 4 5 V_B NUMBER; 6 7 v_message varchar2(25); 8 9 10 BEGIN 11 12 13 select regal.regal_inv_landed_cost_seq.NEXTVAL into V_A from dual ; 14 15 select regal.regal_inv_landed_cost_seq.currval into V_B from dual ; 16 17 INSERT INTO rcv_transactions_interface 18 ( 19 INTERFACE_TRANSACTION_ID, 20 HEADER_INTERFACE_ID, 21 GROUP_ID, 22 TRANSACTION_TYPE, 23 TRANSACTION_DATE, 24 PROCESSING_STATUS_CODE, 25 PROCESSING_MODE_CODE, 26 TRANSACTION_STATUS_CODE, 27 QUANTITY, 28 LAST_UPDATE_DATE, 29 LAST_UPDATED_BY, 30 CREATION_DATE, 31 CREATED_BY, 32 RECEIPT_SOURCE_CODE, 33 DESTINATION_TYPE_CODE, 34 AUTO_TRANSACT_CODE, 35 SOURCE_DOCUMENT_CODE, 36 UNIT_OF_MEASURE, 37 ITEM_ID, 38 UOM_CODE, 39 EMPLOYEE_ID, 40 SHIPMENT_HEADER_ID, 41 SHIPMENT_LINE_ID, 42 TO_ORGANIZATION_ID, 43 SUBINVENTORY, 44 FROM_ORGANIZATION_ID, 45 FROM_SUBINVENTORY 46 ) 47 48 SELECT 49 regal.regal_inv_landed_cost_seq.nextval, --Interface_transaction_ id 50 V_A, --Header Interface ID 51 V_B, --Group ID 52 'Ship', --Transaction Type 53 sysdate, --Transaction Date 54 'PENDING', --Processing Status Code 55 'BATCH', --Processing Mode Code 56 'PENDING', --Transaction Status Cod e 57 lc.quantity_received, --Quantity 58 lc.last_update_date, --last update date 59 lc.last_updated_by, --last updated by 60 sysdate, --creation date 61 lc.created_by, --created by 62 'INVENTORY', --Receipt source Code 63 'INVENTORY', --Destination Type Code 64 'DELIVER' , --AUT Transact Code 65 'INVENTORY', --Source Document Code 66 msi.primary_uom_code , --Unit Of Measure 67 msi.inventory_item_id, --Item ID 68 msi.primary_unit_of_measure, --UOM COde 69 fnd.user_id, 70 V_A, --Shipment Header ID 71 V_B, --SHipment Line ID 72 82, --To Organization ID 73 'Brooklyn', --Sub Inventory ID 74 81, --From Organization 75 'Vessel' --From Subinventory 76 77 FROM 78 regal.regal_inv_landed_cost_tab lc, 79 fnd_user fnd, 80 mtl_system_items msi 81 82 WHERE 83 lc.organization_id = msi.organization_id 84 AND lc.inventory_item_id = msi.inventory_item_id 85 AND lc.created_by = fnd.created_by; 86 87 commit; 88 v_message := SQL%ROWCOUNT; 89 dbms_output.put_line('v_message'); 90 END; 91 / v_message PL/SQL procedure successfully completed. SQL> select * from rcv_transactions_interface; no rows selected
There is no problem with inserting data!
Only there is no data! This means that your select statement retrieves no rows.
You can see the output of your program (0). This means that there where no line in the result set.Please check the output of your tax return independently:
SELECT -- regal.regal_inv_landed_cost_seq.nextval, --Interface_transaction_id -- V_A, --Header Interface ID -- V_B, --Group ID 'Ship', --Transaction Type sysdate, --Transaction Date 'PENDING', --Processing Status Code 'BATCH', --Processing Mode Code 'PENDING', --Transaction Status Code lc.quantity_received, --Quantity lc.last_update_date, --last update date lc.last_updated_by, --last updated by sysdate, --creation date lc.created_by, --created by 'INVENTORY', --Receipt source Code 'INVENTORY', --Destination Type Code 'DELIVER' , --AUT Transact Code 'INVENTORY', --Source Document Code msi.primary_uom_code , --Unit Of Measure msi.inventory_item_id, --Item ID msi.primary_unit_of_measure, --UOM COde fnd.user_id, -- V_A, --Shipment Header ID -- V_B, --SHipment Line ID 82, --To Organization ID 'Brooklyn', --Sub Inventory ID 81, --From Organization 'Vessel' --From Subinventory FROM regal.regal_inv_landed_cost_tab lc, fnd_user fnd, mtl_system_items msi WHERE lc.organization_id = msi.organization_id AND lc.inventory_item_id = msi.inventory_item_id AND lc.created_by = fnd.created_by;
Published by: hm on 13.10.2011 23:19
I removed the references of the sequence and the variables V_A and YaeUb.
BTW: Why do you want to include V_A and YaeUb in two different columns?The use of sequences in your code seems a bit strange to me. But this has nothing to do with your question.
-
Compare and get the data in the tables (see post for details)
I have two tables TableA and TableB. I struggle to write a query to get the dates of TableB (instead of TableA dates) where TableA dates don't coincide with the tableB (beginning and end).
Example 1: For account A1234,.
TableA got 2 rows 1/31/2014-3/3/2014 (which corresponds to TableB row), but TableA got another rank 31/01/2014 - 31/01/2014 that corresponds with the date of TableB Begin. In this case, I'm looking for output as below,
Use TableB start and end date and combine number two rows from TableA for this account
ACCOUNT TableB_BEGIN TableB_END AMOUNT A1234 31/01/2014 03/03/2014 100.0000000000 Example 2: For the B7777 account.
TableA end date aligns with the end dates of TableB for this account, in this case I want out put as,.
Use TableB start and end date and get the amount of TableA
ACCOUNT TableB_BEGIN TableB_END AMOUNT B7777 05/04/2013 06/05/2013 200.0000000000 Example 3: On behalf of D5555,.
Even a TableA line corresponds with TableA, there are two other rows in TableA matching start date with TableA and correspondence with the end date with TableA, in this case, that I put as,.
Use TableB start and end date and combine number three rows from TableA for this account.
ACCOUNT TableB_BEGIN TableB_END AMOUNT D5555 08/08/2014 10/09/2014 1100.0000000000 Example 4: To account E6666.
Table corresponds to a row with TableB and no additional lines in TableA, just display the data in A table
Tables and data:
create table TableA ( Account varchar2(10) not null, Begin date not null, End date not null, Amount number(19,10) not null ) ; create table TableB ( Account varchar2(10) not null, Begin date not null, End date not null, Amount number(19,10) not null ) ; TableA Data: insert into tablea (ACCOUNT, BEGIN, END, AMOUNT) values ('A1234', to_date('31-01-2014', 'dd-mm-yyyy'), to_date('31-01-2014', 'dd-mm-yyyy'), 0.0000000000); insert into tablea (ACCOUNT, BEGIN, END, AMOUNT) values ('A1234', to_date('31-01-2014', 'dd-mm-yyyy'), to_date('03-03-2014', 'dd-mm-yyyy'), 100.0000000000); insert into tablea (ACCOUNT, BEGIN, END, AMOUNT) values ('B7777', to_date('18-04-2013', 'dd-mm-yyyy'), to_date('06-05-2013', 'dd-mm-yyyy'), 120.0000000000); insert into tablea (ACCOUNT, BEGIN, END, AMOUNT) values ('C6666', to_date('25-06-2014', 'dd-mm-yyyy'), to_date('08-07-2014', 'dd-mm-yyyy'), 10.0000000000); insert into tablea (ACCOUNT, BEGIN, END, AMOUNT) values ('D5555', to_date('08-08-2014', 'dd-mm-yyyy'), to_date('16-08-2014', 'dd-mm-yyyy'), 1000.0000000000); insert into tablea (ACCOUNT, BEGIN, END, AMOUNT) values ('D5555', to_date('08-08-2014', 'dd-mm-yyyy'), to_date('10-09-2014', 'dd-mm-yyyy'), 0.0000000000); insert into tablea (ACCOUNT, BEGIN, END, AMOUNT) values ('D5555', to_date('16-08-2014', 'dd-mm-yyyy'), to_date('10-09-2014', 'dd-mm-yyyy'), 100.0000000000); insert into tablea (ACCOUNT, BEGIN, END, AMOUNT) values ('E6666', to_date('01-01-2014', 'dd-mm-yyyy'), to_date('01-02-2014', 'dd-mm-yyyy'), 100.0000000000); TableB Data: insert into tableb (ACCOUNT, BEGIN, END, AMOUNT) values ('A1234', to_date('31-01-2014', 'dd-mm-yyyy'), to_date('03-03-2014', 'dd-mm-yyyy'), 100.0000000000); insert into tableb (ACCOUNT, BEGIN, END, AMOUNT) values ('B7777', to_date('05-04-2013', 'dd-mm-yyyy'), to_date('06-05-2013', 'dd-mm-yyyy'), 200.0000000000); insert into tableb (ACCOUNT, BEGIN, END, AMOUNT) values ('C6666', to_date('06-06-2014', 'dd-mm-yyyy'), to_date('08-07-2014', 'dd-mm-yyyy'), 10.0000000000); insert into tableb (ACCOUNT, BEGIN, END, AMOUNT) values ('D5555', to_date('08-08-2014', 'dd-mm-yyyy'), to_date('10-09-2014', 'dd-mm-yyyy'), 1100.0000000000); insert into tableb (ACCOUNT, BEGIN, END, AMOUNT) values ('E6666', to_date('01-01-2014', 'dd-mm-yyyy'), to_date('01-02-2014', 'dd-mm-yyyy'), 100.0000000000); SELECT A.ACCOUNT, A.BEGIN, A.END, A.AMOUNT, B.ACCOUNT, B.BEGIN, B.END, B.AMOUNT FROM TABLEA A LEFT JOIN TABLEB B ON A.ACCOUNT = B.ACCOUNT
Hello
SeshuGiri wrote:
Hi Frank,.
Your query/solution works very well, but I forgot to mention something in the first post...
Please insert these additional lines and try the request again.
TableA Additional lines:
- Insert into TABLEA (ACCOUNT, BEGIN, END, QUANTITY)
- values ('F9999', to_date (January 2, 2014 ',' dd-mm-yyyy ""), to_date (3 January 2014 ', 'dd-mm-yyyy'), 999.0000000000);
- Insert into TABLEA (ACCOUNT, BEGIN, END, QUANTITY)
- values ('A1234', to_date (March 3, 2014 ',' dd-mm-yyyy ""), to_date (4 March 2014 ', 'dd-mm-yyyy'), 999.0000000000);
TableB Additional lines:
- Insert into TABLEb (ACCOUNT, BEGIN, END, QUANTITY)
- values ('A1234', to_date (March 3, 2014 ',' dd-mm-yyyy ""), to_date (4 March 2014 ', 'dd-mm-yyyy'), 999.0000000000);
Question 1:
The table has a rows for A1234 account (i.e. the time period different than the ranks for the same account)
one is A1234 31/01/2014-03/03/2014, A1234 03/03/2014-03/04/2014
Your query that returns two rows for A1234 account (which is what I want), but the amount is messed up.
ACCOUNT BEGIN END TOTAL_AMOUNT 1 A1234 31/01/2014 03/03/2014 1100 2 A1234 03/03/2014 03/04/2014 1100 Except:
ACCOUNT BEGIN END TOTAL_AMOUNT 1 A1234 31/01/2014 03/03/2014 101 2 A1234 03/03/2014 03/04/2014 999 Question 2:
In some cases TableA will have an account (F9999), but the TableB don't. I can just this line by making the Left Join right join?
I don't get the results with additional data. I get 1099 for two lines where account = 'A1234 '. I get 1100 as the amount on the line with the account = "D5555. You did it other changes to data?
Except:
ACCOUNT BEGIN END TOTAL_AMOUNT 1 A1234 31/01/2014 03/03/2014 101 2 A1234 03/03/2014 03/04/2014 999 Still, I don't see why you want to 101 for the amount of the first row. Why not 100?
How can you know which rows from tablea should get attached to what rows from tableb, when the account is not unique?
Maybe you want something like this:
SELECT a.account
b.begin
b.end
SUM (a.amount) AS total_amount
FROM tablea a
ON a.account = b.account JOIN tableb B
AND a.begin BETWEEN b.begin
AND b.end
AND a.end BETWEEN b.begin
AND b.end
GROUP OF a.account, b.begin, b.end
ORDER BY a.account
;
but I guess just to your needs, and guessing is not a very good or reliable way to solve problems.
Question 2:
In some cases TableA will have an account (F9999), but the TableB don't. I can just this line by making the Left Join right join?
Yes, it looks that you want an outer join. What happened when you tried? As always, post your code, the exact results you want from the given sample data, as well as an explanation of how you get these results from these data.
-
Reading data from several tables on Apex
Hi all
My apologies if the below question has been answered already, just that I couldn't find the relevant discussion.
I have an interactive report I want to use to display data in 2 tables:
Table 1 about 10 columns but I want to just see 3 columns, Field1 and Field2 field3.
Table 2 has about 5 columns and I want only showing 2 of these columns (Column1 and Column2) on the same report with columns in table 1 above.
I need my report to look like this: field1, Field2 field3 Column1 Column2
FROM table1, table2
I tried the example above and it seems to not work, can I please get assistance on how to achieve this.
Thanks in advance.
Hello
Thanks for your reply, I actually found and answer the question.
I wanted to display the data in 2 tables (views) distinct have no joints, and so therefore I couldn't join them with a join condition.
What I did was created a dummy field on the two tables with similar values attached tables using these dummy fields and it works perfectly.
Thank you.
-
Hello
It comes to my table
Insertion of the data in it with the procedure which takes 2 parameters of date format:CREATE TABLE TEMP_LEAP ( "DATE_FROM" DATE )
Now lets fill in the data in the table:CREATE OR REPLACE PROCEDURE "T_PROC" (p_dat_from date, p_dat_to date) IS BEGIN DECLARE day number := 0; st NUMBER := 0; BEGIN day := p_dat_to+1 - p_dat_from; for p in 1 .. day loop insert into temp_leapp (date_from) values (p_dat_from+st); st := st+1; end loop; commit; END; END;
Data are now filled in the table.execute T_PROC(TO_DATE('01.01.2010','DD.MM.YYYY'),TO_DATE('17.08.2013','DD.MM.YYYY'));
I want to do is do a select statement that will make the following output data:
I want is to get the leap year if there is a. I only need of days in the year, so don't mind the months.01.01.2010 - 31.12.2011 01.01.2012 - 31.12.2012 01.01.2013 - 17.08.2013
I need to check if there is a leap year in considering the p_dat_from and p_dat_to.
If it isn't then you will get a single record of our instruction select and values will be made of: p_dat_from - p_dat_to.
If there is a leap year in our period we will arrive after statements (example above).
01.01.2010 - 31.12.2011 <-first date is p_dat_from and second is the last day before the leap year
01.01.2012 - 31.12.2012 <-this is leap year. First date is the beginning of the leap year and the last date is the end of the leap year or p_date_to (if it ends in leap years).
01.01.2013 - 17.08.2013 <- and this is the period after the leap years.
It is a piece of code that I fell or with up to now:
OK, that's all. I hope that its understandable that I do.SELECT MIN(date_from), MAX(date_from) FROM temp_leap WHERE remainder(to_number(to_char(date_from,'yyyy')),4) = 0 union SELECT MIN(date_from) over (partition by to_char(date_from,'yyyy')), MAX(date_from) OVER (PARTITION BY to_char(date_from,'yyyy')) FROM temp_leap WHERE remainder(to_number(to_char(date_from,'yyyy')),4) <> 0 ORDER BY 1,2;
If you have a questions please ask away.
PS is there anything I need to do. You don't have to bother with the questions "what i February is after before etc." I don't love about it. All the other logic is already fixed all I need is what I wrote above.
Thank you.
Published by: BluShadow on March 14, 2013 08:24
Fixed barcode labelsHere's a way...
SQL> create table temp_leap(date_from DATE) 2 / Table created. SQL> SQL> insert into temp_leap 2 select date '2010-01-01' + rownum - 1 3 from dual 4 connect by rownum <= (date '2013-08-17' - date '2010-01-01') + 1 5 / 1325 rows created. SQL> SQL> commit 2 / Commit complete. SQL> ed Wrote file afiedt.buf 1 select min(date_from)||' - '||max(date_from) 2 from 3 (select date_from 4 ,sum(leap_yr_switch) over (order by date_from) as leap_yr_switch_cnt 5 from ( 6 select date_from 7 ,case when lag(leap_yr) over (order by date_from) != leap_yr then 1 else 0 end as leap_yr_switch 8 from ( 9 select date_from 10 ,case when mod(to_number(to_char(date_from,'YYYY')),400) = 0 11 or ( mod(to_number(to_char(date_from,'YYYY')),4) = 0 12 and mod(to_number(to_char(date_from,'YYYY')),100) != 0 13 ) 14 then 1 else 0 end as leap_yr 15 from temp_leap 16 ) 17 ) 18 ) 19 group by leap_yr_switch_cnt 20* order by min(date_from) SQL> / MIN(DATE_FROM)||'-'||MAX(DATE_FROM) ------------------------------------------- 01-JAN-2010 00:00:00 - 31-DEC-2011 00:00:00 01-JAN-2012 00:00:00 - 31-DEC-2012 00:00:00 01-JAN-2013 00:00:00 - 17-AUG-2013 00:00:00
Published by: BluShadow on March 14, 2013 08:51
a slight correction in the calculation of the leap year, forgotten 100 years being does not leap. -
Insert XML data from the Table->; back to null
Dear Experts,
-I have table xml as below:
Example of CREATE TABLE (XML_spec XMLTYPE);
Insert in the example
Select ' < name of Message = "dataStaticInvestor" type = "IncomingMessage" >
< name of field = "batchReference" > OPENINGBATCH000000 < / field > < List name = "data" >
< = record name "data" >
< name of field = "externalReference" > 01234567890aaaaaaa < / field >
< name of field = "participantID" > OD001 < / field >
< name of field = "participantName" > EQUITY SECURITIES INDONESIA, PT < / field >
< / recording >
< = record name "data" >
< name of field = "externalReference" > 01234567890aaaaaaa < / field >
< name of field = "participantID" > OD001 < / field >
< name of field = "participantName" > EQUITY SECURITIES INDONESIA, PT < / field >
< / recording >
< = record name "data" >
< name of field = "externalReference" > 01234567890aaaaaaa < / field >
< name of field = "participantID" > OD001 < / field >
< name of field = "participantName" > EQUITY SECURITIES INDONESIA, PT < / field >
< / recording >
< / list >
< / message > ' double.
Select * example;
create table hasil1 (c1 varchar2 (500), c2 varchar2 (500), c3 varchar2 (500));
-This step I create the procedure to insert xml data into the table as the batch.
DECLARE
x XmlType;
BEGIN
Select XML_SPEC in x for example;
insert into hasil1
SELECT
p.Extract('/Record/Field/@externalReference').getstringval (C1),
p.Extract('/Record/Field/@participantID').getstringval (C2),
p.Extract('/Record/Field/@participantName').getstringval () as c3
TABLE (XMLSequence (Extract(x,'Message/List/Record'))) p;
commit;
END;
/
-when the result of select hasil1, the output is back 3 rows and 3 columns, but all data is a null *.
Best regards
SigcleYou don't explain what output you need, but I guess something like this:
SQL> insert into hasil1 (c1, c2, c3) 2 select x.c1, x.c2, x.c3 3 from example t 4 , xmltable( 5 'Message/List/Record' 6 passing t.xml_spec 7 columns c1 varchar2(500) path 'Field[@name="externalReference"]' 8 , c2 varchar2(500) path 'Field[@name="participantID"]' 9 , c3 varchar2(500) path 'Field[@name="participantName"]' 10 ) x 11 ; 3 rows inserted SQL> select * from hasil1; C1 C2 C3 ---------------------- --------- -------------------------------- 01234567890aaaaaaa OD001 EQUITY SECURITIES INDONESIA,PT 01234567890aaaaaaa OD001 EQUITY SECURITIES INDONESIA,PT 01234567890aaaaaaa OD001 EQUITY SECURITIES INDONESIA,PT
-
How to find if the data in the table are distributed on multiple disks
Hi all
I have a question on parallel processing.
Assume that the Oracle (11 g 2) database is installed on a 12 CPU hardware has 24 independent labels, then I guess it's that we can have a maximum of 12 DOP.
But if the table on which I use the parallel market that spans only 4 discs then the above 4 parallelism will degrade the performance of the query.
My question is how do I know if the data in the table are spread over the number of disk drives, so that we can properly apply valid parallel operations on the table.
Appreciate your valuable contributions here.
Thank you
MK.Just think logically.
What is a table in the database? A segment.
What is a segment made up of? Scopes.
What is recorded on a scale? The id_fichier of the data file.------------
Sybrand Bakker
Senior Oracle DBA -
Impdp exclude data in some tables
Hi all
I have a doubt.
I want to import database dump using impdp and I want to exclude data from several tables, but I want to load the metadata of these tables and their dependent objects. As far as I know, this can be done two ways:
1. in impdp we used parameter CONTENT = METADATA_ONLY - but in this case it will be loaded only the metadata for all tables;
2. I can use EXCLUDE = TABLE: parameter 'IN ("TABLE1", "TABLE2") '. But in this case if an object is excluded, all its dependent objects are also excluded - which is not what I want.
Oracle version is 10.2.0.4.0.
Did someone had a similar request?
TNX,
SmeeFor the tables that you do not want the data, add a query clause to the impdp command:
username/password query Impdp ='table_name: "where rownum = 0" ' query = "table2:' where rownum = 0"' etc.
This will load all the metadata and will load all the data for the tables with these query clauses.
The quote may be a problem with single and double quotes, but is a good idea. You're better off if you can put these requests in a settings file, since you won't have to worry about escaping from the funny characters. Then you can just say
Username/password Impdp parfile = my_par_file.par
Thank you
Dean
-
extract data from a table to a text file
I need to extract data from a table to a text file, I twist my output is the following...
bash-3. $00 vi tap3roamercosts_20110915144318.txt
lines of 'tap3roamercosts_20110915144318.txt' 393948, 23464348 characters
^ LAFGTD | N | 2011090203000001 | 13242514000064 | 1. 0 | 20. 41220 | 02-SEVEN.-11. 01-SEPT.-11. 0 | 13244
755. 64. 70. 0093794428588 | 0093796234547 | 0 | S2 | E | 412200306902634 | 8. 1. 61500 | 16081 |
| HW | Call to the Roamer. 0 | I have | Roaming billing Inroamer Plan | 1_0_1 | LKA | N_I_Independent
the time of day. Rate of Roamer SMST systems | AFGTD20110902030000010001013242514000064 |
|||||||||||||||||||||
AFGTD | N | 2011090203000001 | 13242612000044 | 1. 0 | 20. 41220 | 02-SEVEN.-11. 01-SEPT.-11. 0 | 13244
853. 44. 70. 234. 0093793252818 | 0 | S2 | E | 412200303198150 | 8. 1. 61000 | 12403 | HW | -Ro
bitter call | 0 | I have | Roaming billing Inroamer Plan | 1_0_1 | N_I_Independent time of Da
There | Rate of Roamer SMST systems | AFGTD20110902030000010001013242612000044 |
||||||||
AFGTD | N | 2011090203000001 | 13242612000047 | 1. 0 | 20. 41220 | 02-SEVEN.-11. 01-SEPT.-11. 0 | 13244
853. 47. 70. 234. 0093793252818 | 0 | S2 | E | 412200303198150 | 8. 1. 61000 | 12403 | HW | -Ro
bitter call | 0 | I have | Roaming billing Inroamer Plan | 1_0_1 | N_I_Independent time of Da
There | Rate of Roamer SMST systems | AFGTD20110902030000010001013242612000047 |
||||||||
.
.
.
.
.
Please help me how to format my output each record in simple lines in oracle sqlplus. Here are the settings I used...
TERMOUT OFF SET;
SET ECHO OFF;
SET LINESIZE 100000;
THE VALUE OF NEWPAGE 0;
SET SPACE 0;
SET PAGESIZE 50000;
SET FEEDBACK OFF;
SET THE OFF POSITION;
SET TRIMSPOOL
SET THE TABAnd what was wrong with the answers that you have on your previous thread?
How to extract data in a text file
Please do not ask the same question again. If there is a problem with the answers provided, then continue on the same thread that tell people what is the problem.
Saying that, this is another possibility for you...
As user sys:
CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles' / GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser /
As myuser:
CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2 ,p_dir IN VARCHAR2 ,p_header_file IN VARCHAR2 ,p_data_file IN VARCHAR2 := NULL) IS v_finaltxt VARCHAR2(4000); v_v_val VARCHAR2(4000); v_n_val NUMBER; v_d_val DATE; v_ret NUMBER; c NUMBER; d NUMBER; col_cnt INTEGER; f BOOLEAN; rec_tab DBMS_SQL.DESC_TAB; col_num NUMBER; v_fh UTL_FILE.FILE_TYPE; v_samefile BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file); BEGIN c := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE); d := DBMS_SQL.EXECUTE(c); DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab); FOR j in 1..col_cnt LOOP CASE rec_tab(j).col_type WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000); WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val); WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val); ELSE DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000); END CASE; END LOOP; -- This part outputs the HEADER v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767); FOR j in 1..col_cnt LOOP v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),','); END LOOP; -- DBMS_OUTPUT.PUT_LINE(v_finaltxt); UTL_FILE.PUT_LINE(v_fh, v_finaltxt); IF NOT v_samefile THEN UTL_FILE.FCLOSE(v_fh); END IF; -- -- This part outputs the DATA IF NOT v_samefile THEN v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767); END IF; LOOP v_ret := DBMS_SQL.FETCH_ROWS(c); EXIT WHEN v_ret = 0; v_finaltxt := NULL; FOR j in 1..col_cnt LOOP CASE rec_tab(j).col_type WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val); v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',','); WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val); v_finaltxt := ltrim(v_finaltxt||','||v_n_val,','); WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val); v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),','); ELSE v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',','); END CASE; END LOOP; -- DBMS_OUTPUT.PUT_LINE(v_finaltxt); UTL_FILE.PUT_LINE(v_fh, v_finaltxt); END LOOP; UTL_FILE.FCLOSE(v_fh); DBMS_SQL.CLOSE_CURSOR(c); END;
This allows the header line and the data to write into files separate if necessary.
for example
SQL> exec run_query('select * from emp','TEST_DIR','output.txt'); PL/SQL procedure successfully completed.
Output.txt file contains:
empno,ename,job,mgr,hiredate,sal,comm,deptno 7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20 7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30 7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30 7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20 7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30 7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30 7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10 7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20 7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10 7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30 7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20 7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30 7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20 7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10
The procedure allows for the header and the data to separate files if necessary. Just by specifying the file name "header" will put the header and the data in a single file.
Adapt to the exit of styles and different types of data are needed.
-
The fastest way to import data for large tables
Hi friends,
I recently joined a billing product put up a team for TELECOM giant. Under the procedure of installation/initial tests, we have huge data (size of almost 1.5 billion records / ~ 200 GB of data) in some tables. Currently I use impdp to import. It takes a long time (almost > 9 hours to load these data).
I tried the ways below to import the data (all of these tables is partitioned):
1. normal impdp (single thread that is, parallel = 1): it takes a long time (> 24 hours).
2. normal impdp but partition-wise. It was completed in relatively less amout of time compared to the 1st method.
3 fall drop the index, framed adding another scheme in the same forum that includes data, and then recreate the index (whole process takes about 9 hours)
My questions at all:
1. is there any other way/trick in the book that I can try to put the data in less time
2. what I pointed out that even if I give parallel = 8 or more, sometimes parallel workers are laid and sometimes not. Can someone tell me why?
3. How can I come to know (before running the impdp) that my parallel article will spawn parallel workers or not. As to how I will come to find out, I searched this topic but without success.
I don't know what strategy to follow, because it is an involved and repetitive task for me. Because of the task above, I am not able to focus on other DBA tasks because of what comes to me.
See you soon,.
Malikaassuming that you have a table with 3 clues, then create a script for each index (reblace index_name_n with your index name) and start them at the same time, after the importation of the table is complete
DUMPFILE=
or NETWORK_LINK= DIRECTORY=DATA_PUMP_DIR LOGFILE= CONTENT=ALL PARALLEL=1 JOB_NAME=IMP_ INCLUDE=TABLE_EXPORT/TABLE/INDEX:"IN(' ')" TABLES= . Change the following settings when importing:
increase pga_aggregate_target
increase db_writer_processes
db_block_checking = false
db_block_checksum = falsethe value undo and temporary ts autoextend
Set noarchivelogmode
create logs of restoration of 4 GBHTH
Import excel data in oracle tables
Hello gurus,
Importing excel data in oracle tables...
I know it's the most common question on the wire... First, I searched the forum, I found lots of threads with loading data using sqlloader, excellent in conversion. Txt, file delimited by tabs, file .csv etc...
Finally, I was totally confused in terms of how to get there...
Here's wat I
Here's wat I want to do... .i don't know if its possible- Excel file on local computer. - i have laod data into dev environment tables(So no risk involved, but want to try something simple) - Oracle version 11.1.0.7 - Sqlplus and toad (editors)
SQLLOADER could be an option... but I don't want to go the unix server to place files and newspapers and stuff.- Without going to unix server can i do everthing on local system by making use of oracle db and sqlplus or toad
Wat will be the best option and the easiest to do? and wat format better convert excel csv or txt or tab delimited etc...
If you suggest sqlloader, any example of code will be greatly appreciated.
Thank you very much!!!Hello
Toad version 9.0.0.160, you can directly load data excel file (or any other specified) to table using the navigation "database > import > import the data in the table.
You need to connect to the database, then go to the above navigation. Select the table, validation interval (i.e. commit after each record or once all records), map columns in excel file to your table and press ok.
It loads data directly to your table.But, if you use characters multibyte (such as Chinese) in excel file you want to load, then you must make some settings in your machine.
Don't know if its possible in another version of Toad.
Concerning
ImranHow to publish data from a table using the form
Oracle forms6i
Hai All
I have download the data to the table of forms...
My table T1 columns are in, out, intrinsically, introut, empname, empno
and another table T2 consist of three columns is empno, date, time
In table T2 time fields consist of symbol I, o... I mean IN, O OUT
My Question is when an employee consist of 3 I - the three IN the time
0815 I, 1200 I, 1415 I and OUT 3 times O 1245, 1445 O, O 1715 and empno is 001
If there is no record for empno 001 then insert first 0815 I in table T1 in column IN time then
to update 1200 intrinsically and 1245 update to Introut and 1415 up-to-date addin and 1445 to update addout
Finally in 1715 to outtime
If it is possible to do without Hardcoding the moment Pls tell with some good example
Thanks in advance
Srikkanth.MThere now things are clear... whenever I have free I'll post the code u how to do this...
for now, a few tips can help u
-create the table to store operations travel so then u can't fix your code
-Create the cursor on the T1 line through all the records.
-Control what empno and action i.e. the current cursor (I or O) exists on the same date in T2 or not
-otherwise exists insert a new record check also the SHIFT is coming in time IF is between MAJ 0815 and 1645 and action is 'I' then insert record and column values accordingly
s ' there is, then update the record of the place where empno = cur.empno and attendance_date = mydate;
It may be useful
Baig,
[My Oracle Blog | http://baigsorcl.blogspot.com/]Inserting data into one table to another table.
Hi all
I'm having a few problems when copying data from the 1 table to another table. I have a data 1 date in a table, and I want to insert data in a partition of the main table. As it is the dev database space by getting a problem. I don't have enough space that I can maintain the data for the same date in 2 places.
Here every way possible in oracle this 1 table may be made partition in the other table. (Just a question).
Please suggest me a way out and if possible should be fast that data are more than 50 million lines and size along 10 GB.
Thank youAre the columns of your source table identical to that of the destination partitioned table?
If so, you can create an empty partition in the partitioned table and then create a swap partition to swap the source with the new empty partition table.
Maybe you are looking for
-
Connect my PDA (WM6.1) to my laptop for activesync
I use the HTC Touch Diamond2 and tries to connect to the PC using Vista + Windows Mobile Device Center I have try the parameter listed in the next page then, but when I'm doing"Now the remote PC is questioned if ActiveSync is running on it. If everyt
-
Unable to connect to wifi with new Apple TV 4th generation
I tried to connect to the wi - fi using the new connect with a device and it doesn't seem to work. Rpet could not turn on Apple TV, try again later. Then I try to configure it manually, I have put my password and says no network connection, your wire
-
Need help with streaming pls I installed iLivid and now FoxTab media but cannot listen to the live football for a reason, get really really bored, I wud appreciate all help pls, thanx
-
I was told to uninstall and reinstall itunes. Where can I find to reinstall?
I have Windows Xp home version. My itunes would not work. I couldn't connect to the store. A note came that morning did not work. The cure was to uninstall itunes and then reinstall it. I've removed, now where can I find to reinstall?
-
Why can't I play certan games without my parent password?
So I downloaded this game and now everywhere I want to go I need my parents to allow me to have access to this... and that crazy parent it while I'm still allowed to play this game then why do I need my parents to give me access to this game?