Nested table in "IN CONDITION"
Hi all,
I have this code;
declare
type vt_list is table of varchar2(500);
b vt_list;
c varchar2(50);
begin
b:=vt_list('alin','dan','john');
select contract_id into c from cont_cust where 'alin' in (select * from table(cast(b as nv_list))) and rownum<2;
dbms_output.put_line(c);
end;
it raises an error.
I want to use a nested table in "IN" condition in a select clause: select * from table where tab in nested_table;
I knew something about table and cast...but it doesn' work here.
thanks.
this is the code ai use:
declare
type vt_list is table of varchar2(500);
b vt_list;
c varchar2(50);
begin
b:=vt_list('alin','dan','john');
select contract_id into c from cont_cust where 'alin' in (select * from table(cast(b as nv_list))) and rownum<2;
dbms_output.put_line(c);
end;
I get:
Compilation errors for PROCEDURE SYSADM.AAA
Error: PLS-00642: local collection types not allowed in SQL statements
Line: 7
Text: select contract_id into c from cont_cust where 'alin' in (select * from table(cast(b as nv_list))) and rownum<2;
Error: PL/SQL: ORA-00932: inconsistent datatypes: expected - got CHAR
Line: 7
Text: select contract_id into c from cont_cust where 'alin' in (select * from table(cast(b as nv_list))) and rownum<2;
Error: PL/SQL: SQL Statement ignored
Line: 7
Text: select contract_id into c from cont_cust where 'alin' in (select * from table(cast(b as nv_list))) and rownum<2;
Similar Messages
-
Nested table for PO Output (Item texts) - trying again.
Hi experts
I posted this question already, but the formatting disappeared, so trying again.
I have created a PDF version of the Purchase Order output. Everything works well, except for the last step - a nested table where I want to display Item texts from the PO for every item.
The steps I followed:
1. In the Interface, I read the item texts, and placed them in an internal table, where the table has a field EBELP (item number) and a field for the text. So, for a PO with 5 items, where 2 items have texts, the table might look like this:
00010 First line of text for item 10.
00010 Second line of text for item 10.
00040 Only line of text for item 40.
2. In the context of the form, I put this table 'under' the existing 'ITEM' entry. In other words, for every item, the texts must be displayed. Obviously I then put in an entry under the WHERE CONDITIONS to say that EBELP = ITEM-EBELP, otherwise it would repeat every line of text for every item.
The problem is that it does not behave quite as I expected. It currently prints:
Item 10 information
First line of text for item 10.
Second line of text for item 10.
Item 20 information
Only line of text for item 40.
Item 30 information
Item 40 information
Item 50 information
Where it should print:
Item 10 information
First line of text for item 10.
Second line of text for item 10.
Item 20 information
Item 30 information
+Item 40 information+
Only line of text for item 40.
Item 50 information
In other words, it simply 'breaks' on change of EBELP, and moves the text to the next line, as opposed to the correct line.
I tried debugging, and it does appear to be doing things in the right order, but it is still doing the output incorrectly. I also searched the forums for similar problems, but I could not find a solution to the problem I am experiencing.
I also put 'dummy' (empty) rows into the table - that fixes it, but then it messes with my layout and I get something like:
Item 10 information
First line of text for item 10.
Second line of text for item 10.
Item 20 information
Item 30 information
Item 40 information
Only line of text for item 40.
Item 50 information
In the above, I don't want the gaps where the empty rows are.
Please advise?
Thanks and kind regards
CasperReposted without formatting...
I have created a PDF version of the Purchase Order output. Everything works well, except for the last step - a nested table where I want to display Item texts from the PO for every item.
The steps I followed:
1. In the Interface, I read the item texts, and placed them in an internal table, where the table has a field EBELP (item number) and a field for the text. So, for a PO with 5 items, where 2 items have texts, the table might look like this:
00010 First line of text for item 10.
00010 Second line of text for item 10.
00040 Only line of text for item 40.
2. In the context of the form, I put this table 'under' the existing 'ITEM' entry. In other words, for every item, the texts must be displayed. Obviously I then put in an entry under the WHERE CONDITIONS to say that EBELP = ITEM-EBELP, otherwise it would repeat every line of text for every item.
The problem is that it does not behave quite as I expected. It currently prints:
Item 10 information
First line of text for item 10.
Second line of text for item 10.
Item 20 information
Only line of text for item 40.
Item 30 information
Item 40 information
Item 50 information
Where it should print:
Item 10 information
First line of text for item 10.
Second line of text for item 10.
Item 20 information
Item 30 information
Item 40 information
Only line of text for item 40.
Item 50 information
In other words, it simply 'breaks' on change of EBELP, and moves the text to the next line, as opposed to the correct line.
I tried debugging, and it does appear to be doing things in the right order, but it is still doing the output incorrectly. I also searched the forums for similar problems, but I could not find a solution to the problem I am experiencing.
I also put 'dummy' (empty) rows into the table - that fixes it, but then it messes with my layout and I get something like:
Item 10 information
First line of text for item 10.
Second line of text for item 10.
Item 20 information
Item 30 information
Item 40 information
Only line of text for item 40.
Item 50 information
In the above, I don't want the gaps where the empty rows are.
Please advise?
Thanks and kind regards
Casper -
How to use nested table values in IN expression?
Hi!
Can someone please give me a hint to the correct syntax for this:
declare
TYPE numtable is table of number;
tt numtable;
begin
select myId bulk collect into tt from some_table;
update some_other_table set name = 'kakadu' where xId in (select * from tt); -- this line is wrong as it is
end;What I am doing is fixing a stored procedure that was like this before:
update table_a set name = 'kakadu' where column_X in (select one.A from table_1 one join table_a on x y z WHERE a b c);
update table_b set name = 'nimfa' where column_Y in (select one.B from table_1 one join table_a on x y z WHERE a b c);The problem is, the first UPDATE changes the result of the SELECT, so I want to "remember" it.
A and B are columns in table_1, A is the primary key. So the fixed code would be like:
-- store the list of selected IDs from table_1
select A bulk collect into tt from table_1 one join table_a on x y z WHERE a b c ; -- same conditions as in old code
-- do the updates
update table_a set name = 'kakadu' where column_X in (select * from tt);
update table_b set name = 'nimfa' where column_Y in (select one.B from table_1 one where one.A in tt);(it can be a varray instead of nested table, as far as I am concerned)
Thanks,
DavidYes, it needs to be a SQL type
Re: How to pass an array to a function from a SELECT statement
Or you can use a built in SQL type (version dependent)
Re: Collection in where not working -
Using Nested Table in Select Statement
Hi all ,
Can i use the PL/SQL nested table or Varray
in the select statement as a normal table joined with other database tables.
i.e.
I have a nested table NT_1 in PL/SQL proc
i have to use this NT_1 in the select statement as
select xxx from
tab_1,
tab_2,
NT_1
where
< some conditional joins >.
Please help me in this regard.
regds
Dhananjaya.Hyou can not use a varray as part of a SQL Statement in order to build joins.
Can you explain better what do you want to do ?
Joel P�rez -
Import tables with nested table : ORA-00600
In Oracle 9.2
Create object, type as table, and table with nested table (store as syms_ntab) are successfully.
Also its export.
In process of import on another server (also 9.2, 'fromuser=one touser=two') shows errors:
. . importing table "SYMS_NTAB"
IMP-00058: ORACLE error 600 encountered
ORA-00600: internal error code, arguments: [kokeeafi1], [2], [2], [], [], [], [], []
IMP-00075: Warning: The nested table may contain partial rows or duplicate rows
But for all that table is created and error occur on phase inserting strings.
What is this?
In Oracle 8.0.5 i perform similar operation without error.From Oracle error messages and codes manual:
ORA-00600 internal error code, arguments: [string], [string], [string], [string], [string], [string], [string], [string]
Cause: This is the generic internal error number for Oracle program exceptions. It indicates that a process has encountered a low-level, unexpected condition. Causes of this message include:
* timeouts
* file corruption
* failed data checks in memory
* hardware, memory, or I/O errors
* incorrectly restored files
The first argument is the internal message number. Other arguments are various numbers, names, and character strings. The numbers may change meanings between different versions of Oracle.
Action: Report this error to Oracle Support Services after gathering the following information:
* events that led up to the error
* the operations that were attempted that led to the error
* the conditions of the operating system and databases at the time of the error
* any unusual circumstances that occurred before receiving the ORA-00600 message
* contents of any trace files generated by the error
* the relevant portions of the Alter files
Note: The cause of this message may manifest itself as different errors at different times. Be aware of the history of errors that occurred before this internal error. -
NESTED TABLES,,Header data and Item data
How to arrange them in the hierarchy view?
How to put a condition on the item table so that only corresponding items from the item table will be shown for each header.
header table data 1211
1212
item table data is 1211 10
1211 20
1212 10
1212 20
so final output should be
1211
1211 10
1211 20
1212
1212 10
1212 20.
So how to put this condition?
Can you please help me
Regards
sasiHi,
If you designing the form using SFP Transaction, then you have to set the where clause on the item table in the context.
In the SFP context drag the header table from interface.drag the item table from interface on the DATA in the header table. it will placed at the end of the header table. Now select the item table select where clause in the properties ( at the bottom of the screen ).there you create a line for condition using create button. drag the field from header table field ( say header-matnr ) on the right side and then drag the same field from the item table ( say item-matnr) in the left side.This will filter the item records relevent for header record.
In the layout, design the table as I explained in the forum message .( search forum with text "Nested Tables and Multiple Pages" )
pavan meda -
Nested tables.... Please help
Hi Friends,
I have some strange issues when I am trying to create a nested dynamic table with SAP DATA in Adobe Designer.
In the context, under the MAIN node
I had dragged the header table. Under the header table I had dragged the item table and had created a WHERE condition to link the HEADER and ITEM table.
Now my layout is pretty complicated..
I want to result to be as below:
header row.... with 0001 Customer name
item row with 0001 0010 price qty
0001 0020 price qty
0001 0030 price qty
header row... field4
(field4 from the header table has to be displayed after the item table has generated all the items and this process should repeat for all header data)
My design in layout is as below
subform1 for headerdata
( set as positioned and has set to 'Repeat form for each data item')
headerdata fields for subform1 (field1, field2, field3)
subform2 for itemdata
(set as folowed)
subform3 for itemdata
(set as positioned, 'Allow page breaks within content' and had set 'Repeat form for each data item')
itemdata fields in subform3
subform4 for headerrow field4
but when I activated and execute the form, the result was wrong.
The result should be like below...
|->field1, field2, field3
|--->field1 charge111
|--->field1 charge211
|-> field4
|->field2
|--->field2 charge122
|--->field2 charge222
|-> field4
but it is printed like below and field4 is overlapped with the item rows if the item rows are more...
DATA
|->field1 field2 field3
|--->field1 charge111 This inner table is overlapping the subform4 for each item
|--->field1 charge211
|
|->field1 field2 field3
|--->field1 charge121 This inner table is overlapping the subform4 for each item
|--->field1 charge221
2) If I have more item data, all the item rows are overlapped with the field4 (which I had explained in my layout) and the item rows are not moved to the next page, but still it is continued in the same page, meaning that if the page can fill 20 lines and my item row are more than 20 lines, 20 lines are printed and the remaining items are not moved to the next page... it is invisible...
How can I solve this issue?
Please help me
Thanks in advance.
Jaffer Ali.SHi Francois. Thank you very much for your reply, but it seems that i still get errors. So let me tell what i have done.
As you suggested me: i have done a block based on a sub-query for the nested-table:
'select courses from department where name= :department.name'.
In the master block(department) i have the when-new-record-instance trigger:
Declare
LC$Req varchar2(256);
Begin
LC$Req := '(select ns.courses from table
( select courses from department where name = ''' || :DEPARTMENT.name || ''' ) ns )';
Go_block('block11');
Clear_Block ;
Set_Block_Property( 'block11', QUERY_DATA_SOURCE_NAME, LC$Req ) ;
Execute_query ;
End ;
Now the errors i receive, this time in the runtime mode are:
- FRM-41380: Cannot set the blocks query data source
-FRM-41003: This function cannot be performed here.
Since it seems that you know how to work with the nested table i would really appreaciate your help. I am new in the nested table and if you could give an ex with my tables it would be great.
Thank you in advance. -
Need to return dynamic column names for a function returning nested table
I am having a pl/sql function which is returning a nested table.
For this i have defined an object which is having 4 attributes- 1 number type, 3 varchar2 type -p1,p2,p3.
My function is taking input parameter v1,v2,v3 all of varchar2 type.Inside the function body,i am using these (v1,v2,v3) to filter data from an sql query and i am also
using pivot function in this sql query.
At the end my function is returning the object as defined in the starting .
When i am excuting this function,thru select statement :
select * from table(f1_test('A','B','C'));
i am geting p1,p2,p3 as column name ,which are names used when i had defined object type.Instead i want column name to be dynamic (wotever i am passing in function as
parameter while executing the function ,here A,B,C)
Please help me in geting column names dynamic as passed in input parameter (i.e A,B,C for this case )
Sample code for the problem:
create or replace TYPE obj1 AS OBJECT
( id number(5,0)
,p1 varchar2(10),
,p2 varchar2(10)
,p3 varchar2(10)
create or replace TYPE tt1 AS TABLE OF OBJ1;
create or replace
function f1_test (v1 varchar2,v2 varchar2,v3 varchar2)
return tt1 as
v_return tt1 ;
v_str varchar2(30000);
begin
v_str:='
select
cast(
multiset(
select * from
select
aa.report_id
,cc.name
,e.amount
from
aa,cc,e
where
<join conditions>
and cc.name in ('''||v1||''','''||v2||''','''||v3||''')
pivot (sum (amount) for name in ('''||v1||''' as '||v1||','''||v2||''' as '||v2||','''||v3||''' as '||v3||'))
as tt1)
from
dual';
dbms_output.put_line(v_str);
execute immediate v_str
into
v_return ;
return v_return;
end;
Edited by: 845831 on 20 Mar, 2011 12:15 PMselect id,p1 A,p2 B,p3 C from table(f1_test('A','B','C'));
drop function f1_test;
drop type tt1;
drop type obj1;
create or replace TYPE obj1 AS OBJECT
( id number(5,0)
,p1 varchar2(10)
,p2 varchar2(10)
,p3 varchar2(10)
create or replace TYPE tt1 AS TABLE OF OBJ1;
CREATE OR REPLACE
FUNCTION f1_test(
v1 VARCHAR2,
v2 VARCHAR2,
v3 VARCHAR2)
RETURN tt1
AS
v_return tt1 ;
v_str VARCHAR2(30000);
BEGIN
v_str:='select cast(multiset(select 1,''20'',''30'',''40'' from dual) as tt1) from dual';
dbms_output.put_line(v_str);
EXECUTE immediate v_str INTO v_return ;
RETURN v_return;
END;
/ -
Nested tables as separate lines in output
I'm working with Adobe forms using transaction SFP from the ABAP Workbench. I'm trying to construct a prototype of an SD invoice, with one internal table having the basic item data, and then a secondary table with further information, such as discounts, taxes, etc. The item number is part of both tables so that they can be related to each other. Using right-click and Create in the context I constructed a loop on the main table, and then under that a loop on the secondary table, with the equal item number as a condition. It all works, but in the output the secondary data comes out on the same line as the main item data, and when I try to drag it down to the next line in the layout, it changes its position in the data view also, so that it's outside the loop and prints only once, over the second main item line. Surely for an invoice or a purchase order it's normal to have one basic item line, and then one or more other lines with various other information for each item. It's very easy in both SAPscript and Smart Forms to have a loop within a loop displaying separate lines, but so far I haven't been able to get it to work with Adobe.
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> CREATE OR REPLACE TYPE table_type AS TABLE OF VARCHAR2 (8);
2 /
Type created.
SQL> CREATE TABLE r(
2 a INTEGER,
3 b table_type)
4 NESTED TABLE b STORE as b_1;
Table created.
SQL> CREATE TABLE s(
2 a INTEGER,
3 b table_type)
4 NESTED TABLE b STORE as b_2;
Table created.
SQL> INSERT INTO r VALUES (1, table_type ('a', 'b'));
1 row created.
SQL> INSERT INTO s VALUES (1, table_type ('b', 'c'));
1 row created.
SQL> COLUMN c FORMAT A10;
SQL> SELECT r.a, r.b MULTISET UNION DISTINCT s.b c
2 FROM r, s
3 WHERE r.a = s.a;
A C
1 TABLE_TYPE('a', 'b', 'c')
SQL> -
Hi all!
1. I need canonical form of XML from my XSQL servlet. So I write
select * from my_obj_view;
2. When I need to use 'where' condition for nested table in object view, I do follows:
select * from my_object_view o, TABLE(o.my_nested_table) n where n.col_name = 5;
But result has not such form as in first example (has form of relational table w/o nested data of nested table). When I write:
select * from my_obj_view where my_obj_view.nested_table.col_name = 5;
I got error: ORA-00904: invalid column name
Please, where I am wrong?I'm not sure what you are looking for exactly but is it something like this?
SELECT id
, p.ctx_name
, p.ctx_value
FROM tt
, TABLE(ctx) pWith the following test data:
INSERT INTO tt VALUES(1,CTX_TAB(CTX_LINE('A','SOME VALUE1')));
INSERT INTO tt VALUES(1,CTX_TAB(CTX_LINE('B','SOME VALUE2')));
INSERT INTO tt VALUES(1,CTX_TAB(CTX_LINE('B','SOME VALUE2')));this is the result:
SQL> SELECT id
2 , p.ctx_name
3 , p.ctx_value
4 FROM tt
5 , TABLE(ctx) p
6 /
ID CTX_NAME CTX_VALUE
1 A SOME VALUE1
1 B SOME VALUE2
1 B SOME VALUE2 -
Adobe forms nested table layout
Hi,
I have an xml input described by a schema including 3 level nested table like this:
Table1
__col1 col2 col3
__Table2
____col1 col2 col3
____Table3
______col1 col2 col3
In Adobe LC I have no problem to link the tables using Subforms but the PDF layout I get is very width because the subforms are lined up horizontal one after the other and some columns contains long strings.
I would like to place Subforms vertical with some indent, and get a layout more like this:
Table1 columns (first occurrence)
__Table2 columns (rows related to table1 first occurrence)
____Table3 columns (rows related to table2 first occurrence)
Table1 columns (second occurrence)
__Table2 columns (rows related to table1 second occurrence)
____Table3 columns (rows related to table2 second occurrence)
And so on.
When I try to move a Subform one under the other I get warnings about lost reference.
Please give me a hint how to do this.
/K-EHi Prakash,
Thanks for your reply.
I tried it..... but nothing came out...
Is there any alternative for this...
My Hirearchy is like this...
Main Table (SubformA - MainSubform) set as flowed, repeat for each data item
Maintable-field1 Maintable-field2 (Subform) set as positioned
Inner table (table subform) set as flowed
Innertable-field1 Innertable-field2 (subform) set as positioned
I linked the Maintable and the Innertable in the context in the 'Where Conditions' tab
Kindly review the above hirearchy and reply...
Guys please help me.... I am in an urgent state and need to complete this ASAP.
I will give full points for all of u guys...
Please.... please... please....
Thanks in advance.
Jaffer Ali.S -
Suggestions On Table design - Usage of Nested Tables.
Hi All,
DB Vesion - 10.2.0.1.0
We have an existingtable say, REPORT_MASTER with more than 4 Million records.( 27 Columns )
Now the requirement is as follows: Every day, a job has to run to upadte each row in the REPORT_MASTER table. ( COLUMNs to be updated are new columns -to be designed)
Rules for the updation are generated dynamically depending on a parameter table.
In total, more than 500 update statement will run for updating the whole table (it is not possible reduce the number of updations). Now after the updation the records in the table will be like
ExistingColumns NewColumn1 NewColumn2 NewColumn3 ........
........ BRF01.1 BRF02.5 BRF03.1 .......
........ BRF01.3 BRF02.1 BRF03.2 .......
........ ...... ...... ...... ......First few updates, for example will update "NewColumn1". Next few updates will update "NewColumn2" and so on..
Now My Query is about designing the new columns:
1.If I did as the above sample output there should be 37 new columns as per current requiremnent. It can increase when new report is required.
2.If I go for a Nested Table, my concern is about the update statement. Is there any way to achieve the below code..
update report_master
set new_nested_tab_col(5) = 'BRF02.6'
where .....
And also how will be the performance?
3.If I go for a detail table, it will have a size of almost 37 times that of master_table.
I have to loop through this table (ofcourse with joining to the master table) 37 times again afetr updation for report generation. (This is required anyhow, but here data volume is high)
4. Other methode, ofcourse not very professional, is to keep a single varchar2 column and update that column, so that it will have value like
BRF01.1,BRF02.3,BRF03.1....
Or any other better alternative..?
Please suggest.
Thanks in advance,
Jeneesh
Edited by: jeneesh on Apr 13, 2009 11:36 AM
Update statements will be like as follows, if the basic design is selected :
update REPORT_MASTER set NEW_COLUMN1 = 'BRF01.1' where dynamic_condition1 and NEW_COLUMN1 is not null;
update REPORT_MASTER set NEW_COLUMN1 = 'BRF01.2' where dynamic_condition2 and NEW_COLUMN1 is not null;
update REPORT_MASTER set NEW_COLUMN2 = 'BRF02.1' where dynamic_condition25 and NEW_COLUMN2 is not null;
...Edited by: jeneesh on Apr 13, 2009 12:40 PM
Taking it to front....
Edited by: jeneesh on Apr 14, 2009 8:37 AM
Still I am not comfortable to use 37 columns..APC wrote:
Not sure what you're expecting from us. I'm afraid you haven't explained your scenario clearly, so it's difficult to offer design advice. I will try to explain better:
Basically, requirement is to generate 37 (BRF01 to BRF37) reports from the table CRB_OUTPUT_VIEW_TAB.
(This is the Master Data Table - In the original thread I have mentioed it as REPORT_MASTER).
Each report needs to apply different rules. For this, a RULE table(Parameter table) is provided.
Master Data Table
SQL> desc crb_output_view_tab
Name Null? Type
COMPANY VARCHAR2(240)
GLNO VARCHAR2(144)
CURRENCY VARCHAR2(15)
CUSTOMER_NAME VARCHAR2(240)
ACC_DEAL_NO VARCHAR2(29)
FCY VARCHAR2(18)
LCY VARCHAR2(18)
INT_EXH_RT NUMBER
VALUE_DATE VARCHAR2(10)
MAT_DATE VARCHAR2(10)
CUSTOMER VARCHAR2(50)
BRANCH VARCHAR2(25)
INT_BASIS VARCHAR2(10)
OGLKEY VARCHAR2(207)
SECTOR VARCHAR2(6)
INDUSTRY VARCHAR2(6)
TARGET VARCHAR2(2)
RESIDENCE VARCHAR2(2)
NATIONALITY VARCHAR2(2)
REPORT_DATE VARCHAR2(11)
GL_DESC VARCHAR2(50)
PORTFOLIO VARCHAR2(10)
LOAN_TYPE VARCHAR2(10)
EXH_RT NUMBER
BLSHEET VARCHAR2(50)
SOURCE CHAR(3)
CATEGORY VARCHAR2(6)
BRF_CODE VARCHAR2(20)
DR_CR VARCHAR2(6)
NA VARCHAR2(6)
Rules - Master Table
SQL> select * from brf_parameters order by brf_id,seq;
PARAM_ID BRF_ID SEQ BRF_CODE COLUMN_NAME DATA_TYPE
2 BRF01 1 BRF010001 GLNO CHAR
1 BRF01 1 BRF010001 CURRENCY CHAR
3 BRF01 2 BRF010002 GLNO CHAR
4 BRF01 3 BRF010006 GLNO CHAR
6 BRF01 4 BRF010008 GLNO CHAR
5 BRF01 4 BRF010008 RESIDENCE CHAR
390 BRF02 1 BRF020001 RESIDENCE CHAR
391 BRF02 1 BRF020001 BRF_PARENT CHAR
392 BRF02 2 BRF020002 RESIDENCE CHAR
393 BRF02 2 BRF020002 INDUSTRY CHAR
394 BRF02 2 BRF020002 BRF_PARENT CHAR
Rules - detail Table: (Linked to brf_parameters by param_id)
SQL> select * from brf_param_values where param_id in (1,2);
PARAM_ID CONDITION VALUE1 VALUE2
1 IN AED
2 IN 0010
SQL> ed
Wrote file afiedt.buf
1 select p.seq,p.brf_id,p.brf_code,p.column_name,v.condition,v.value1,v.value2
2 from brf_parameters p,brf_param_values v
3 where p.param_id = v.param_id
4* order by p.brf_id,p.seq,p.param_id
SQL> /
SEQ BRF_ID BRF_CODE COLUMN_NAME CONDITION VALUE1 VALUE2
1 BRF01 BRF010001 CURRENCY IN AED
1 BRF01 BRF010001 GLNO IN 0010
2 BRF01 BRF010002 GLNO IN 0010
3 BRF01 BRF010006 GLNO IN 0030
4 BRF01 BRF010008 RESIDENCE IN AE
4 BRF01 BRF010008 GLNO IN 0040
5 BRF01 BRF010009 GLNO IN 0040
6 BRF01 BRF010004 GLNO IN 0050
6 BRF01 BRF010004 CATEGORY IN 5001
6 BRF01 BRF010004 DR_CR IN Debit
7 BRF01 BRF010049 DR_CR IN Debit For genarating the report BRF01 :
Updation will be done based on each "SEQ" value shown above. So..
Ist update: (Generated from SEQ = 1 for BRF_ID = BRF01)
update crb_output_view_tab set new_brf_code_column = 'BRF010001'
where currency in ('AED') and GLNO in ('0010');
--This is sample. it will be like : GLNO in ('0010','0040','0056'.....)IInd update: (Generated from SEQ = 2 for BRF_ID = BRF01)
update crb_output_view_tab set new_brf_code_column = 'BRF010002'
where GLNO in ('0010')
and new_brf_code_column is null;..... And so on.
The data in the "new_column" is required for report generation.
After all the updations the report "BRF01" (through UTL_FILE) will be generated.
After that updation for BRF02 will be performed and report will be generated.
I have to store the data for all BRF01,BRF02.. because these are used for online reports which are accessed from Discoverer also.
What changes are you making that has lead to you considering nested tables or child tables? I have explained in detailed manner above. (Please revert if not clear)
Why would a detail table be 37 times as big as one table? I was thinking of adding a PK to "crb_output_view_tab" and a new detail table like
pk_from_crb_output_view_tab NUMBER
brf_id VARCHAR2
brf_code VARCHAR2Now here the number of rows will be 37* number_of_rows_in_crb_output_view_tab
Big in which dimension(s)? I have to join the master table and new_detail_table for each report generation
What drives the design - the updating of REPORTS_MASTER or the application which uses the updated data?The time for updation and daily generation of 37 reports (We can ignore the performance of discoverer reports)
Thanks,
Jeneesh -
Problem in creation of Nested Table
Hi Everyone,
I have applied thisexample for creating nested tables but at the end I got the message of invalid datatype
current_address full_mailing_address_type,
ERROR at line 4:
ORA-00902: invalid datatype
http://www.praetoriate.com/oracle_tips_nested_tables.htm
Please help me out.....
Message was edited by:
DharmendraWhat is the output for
select * from user_types
? -
Nested tables and multiset operators in Oracle 10g
Consider the following scenario:
We have two identical relations R and S defined as:
CREATE TABLE R(
a INTEGER,
b table_type)
NESTED TABLE b STORE as b_1;
CREATE TABLE S(
a INTEGER,
b table_type)
NESTED TABLE b STORE as b_2;
where table_typ is defined as
CREATE TYPE table_typ AS TABLE OF VARCHAR2(8);
Suppose we have two instances of R and S, each having one tuple as follows: R(1,table_typ('a','b')) and S(1,table_typ('b','c')).
I would like to "merge" these two simple instances (e.g., achieve the effect of a simple SELECT * FROM R UNION SELECT * FROM S query) and obtain the following resulting instance: Result(1,table_typ('a','b','c')).
Would this be possible in Oracle 10g? A simple UNION does not work (I got a "inconsistent datatypes: expected - got SCOTT.TABLE_TYP" error). I also took a look at the MULTISET UNION operator over nested tables available in Oracle 10g, but it doesn't seem to get me anywhere. Any help on this would be greatly appreciated.
Thank you,
LauraOracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> CREATE OR REPLACE TYPE table_type AS TABLE OF VARCHAR2 (8);
2 /
Type created.
SQL> CREATE TABLE r(
2 a INTEGER,
3 b table_type)
4 NESTED TABLE b STORE as b_1;
Table created.
SQL> CREATE TABLE s(
2 a INTEGER,
3 b table_type)
4 NESTED TABLE b STORE as b_2;
Table created.
SQL> INSERT INTO r VALUES (1, table_type ('a', 'b'));
1 row created.
SQL> INSERT INTO s VALUES (1, table_type ('b', 'c'));
1 row created.
SQL> COLUMN c FORMAT A10;
SQL> SELECT r.a, r.b MULTISET UNION DISTINCT s.b c
2 FROM r, s
3 WHERE r.a = s.a;
A C
1 TABLE_TYPE('a', 'b', 'c')
SQL> -
Nested tables in RTF templates
Hi,
I've developed several templates including nested tables(to display parent/child transactions together in a single column group, displaying all the detail transactions but the parent only once), in PDF output this looks fine. However the users want all their output in Excel, this same layout is not picked up by Excel(all column headers for the data in the nested table move to the right, while all the data in the nested table is grouped under a 'merged cell' column header). Output of BI Publisher reports in Excel is generally terrible with a template designed for publishing in PDF, usually I can solve this with a lot of tweaking but haven't found a solution for this issue yet. Has anyone else run into this formatting issue and may have a tip to solve this?
Regards,
ArthurHi,
You need to declare a TYPE object as and then use it in the table structure.
CREATE TYPE type_emp IS TABLE OF VARCHAR2(15);
CREATE TABLE Biscuits Company SA
(company_name COMPANY NOT NULL,
Company_Owner VARCHAR2(20) NOT NULL)
NESTED TABLE staff_tab STORE AS type_emp;
Please see the link for more info.
http://www.developer.com/db/article.php/10920_3379271_3
Thanks
Maybe you are looking for
-
Hi I'm creating a report wich shows the Commit, Paid, Budget, etc. in PS module. I will take these column values from severel PS reports generated with the 'Report Printer' tool, wich allow to calculate the values vía a 'semantic formules' using ke
-
I am having trouble using the JButtons. I'm trying to create buttons that have two lines of text in them (a string with a newline character in it), but for some reason the text on the button always reads as one line, even though the string itself pri
-
Itouch won't turn On OR Show up in Itunes
Left my 3nd generation itouch in the car for an hour while it was 30 degrees out and now it wont turn on or connect and show up in itunes. it also wont connect to my ihome or my car connector. I refuse to buy a new one cause of the price. Can anyone
-
How can I split an Orders05 iDoc into multiple iDocs?
Hello, Can one of you experts please tell me how I can split an ORDERS05 iDoc into multiple iDocs based upon Delivery addresses? For example, if the iDoc contains 3 different Delivery Addresses then I need to split it into 3 iDocs. It has been sugge
-
Understand​ing velocity control on 9505 FPGA VI
I was able to quickly use the 9505 Servo Drive example to do closed loop position control on the FPGA but I'm having trouble with figuring out how to modify the code to support velocity control (which I need for a different axis). I'm trying to make