Join 2 tables with a reference table
I have two large tables that I am trying to join together by two columns. Below are the tables with two samples in each table, the reference table and also the final result that i want. Can anyone help me and any pointers. Thank you so much.
Join on xAlias = mAlias
Join on xValue =mValue
And if xValue =mValue is null then look at xRefValue = mRefValue
Result
Please provide example data in tables. For an example of this, see the top of the code.
Try this:
DECLARE @1stTable TABLE (xitem VARCHAR(15), xAlias VARCHAR(30), xvalue VARCHAR(30))
INSERT INTO @1stTable (xitem, xAlias, xvalue)
VALUES
('HGJ53456FCN','Finish/Coating', 'Black Oxide'),('HGJ53456FCN','Series/List', '8301'),('HGJ53456FCN','Material', 'High Speed Steel-E'),('HGJ53456FCN','Number of Flutes', '3'),('HGJ53456FCN','Overall Length (Inch)', '3-19/32'),
('HGJ53456FCN','Threads Per Inch', '12'),('HGJ53456FCN','Thread Limit', 'H3'),('HGJ53456FCN','Shank Diameter (Inch)', '0.429'),('HGJ53456FCN','Thread Size (Inch)', '9/16-12'),('HGJ53456FCN','Chamfer', 'Plug'),
('HGJ53456FCN','Thread Direction', 'Right Hand'),('HGJ53456FCN','Thread Length (Inch)', '63/64'),('HGJ53456FCN','Thread Standard', 'UNC'),('LOP65986','Finish/Coating', 'Black Oxide'),('LOP65986','Series/List', '5303S'),
('LOP65986','Material', 'High Vanadium High Speed Steel'),('LOP65986','Number of Flutes', '4'),('LOP65986','Overall Length (Inch)', '38078'),('LOP65986','Threads Per Inch', '10'),('LOP65986','Thread Limit', 'H3'),
('LOP65986','Shank Diameter (Inch)', '0.59'),('LOP65986','Thread Size (Inch)', '3/4-10'),('LOP65986','Chamfer', 'Bottoming'),('LOP65986','Thread Direction', 'RIGHT Hand'),('LOP65986','Thread Length (Inch)', '2'),
('LOP65986','Thread Standard', 'UNC')
DECLARE @2ndTable TABLE (mItem int, mAlias varchar(30), mValue varchar(50))
INSERT INTO @2ndTable (mItem, mAlias, mValue)
VALUES
(53456, 'Manufacturer''s Part Number', NULL),(53456, 'Chamfer', 'Plug'),(53456, 'Finish/Coating', 'Oxide'),(53456, 'Material', 'Vanadium High Speed Steel'),(53456, 'Material Application', 'Carbon Steel; Hardened Steel; Stainless Steel'),
(53456, 'Number of Flutes', '3'),(53456, 'Overall Length (Inch)', '3-19/32'),(53456, 'Oversize (Yes/No)', 'No'),(53456, 'Series/List3', '00'),(53456, 'Shank Diameter (Decimal Inch)', '0.4290'),
(53456, 'Square Size (Decimal Inch)', '0.3220'),(53456, 'Thread Direction', 'RIGHT Hand'),(53456, 'Thread Length (Inch)', '1-21/32'),(53456, 'Thread Limit', 'H3'),(53456, 'Thread Size (Inch)', '9/16-12'),
(53456, 'Thread Standard', 'UNC'),(53456, 'Through Coolant (Yes/No)', 'No'),(65986, 'Manufacturer''s Part Number', NULL),(65986, 'Chamfer', '2-1/2'),(65986, 'Finish/Coating', 'Oxide'),
(65986, 'Material', 'High Speed Steel'),(65986, 'Material Application', 'Cast Iron; Ductile Iron; Steel'),(65986, 'Number of Flutes', '4'),(65986, 'Overall Length (Decimal Inch)', '4.2500'),(65986, 'Overall Length (Inch)', '4-1/4'),
(65986, 'Oversize (Yes/No)', 'No'),(65986, 'Shank Diameter (Decimal Inch)', '0.5900'),(65986, 'Thread Direction', 'RIGHT Hand'),(65986, 'Thread Length (Decimal Inch)', '2.0000'),(65986, 'Thread Length (Inch)', '2'),
(65986, 'Thread Limit', 'H3'),(65986, 'Thread Size (Inch)', '3/4-10'),(65986, 'Thread Standard', 'UNC'),(65986, 'Through Coolant (Yes/No)', 'No')
DECLARE @refTable TABLE (aliasName VARCHAR(30), xRefValue VARCHAR(40), mRefValue VARCHAR(50))
INSERT INTO @refTable (aliasName, xRefValue, mRefValue)
VALUES
('Finish/Coating','Black Oxide','Oxide'),('Finish/Coating','SH47 Oxide Nitride','Oxide'),('Finish/Coating','Steam Oxide','Oxide'),('Material','High Speed Steel-E','Vanadium High Speed Steel'),('Material','High Vanadium High Speed Steel','Vanadium High Speed Steel'),
('Material','High Vanadium High Speed Steel-E','Vanadium High Speed Steel'),('Material','High Vanadium High Speed Steel-E-PM','Vanadium High Speed Steel'),('Material','High Speed Steel','Vanadium High Speed Steel'),('Material','Carbide','Solid Carbide'),('Material','Powdered Metal Cobalt','Powdered Metal'),
('Material','High Vanadium High Speed Steel','High Speed Steel'),('Material','High Carbon Steel','High Speed Steel'),('Material','High Speed Steel-E','High Speed Steel'),('Material','High Vanadium High Speed Steel-E','High Speed Steel'),('Material','High Speed Steel','High Carbon Steel'),
('Material','High Speed Steel-E-PMT15 Cobalt','Cobalt Vanadium High Speed Steel'),('Material','High Speed Steel Cobalt','Cobalt'),('Material','High Speed Steel-E Cobalt','Cobalt'),('Material','High Speed Steel-E-PMT15 Cobalt','Cobalt'),('Material','High Carbon Steel','Carbon Steel'),
('Material','Bottoming','2-1/2'),('Material','Taper','2-1/2'),('Material','Bottoming','1 to 3-1/2'),('Material','Taper','1 to 3-1/2')
SELECT xItem, mItem, xAlias, xValue, mValue
FROM @1stTable st
INNER JOIN @2ndTable nd
ON st.xAlias = mAlias
AND st.xValue = mValue
LEFT OUTER JOIN @refTable rt
ON st.xAlias = rt.aliasName
AND st.xvalue = rt.mrefValue
ORDER BY xItem, xAlias
Similar Messages
-
Can we join Ztables with SAP std. tables in SQVI ?
Dear All,
Can we join Ztables with SAP std. tables in SQVI ?
How to use "left outer join" in SQVI ?
What r the rules/steps to be followed for creating right SQVI/query ?
Sometimes it gives error / we do not get any output ....
Pl' give examples.hi
good
1- Yes
3-Check this example for SQVI Query.
It is possible to generate a complete list of purchase document releases with the purchase document number (requisitions and orders), releaser, release date and release time.
First, create an Infoset using transaction SQ02 directly reading from table CDPOS and create an additional table: CDHDR. If you are releasing purchase requsitions at the item level, it is convenient to create an additional field (PURPS LIKE EBAN-BNFPO) to capture the item number. Once the field is defined add the following code to it:
PURPS = CDPOS-TABKEY+14(5).
Once created, make sure to assign your Infoset to the user groups.
Second, create an SAP Query (SQ00) or QuickViewer (SQVI) based on the Infoset you created previously. Set CDPOS-OBJECTID, PURPS (additional field), CDHDR-USERNAME, CDHDR-UDATE & CDHDR-UTIME, CDPOS-TCODE, CDPOS-VALUE_NEW, and CDPOS-VALUE_OLD as list fields (display screen).
Set CDPOS-OBJECTCLAS, CDPOS-OBJECTID, CDPOS-TABNAME, CDPOS-FNAME, CDPOS-CHANGIND, CDHDR-USERNAME, CDHDR-UDATE & CDHDR-UTIME as the selection fields (selection screen).
Finally, execute your query. For filtering purchase requisition releases set:
Object class='BANF'
Table Name='EBAN'
Field Name='FRGKZ'
Change type='U'
For filtering purchase order releases set:
Object class='EINKBELEG'
Table Name='EKKO'
Field Name='FRGKE'
Change type='U'
Make sure to specify username, dates or purchase document number (object value) in order to reduce run times.
thanks
mrutyun^ -
Hi,
I need to put a table with in a Table pop in. I am able to achieve the table but the I am unable to display different data for each pop in. action.
Example.
Table has 3 records
Row 1
Row 2
Row 3
On expanding Row1 using pop in I am able to display the table.
On expanding Row 2, leaving Row 1 expanded, changes the data in both the Areas, showing data of Row 2.
Could you please help in resolving the issue.Hi Prasanth,
To display different data inside the table popin, create child node inside the parent node.
Parent_node(0....n)
Child_node( 0....n )
Create a supply function for CHILD_NODE and on select of any row in parent table, write the logic to fill data of child node . Bind this child node to TABLE_POPIN's table
Now, if you select row1, you can fill child node in supply function and it populates the data,
similarly, it works for other rows as well
Hope this helps you.
Regards,
Rama -
The table with Name of 'Table Name' does not exist.An error occurred when loading the Model.
We get this error when we try to check the properties of an analysis server using SQL Server Management studio(right click the instance name
and check properties). We have resolved this issue twice by Stopping the SQL Server analysis service,removing db folders from Analysis Server Data folder and starting the services back on. The db folder that we removed was advised by the BI team.
The SQL Server Analysis Server is 2012 SP1Hi RB_ORIPW,
The table with name of 'XXX' doesn't exist.
An error occurred when loading the model(Micorsoft.AnalysisServices)
If I understanding correctly, you encounter the error randomly, now what you want it that avoid this issue completely, other than stop the services, detele the db filder and restart the services, right?
The error might be caused by that the data file is corrupted. However, we cannot give you the exact reason that cause this issue. You can troubleshoot this issue by using the Windows Event logs and msmdsrv.log.
You can access Windows Event logs via "Administrative Tools" --> "Event Viewer". SSAS error messages will appear in the application log.
The msmdsrv.log file for the SSAS instance that can be found in \log folder of the instance. (C:\Program Files\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Log)
Here is a blog about data collection for troubleshooting Analysis Services issues, please see:
Data collection for troubleshooting Analysis Services issues
Besides, here is fix that describe the similar issue, and it was fixed in Cumulative Update 7 for SQL Server 2012 SP1, please refer to the link below to see the details.
http://support.microsoft.com/kb/2897263/en-us
Regards,
Charlie Liao
If you have any feedback on our support, please click
here.
Charlie Liao
TechNet Community Support -
Join a Parent Table with 2 Child table based on a value
Dear Guru's
We have a Parent Table and 2 Child table . The Parent Table has a column like seqtype with only 2 possible values C and S . If the Value is C , then the details are available in Child 1 table and if the Value is S then the Details are in Child 2 table
How can we query the Data from this type of arrangement ? I am little bit confused and hit a road block
Will the following query will work ?
Select
from Parent P , Child C1, Child C2
where P.seqtype = C1.Seqtype
and P.seqtype = C2.Seqtype
With Warm Regards
ssrYou didn't mention the column names in two child tables. Whether the columns are same in 2 tables of these are different.
If the columns are same better to go and change your design to have only one child table. However if stiil business stops you having one table you can use UNION ALL (Assuming you want to fetch same column information from two child tables) like below:
SELECT p.col1
,c1.col2
,c1.col3
,c1.col4
FROM parent p
,child c1
WHERE p.seqtype = c1.seqtype
UNION ALL
SELECT p.col1
,c2.col2
,c2.col3
,c2.col4
FROM parent p
,child c2
WHERE p.seqtype = c2.seqtype Regards
Arun -
Issue using one 2 Fact tables with one dimension Table.
Hi,
I have 1 Dimension table X and 2 Fact tables A and B
X is joined to Both A and B for Loan Amount ( with A) and for colleatral amount (with B) when I am selecting the X.Product_Name, A.Loan_Amt, B.Collateral Amount, it is giving an error message
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 15018] Incorrectly defined logical table source (for fact table EIP Collateral FACT) does not contain mapping for [EIP Reporting FACT.PD ID]. (HY000)
Any clues???
Is there a Inner or Outer join which needs to be created or set in the RPD to get the desired results???Ok..
I have one table which is Porfolio Details which has Portfolio name, Product Category , Product Name, Product ID, Product sources code.- This is my Dimension table.
I have another 2 set of fact tables : EIP Reporting FACT and EIP Collateral FACT..
These two tables are joined to Portfolio Details table.
EIP Reprting FACT gives portfolio wise Loan Amount
and EIP Collateral FACT gives Portfolio wise Collateral Amount details for same set of customer..
Now, I am selecting Portfolio Name, Product Category, Product Name,SUM( EIP Reporting FACT.LOAN_AMOUNT), SUM(EIP Collaetral FACT.Collateral_Amt) in a report
Now, on selecting these columns I am getting that error message which is related to mapping.
If I take any column from Portfolio details table and any column from EIP Reporting FACT- It works.
If I take any column from Portfolio details table and any column from EIP Colletral FACT- It works.
But if I take any column from portfolio table and columns from both FACT tables it gives mapping error...
Hope I am able to explain the issue in a better way now..
Edited by: help-required on Mar 11, 2010 6:53 PM
Edited by: help-required on Mar 11, 2010 6:53 PM -
Adding a table in allowed reference tables in COPA
Hi SAPians,
I want to create a characteristics in COPA that is batch number. This batch number is stored in billing document item (table is VBRP and field name is CHARG). I want to have this field updated in COPA at the time of billing.
When I am going for the characteristics creation, I have two options: either create it on with reference to a SAP table or create it from scratch.
When I go for the first option, I don't have the table VBRP in the list of allowed reference tables. Instead of that, table VBAP is available that is for sales document (sales order). I cannot use this table because batch number is not known untill the step of billing. So I have to use the table VBRP that is for billing documents.
Can I somehow add a particular table in the allowed refernce tables list for characteristics creation in COPA.
ShiraziApple has removed over 90 features from Pages 5.
http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
Pages '09 should still be in your Applications/iWork folder.
Archive/trash Pages 5 and rate/review it in the App Store, then get back to work.
Peter -
Filling temporary table with two other tables.
Hi everyone,
In an start routine, I would like to do the following :
read values in an internal table, save it in temporary table tab1.
read values in an internal table (the same with a different request) and save it in temporary table tab2.
save with no duplicate keys and in a sorted table tab3 the result of the two tables.
I have coded like this, but it doesn't work, since the final table is empty.
Indeed, the system says it is tried to insert a duplicate key. How is it possible using instruction INSERT ?
DATA : t_agence_1 TYPE SORTED TABLE OF ty_agence
WITH UNIQUE KEY /BIC/C_AGENCE2
WITH HEADER LINE.
DATA : t_agence_2 TYPE SORTED TABLE OF ty_agence
WITH UNIQUE KEY /BIC/C_AGENCE2
WITH HEADER LINE.
DATA : t_agence TYPE SORTED TABLE OF ty_agence
WITH UNIQUE KEY /BIC/C_AGENCE2
WITH HEADER LINE.
SELECT * FROM /BIC/PC_AGENCE2
INTO CORRESPONDING FIELDS OF TABLE t_agence_1
FOR ALL ENTRIES IN DATA_PACKAGE
WHERE CALMONTH = DATA_PACKAGE-CALMONTH
AND /BIC/C_AGENCE2 = DATA_PACKAGE-/BIC/C_AG1
AND objvers = 'A'.
IF sy-subrc = 0.
INSERT LINES OF t_agence_1 INTO TABLE t_agence.
endif.
SELECT * FROM /BIC/PC_AGENCE2
INTO CORRESPONDING FIELDS OF TABLE t_agence_2
FOR ALL ENTRIES IN DATA_PACKAGE
WHERE CALMONTH = DATA_PACKAGE-CALMONTH
AND /BIC/C_AGENCE2 = DATA_PACKAGE-/BIC/C_AG2
AND objvers = 'A'.
IF sy-subrc = 0.
INSERT LINES OF t_agence_2 INTO TABLE t_agence.
endif.
Thanks if you can help !
regards
fred
Edited by: Christophe BELIN on Dec 5, 2008 3:43 PMShanon,
You would handle the parent with two child tables exactly the same way you would a parent with one child.
1) Bring in all 3 tables through the Database Expert.
2) On the Links Tab, place the parent table on the left of the window and the two child tables to the right (yes there is a reason for doing this).
3) Delete any CR generated links between the tables.
4) "Draw" a link that starts from the parent table to the 1st child table and then again, from the parent to the 2nd child.
a. I'm assuming that you know which fields to link on.
b. No links between children.
5) Once you have both links in place right click them and change the "Link Type" to "Left Outer Join"
a. The reason for doing this: It allows ALL of the parent records to come through, even if they do not have any matching records in
one or both of the child tables.
Hope this helps,
Jason -
Querying Nested Tables with Multiple other Tables
I am trying to query columns from a table and it's nested table and do a join to another table.
SELECT IM.*,
IMP.PROGRAM_ID,
S.STAGE_NAME
FROM TB_ITEM_MASTER IM , TABLE(TB_ITEM_MASTER.PROGRAMS) IMP, TB_STAGE S
WHERE S.STAGE_ID = IM.STAGE_ID
AND IM.PROGRAM_ID IN(1,2);
When running this query I receive the error:
ORA-00904:"TB_ITEM_MASTER"."PROGRAMS": Invalid Identifier
I actually copied this query straight from an Oracle Documentation, just replaced my table names with theirs. This query will almost be like a template to me as the program_id field in the Nested table is very cruicial to me. I will joining many tables to TB_ITEM_MASTER and using the where clause against program_id. What's the problem here?
Please advise.
ps. Did I mention how much I hate working with this Nested table stuff:(You must use the alias name, not the table name.
SQL> create type employee_obj as object (empno number) ;
2 /
Type created.
SQL> create type employees_nt is table of employee_obj ;
2 /
Type created.
SQL> create table departments (deptno number(2), dname varchar2(20), employees employees_nt)
2 nested table employees store as employees_table
3 /
Table created.
SQL> insert into departments values (1, 'DEPT #1', employees_nt(employee_obj(2), employee_obj(3))) ;
1 row created.
SQL> insert into departments values (22, 'DEPT #2', employees_nt(employee_obj(22), employee_obj(33))) ;
1 row created.
SQL>
SQL> SELECT IM.*,
2 IMP.empno
3 FROM departments IM , TABLE(IM.employees) IMP
4 WHERE IM.deptno IN(1,2);
DEPTNO DNAME
EMPLOYEES(EMPNO)
EMPNO
1 DEPT #1
EMPLOYEES_NT(EMPLOYEE_OBJ(2), EMPLOYEE_OBJ(3))
2
1 DEPT #1
EMPLOYEES_NT(EMPLOYEE_OBJ(2), EMPLOYEE_OBJ(3))
3
2 rows selected.
SQL> -
Is Object Table a true Reference Table?
Does Object table only contain reference of each row objects within the table?
Does the Object Table take up the same disk space as compare to relational table with the same number of rows?
Your help in the above two questions is very appreciated!
Fred.
nullVB.Net is object oriented in the same sense as C++ is. It provides objects but doesn't require them. Java goes further by requiring that all code must be in classes and Smalltalk goes all the way by treating primitive types as objects as well.
VB.Net is much more object oriented than VB6, which didn't have classes but did have components. All of VB, C# and Managed C++ run under the Common Language Runtime so share a lot of structure. -
Master table with two child tables in ADF Framework
Hi,
I'm trying to implement single master with two detail tables using oracle adf framework of Jdev 11.1.1.4.0. I'm able to do single master-detail by using view link but unable to achieve nested details block i.e., master with nested child blocks.
I created Query based view object of Master and two query based view objects as details. Then I created two view link for master with first child and another view link for master with second child. Even then in my data controls I see as two different components which is incorrect.
Please let me know how to create a data control for an example shown below:
Fruits [MASTER]
--- Details of Fruits as adf table
-- Apples [FIRST CHILD]
---- Details of Apples as adf table
-- Oranges [SECOND CHILD]
---- Details of Oranges as adf table
Regards,
Amar.You need two viewLinks
Fruits->Apples
Fruits->Oranges
Then in the data model you pick the Fruits entry that has:
Fruits
|--->Apples
You stand on Fruits and you shuttle the Oranges to be under it from the left.
If you'll use the default HR schema you'll see this type of relation for Employees:
https://blogs.oracle.com/shay/entry/master_with_two_details_on_the -
Dynamic table with field type table
Hi,
I´m using "cl_alv_table_create=>create_dynamic_table" to create a dynamic table for ALV Grid.
But...I need to use colors in ALV, then I need to declare a field type LVC_S_SCOL in dynamic table from "cl_alv_table_create=>create_dynamic_table".
How can I declare this in fieldcat?
The code:
Creating dynamic table
DATA: table_agrup TYPE REF TO data,
line_agrup TYPE REF TO data.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fieldcat
IMPORTING
ep_table = table_agrup
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
ASSIGN table_agrup->* TO .
Printing ALV
CALL METHOD obj_grid->set_table_for_first_display
EXPORTING
is_variant = w_variant
i_save = 'A'
is_layout = w_layout
CHANGING
it_outtab =
it_fieldcatalog = t_fieldcat
it_sort = t_sort
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
Thanks.It is not possible with the METHOD cl_alv_table_create=>create_dynamic_table to include another table inside that newly generated table.
I have tried to do it with the code and I got the dynamic table created after at the end of the program.
In the code,
<DYN_TABLE> has same effect as your <table> variable
<DYN_WA> has same effect as your <HEADER>
REPORT ZTEST_NP_DYNAMIC.
DATA: DY_TABLE TYPE REF TO DATA,
DY_LINE TYPE REF TO DATA.
FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,
<DYN_WA>,
<DYN_FIELD>.
FIELD-SYMBOLS: <FS> TYPE ANY.
* To generate the Dyanmic table with the COLOR
DATA: LS_SOURCE TYPE STRING.
DATA: LT_SOURCE LIKE STANDARD TABLE OF LS_SOURCE WITH HEADER LINE.
DATA: L_NAME LIKE SY-REPID.
DATA: L_MESSAGE(240) TYPE C,
L_LINE TYPE I,
L_WORD(72) TYPE C.
DATA: L_FORM(30) TYPE C VALUE 'TABLE_CREATE'.
LT_SOURCE = 'REPORT ZTEST_SUBROUTINE_POOL.'.
APPEND LT_SOURCE.
LT_SOURCE = 'FORM TABLE_CREATE USING I_FS TYPE ANY.'.
APPEND LT_SOURCE.
LT_SOURCE = 'DATA: BEGIN OF LT_GENTAB OCCURS 0.'.
APPEND LT_SOURCE.
LT_SOURCE = 'DATA: BUKRS TYPE BUKRS. '.
APPEND LT_SOURCE.
LT_SOURCE = 'DATA: BKTXT TYPE BKTXT. '.
APPEND LT_SOURCE.
* you can add your fields here.....
LT_SOURCE = 'DATA: COLOR TYPE lvc_t_scol. '.
APPEND LT_SOURCE.
LT_SOURCE = 'DATA: END OF LT_GENTAB.'.
APPEND LT_SOURCE.
LT_SOURCE = 'DATA: POINTER TYPE REF TO DATA.'.
APPEND LT_SOURCE.
LT_SOURCE = 'CREATE DATA POINTER LIKE STANDARD TABLE OF LT_GENTAB.'.
APPEND LT_SOURCE.
LT_SOURCE = 'I_FS = POINTER.'.
APPEND LT_SOURCE.
LT_SOURCE = 'ENDFORM. '.
APPEND LT_SOURCE.
L_NAME = 'ZTEST_SUBROUTINE_POOL'.
CATCH SYSTEM-EXCEPTIONS GENERATE_SUBPOOL_DIR_FULL = 9.
GENERATE SUBROUTINE POOL LT_SOURCE NAME L_NAME
MESSAGE L_MESSAGE LINE L_LINE WORD L_WORD. "#EC CI_GENERATE
ENDCATCH.
IF NOT L_MESSAGE IS INITIAL.
MESSAGE E000(0K) WITH L_MESSAGE L_LINE L_WORD.
ENDIF.
ASSIGN DY_TABLE TO <FS>.
PERFORM (L_FORM) IN PROGRAM (L_NAME) USING <FS>.
ASSIGN DY_TABLE->* TO <DYN_TABLE>.
* Create dynamic work area and assign to FS
CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
ASSIGN DY_LINE->* TO <DYN_WA>.
Write: 'bye'.
Regards,
Naimesh Patel -
Import table with a different table name!
Dear All,
I have backup all users in my database using exp command.
Now i want to import 2 tables from this backup, as tables already exists i want to import table with different table name.
Is it possible with exp command? If not what else is the solution.
Thanks, ImranHi..
Now i want to import 2 tables from this backup, as tables already exists i want to import table with different table name.Is it possible with exp command? If not what else is the solution.
>
Well, its not possible.You can import those two tables in some test database, rename them and then take the export and import in the database you want.
Or,
You can import those 2 tables in some other schema in your database, rename them again take the export and them import it.
Anand -
Using expdp to export a mix of tables with data and tables without data
Hi,
I would like to create a .dmp file using expdp, exporting a set of tables with data and another set without data. Is there a way to do this in a single .dmp file? For example, I want all the tables in a schema with data, but for the fact tables in that schema, I only want the fact table objects, not the data. I thought it might be easier to create two separate .dmp files, one for each scenario, but would be nice to have one .dmp file that satisfies my requirement. Any help is appreciated.
Thanks,
-Rodolfo
Edited by: user6902559 on May 11, 2010 12:05 PMYou could do this with where clauses. Let's say you have 10 tables to export, 5 with data and 5 without data. I would do it like this
tab1_w_data
tab2_w_data
tab3_w_data
tab4_w_data
tab5_w_data
tab1_wo_data
tab2_wo_data
tab3_wo_data
tab4_wo_data
tab5_wo_data
I would make one generic query
query="where rownum = 0"
and I would make 5 specific queries
query=tab1_w_data:"where rownum > 0"
query=tab2_w_data:"where rownum > 0"
query=tab3_w_data:"where rownum > 0"
query=tab4_w_data:"where rownum > 0"
query=tab5_w_data:"where rownum > 0"
The first query will be applied to all tables that don't have their own specific query and it will export no rows, the next 5 will apply to each of the corresponding table.
Dean -
How to modify DataBase Table with an internal Table
Hi, Friends.
I am coping Data from a Database table to an internal table after modifying data in the internal table I want to modify the db table according to the modification in the internal table. can some one help me out in this way, i am doing this modification in Table Control in Screen programing.
My Code is as follow.
MODULE zfsl_stinf_tc_init OUTPUT.
IF tc_copy IS INITIAL.
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_zfsl_stinf FROM zfsl_stinf.
tc_copy = 'X'.
REFRESH CONTROL 'TC_FOR_ZFSL_STINF' FROM SCREEN '0001'.
ENDIF.
ENDMODULE. " zfsl_stinf_init OUTPUT
*& Module zfsl_stinf_tc_move OUTPUT
text
MODULE zfsl_stinf_tc_move OUTPUT.
MOVE-CORRESPONDING wa_it_zfsl_stinf TO zfsl_stinf.
ENDMODULE. " zfsl_stinf_tc_move OUTPUT
*& Module STATUS_0001 OUTPUT
text
MODULE status_0001 OUTPUT.
SET PF-STATUS 'ZFSL_SCREEN_1ONLY'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0001 OUTPUT
*& Module zfsl_stinf_tc_modify INPUT
text
MODULE zfsl_stinf_tc_modify INPUT.
MOVE-CORRESPONDING zfsl_stinf TO wa_it_zfsl_stinf.
MODIFY it_zfsl_stinf FROM wa_it_zfsl_stinf INDEX tc_for_zfsl_stinf-current_line.
_*"" here i have the modified internal table " it_zfsl_stinf "*_
ENDMODULE. " zfsl_stinf_tc_modify INPUT
Kind regards,
FaisalHi
Here you are modifying your dbtable in module pool programming
so better to use work area to modify the database table
example:
data: itab type table of zfsl_stinf .
data: wa_itab type itab.
select single * from zfsl_stinf INTO itab WHERE <condition>
(pass your values to wa_itab.)
modify zfsl_stinf from values of wa_itab.
Regards
Srinivasu
Maybe you are looking for
-
I have owned my Macbook Pro since around the end of 2012, and I would like to reset it, as it has recently been slowing down, along with booting up and shutting down slowly, and opening any application takes around 1 minute. I would like to know how
-
Can we call a stored procedure from a Trigger
Hello Everyone, I need some help in writing the triggers in Oracle 10g Database. Can we call a stored procedure from a trigger?
-
Dears i want to learn oracle DBA i m already good in PL/SQL tell me from where i can get daily lesson. plz help me.
-
Hi all, Im actually a bit new with OSX so maybe there is a easy answer to this but i rather be careful then that my system crashes. I got a Macbook this christmas with the following specs: Macbook model 1,1 intel core duo 1.83 Ghz. 2GB RAM Systemvers
-
Item Remarks Field Text Synchronisation
I notice that the Remarks Text field , OITM.UserText in B1 is updated on synchronisation to the PartsNotes table. Each time it is changed in B1 it creates a new record in PartsNotes. Is this a remnant of functionality which used to exist in NetPoint.