How to use Inner Join for these 4 table's
Hi Guys,
My Requirement is i have to get the data into the final Internal table whose structure is like this (BWKEY type MBEW-BWKEY,
MATNR type MBEW-MATNR,
MAKTX type MAKT-MAKTX,
BWTTY type MBEW-BWTTY,
BWTAR type MBEW-BWTAR,
MEINS type MARA-MEINS,
BKLAS type MBEW-BKLAS,
VPRSV type MBEW-VPRSV,
STPRS type MBEW-STPRS,
PEINH type MBEW-PEINH,
CRCY(3) type c,
LBKUM type MBEW-LBKUM,
SALK3 type MBEW-SALK3,
LAEPR type MBEW-LAEPR,
J_3ADEFSI type MARC-J_3ADEFSI,
J_4kDEFSC type MARC-J_4kDEFSC,
SCLAS type MARA-/AFS/SCLAS,
EKALR type MBEW-EKALR,
HKMAT type MBEW-HKMAT,
HRKFT type MBEW-HRKFT,
KOSGR type MBEW-KOSGR,
PRCTR type MARC-PRCTR,
MMSTA type MARC-MMSTA,
SOBSK type MARC-SOBSK,
PPRDL type MBEW-PPRDL,
LPLPR type MBEW-LPLPR,
PPRDZ type MBEW-PPRDZ,
ZPLPR type MBEW-ZPLPR)
from 4 table's MBEW , MARA MAKT and MARC.
Can anybody provide the logci for this based on the below requirement
"Go to table MBEW with material number, plant and valuation type; fetch the information laid out in output format. There are some fields which need to come from tables MARC, MARA and MAKT. The common criterion is material number across these tables.
MBEW-MATNR = MARC-MATNR
MBEW-MATNR = MARA-MATNR
MBEW-MATNR = MAKT-MATNR
Thanks,
Gopi.
Hello Gopi,
I did not have system now and just written in notepad..
types : begin of ty_mbew ,
MATNR type MBEW-MATNR,
BWTTY type MBEW-BWTTY,
BWTAR type MBEW-BWTAR,
MEINS type MARA-MEINS,
BKLAS type MBEW-BKLAS,
VPRSV type MBEW-VPRSV,
STPRS type MBEW-STPRS,
PEINH type MBEW-PEINH,
CRCY(3) type c, " What is this field ,i did not include in join
LBKUM type MBEW-LBKUM,
SALK3 type MBEW-SALK3,
LAEPR type MBEW-LAEPR,
J_3ADEFSI type MARC-J_3ADEFSI,
J_4kDEFSC type MARC-J_4kDEFSC,
SCLAS type MARA-/AFS/SCLAS,
EKALR type MBEW-EKALR,
HKMAT type MBEW-HKMAT,
HRKFT type MBEW-HRKFT,
KOSGR type MBEW-KOSGR,
PRCTR type MARC-PRCTR,
MMSTA type MARC-MMSTA,
SOBSK type MARC-SOBSK,
PPRDL type MBEW-PPRDL,
LPLPR type MBEW-LPLPR,
PPRDZ type MBEW-PPRDZ,
ZPLPR type MBEW-ZPLPR,
end of ty_mbew.
types : begin of ty_makt ,
matnr type makt-maktx,
MAKTX type MAKT-MAKTX,
end of ty_makt.
types : begin of ty_final ,
MATNR type MBEW-MATNR,
MAKTX type MAKT-MAKTX,
BWTTY type MBEW-BWTTY,
BWTAR type MBEW-BWTAR,
MEINS type MARA-MEINS,
BKLAS type MBEW-BKLAS,
VPRSV type MBEW-VPRSV,
STPRS type MBEW-STPRS,
PEINH type MBEW-PEINH,
CRCY(3) type c,
LBKUM type MBEW-LBKUM,
SALK3 type MBEW-SALK3,
LAEPR type MBEW-LAEPR,
J_3ADEFSI type MARC-J_3ADEFSI,
J_4kDEFSC type MARC-J_4kDEFSC,
SCLAS type MARA-/AFS/SCLAS,
EKALR type MBEW-EKALR,
HKMAT type MBEW-HKMAT,
HRKFT type MBEW-HRKFT,
KOSGR type MBEW-KOSGR,
PRCTR type MARC-PRCTR,
MMSTA type MARC-MMSTA,
SOBSK type MARC-SOBSK,
PPRDL type MBEW-PPRDL,
LPLPR type MBEW-LPLPR,
PPRDZ type MBEW-PPRDZ,
ZPLPR type MBEW-ZPLPR,
end of ty_final.
Internal tables
data :i_mbew type standard table of ty_mbew,
i_makt type standard table of ty_makt,
i_final type standard table of ty_final.
Work Areas
data : wa_mbew like line of i_mbew,
wa_makt like line of i_makt,
wa_final like line of i_final.
start-of-selection.
get the data from MBEW,MARA,MARC Table
select aMATNR aBWTTY
aBWTAR bMEINS
aBKLAS aVPRSV
aSTPRS aPEINH
*CRCY(3) type c,
aLBKUM aSALK3 a~LAEPR
c~J_3ADEFSI type MARC-J_3ADEFSI,
c~J_4kDEFSC type MARC-J_4kDEFSC,
b~SCLAS type MARA-/AFS/SCLAS,
aEKALR aHKMAT
aHRKFT aKOSGR
cPRCTR cMMSTA
cSOBSK aPPRDL
aLPLPR aPPRDZ
a~ZPLPR into corresponding fields of table i_mbew
from mbew as a inner join mara as b on bmatnr = amatnr
inner join marc as c on cmatnr = amatnr.
if sy-subrc eq 0.
select matnr maktx from makt into table i_makt
for all entries in i_mbew
where matnr = i_mbew-matnr
and spras = sy-langu.
endif.
loop at i_mbew into wa_mbew.
read the data from MAKT Table
read table i_makt into wa_makt with key matnr = wa_mbew-matnr.
if sy-subrc eq 0.
move-corresponding wa_mbew to wa_final.
move wa_makt-maktx to wa_final-maktx.
append wa_final to i_final.
endif.
endloop.
Thanks
Seshu
Similar Messages
-
How to use inner joins for 4 0r 5 tables
Hai Experts,
plz check my code, n plz help to inner join all the tables
TYPES : BEGIN OF ITAB,
EBELN TYPE EKKO-EBELN, "P.O.NUMBER
AEDAT TYPE EKKO-AEDAT, "DATE
BPRME TYPE EKPO-BPRME, "UNIT PRICE
MENGE TYPE EKPO-MENGE, "Purchase order quantity
WERKS TYPE EKPO-WERKS, "PLANT
BRTWR TYPE EKPO-BRTWR, "Gross order value in PO
STRAS TYPE LFA1-STRAS, "House number and street
LIFNR TYPE LFA1-LIFNR, "VENDOR NO
NAME1 TYPE LFA1-NAME1, "V NAME
ORT01 TYPE LFA1-ORT01, "CITY
LAND1 TYPE LFA1-LAND1, "LAND
PSTLZ TYPE LFA1-PSTLZ, "POSTAL CODE
MAKTX TYPE MAKT-MAKTX, "DESCRIPTION
END OF ITAB.
<b>and i got stucked here:</b>
<u></u>
SELECT EKKO~EBELN
EKKO~AEDAT
EKPO~BPRME
EKPO~MENGE
EKPO~WERKS
EKPO~BRTWR
LFA1~LIFNR
LFA1~STRAS
LFA1~NAME1
LFA1~ORT01
LFA1~LAND1
LFA1~PSTLZ
MAKT~MAKTX
INTO TABLE ITAB
FROM EKKO
INNER JOIN EKPO LFA1 T001W MAKT
ON EKKOEBELN = EKPOEBELN
EKKO~EBELN
WHERE EKKO~EBELN IN S_EBELN.hi Rajesh,
you have to join the tables one by one:
SELECT ekko~ebeln
ekko~aedat
ekpo~bprme
ekpo~menge
ekpo~werks
ekpo~brtwr
lfa1~lifnr
lfa1~stras
lfa1~name1
lfa1~ort01
lfa1~land1
lfa1~pstlz
makt~maktx
INTO TABLE itab
FROM ekko AS ekko
INNER JOIN ekpo AS ekpo
ON ekkoebeln EQ ekpoebeln
INNER JOIN lfa1 AS lfa1
ON ekkolifnr EQ lfa1lifnr
INNER JOIN t001w AS t001w
ON ekpowerks EQ t001wwerks
INNER JOIN makt AS makt
ON ekpomatnr EQ MAKTmatnr
WHERE ekko~ebeln IN s_ebeln.
This is the complete SELECT. BUT! The performance will be much better if you take out T001W and MAKT from the INNER JOIN. Do select on these tables in separate steps and merge the internal tables afterwards.
hope this helps
ec -
How to use outer join on 3 tables
how to use outer join on 3 tables
say tables are mkpf,lips and vbrp
mkpf-xblnr = lips-vbeln
lips-vbeln = vbrp-vgbelrefer following querry
select a~bukrs
a~anln1
a~ord42
a~ord43
b~afabe
b~ndabj
b~kaafa
b~aafag
c~kostl
d~afasl
d~ndjar
d~ndper
into corresponding fields of table gt_master
from ( ( anla as a inner join anlc as b
on abukrs = bbukrs
and aanln1 = banln1
and aanln2 = banln2 )
inner join anlz as c
on abukrs = cbukrs
and aanln1 = canln1
and aanln2 = canln2 )
inner join anlb as d
on abukrs = dbukrs
and aanln1 = danln1
and aanln2 = danln2
where a~bukrs in s_comp. -
dear friends
kna1- kunnr ,name1
vbak - vbeln , erdat
vbap - meins , kwmeng
on above i have given three tables and their fields in front of this
can any one tel me how to give inner join in select statement for the above tablesHi Create an appropriate internal table ITAB
Select VBAK~VBELN
VBAK~ERDAT
VBAP~POSNR
VBAP~MEINS
VBAP~kwmeng
KNA1~KUNNR
KNA1~NAME1
From VBAK
Into Table ITAB
Inner Join VBAP On VBAKVBELN = VBAPVBELN
Inner Join KNA1 On VBAK~KUNNR = KNA1-KUNNR
Where VBAK~VBELN In S_VBELN.
Santhosh -
How to use INNER JOIN in such case
when i program as below[CASE1]. the code is able to active.
CASE1:
==========================
DATA: WK_BUKRS LIKE T001-BUKRS,
WK_BUTXT LIKE T001-BUTXT,
WK_TABLE(4) TYPE C VALUE 'T001'.
START-OF-SELECTION.
WK_BUKRS = 'DECN'.
PERFORM GET_BUTXT USING WK_BUKRS WK_TABLE
CHANGING WK_BUTXT.
WRITE: WK_BUTXT.
FORM GET_BUTXT USING I_BUKRS LIKE T001-BUKRS
I_TABLE
CHANGING O_BUTXT LIKE T001-BUTXT.
SELECT SINGLE BUTXT
INTO O_BUTXT
FROM (I_TABLE)
WHERE BUKRS = I_BUKRS.
ENDFORM.
===========================
but when I need to INNER JOIN another table [CASE2]
CASE2:
=======================
DATA: WK_BUKRS LIKE T001-BUKRS,
WK_BUTXT LIKE T001-BUTXT,
WK_TABLE(4) TYPE C VALUE 'T001'.
START-OF-SELECTION.
WK_BUKRS = 'DECN'.
PERFORM GET_BUTXT USING WK_BUKRS WK_TABLE
CHANGING WK_BUTXT.
WRITE: WK_BUTXT.
FORM GET_BUTXT USING I_BUKRS LIKE T001-BUKRS
I_TABLE
CHANGING O_BUTXT LIKE T001-BUTXT.
SELECT SINGLE BUTXT
INTO O_BUTXT
FROM (I_TABLE) AS G INNER JOIN BKPF AS H
ON GBUKRS = HBUKRS
WHERE G~BUKRS = I_BUKRS.
ENDFORM.
=================================
Syntax error:
Wrong expression "INNER" in FROM clause. WHERE condition.
Can anybody help me to solve the problem.
My requirement is to use INNER JOIN with variable tablehi slam,
chk this sample code.
hi,
table emp
empno name
a sasi
b xxx
c yyy
table sal
empno salary
a 1000
b 2000
Inner join
select eempno ename
s~sal
into table int_table
from emp as e
inner join sal as s
on
eempno = sempno.
if you made inner join between table a and b by emp no
the selection retrives only if the condition satisfy the output will be
a sasi 1000
b xxx 2000
rgds
anver
if hlped mark points
Message was edited by: Anversha s -
How to use remote directory for external table
Hi Folks,
I have 2 Oracle 11GR2 64 bit database installed on Win 2008 server as prod1 and prod2.
I have one directory created on prod1 server as EXT_TAB_DIR using the path as D:\OrsDWtest_dir .
I want to use this directory in Prod2 server and use external table using this remote directory.
I am able to access the Prod1 directory from Prod2 machine and also i have created Network map drive as Z drive pointing to that prod1 D:\OrsDWtest_dir directory. Also i checked read and Write permissions are there . I am able to create the external table but when i try to fetch the data i m getting below error ..
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file IOMM_20121213_060736.csv in EXT_TAB_DIR not found
now my doubt is this possible ? Can we use remote directory for External table ? or is there is there any alternative way to achieve same ?
Thanks & Regards,
Vikash Jain(DBA)could you confirm the name and the existence of this file "IOMM_20121213_060736.csv" ?
same error like:
http://www.oracle-base.com/articles/9i/external-tables-9i.php
if the load files have not been saved in the appropriate directory the following result will be displayed.
SQL> SELECT *
2 FROM countries_ext
3 ORDER BY country_name;
SELECT *
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file Countries1.txt in EXT_TABLES not found
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1Edited by: Fran on 10-ene-2013 23:32 -
How to use Inner join of table as Source in Merge statement in SQL
Hi All,
I am trying to make source as multiple tables output using Join while coding there is no any syntax error but when i am executing this statement is giving following error
Following is the query
Merge Into EmpDept Target
Using (select E.Address,e.Design,e.EmailId,e.EmpId,e.Ename,e.ManagerId, e.Salary,D.DeptId,D.DeptName,D.Location from Employee E Inner join Dept D on E.DeptId=D.DeptId )As Source (Address,Design,EmailId,EmpId,EName,ManagerId,Salary,DeptId,DeptName,Location)
On Source.EmpId=Target.EmpId
when not matched then
Insert (Target.Address,Target.Design,Target.EmailId,Target.EmpId,Target.Ename,Target.ManagerId, Target.Salary,Target.DeptId,Target.DeptName,Target.Location)
values
(Address,Design,EmailId,EmpId,EName,ManagerId, Salary,DeptId,DeptName,Location)
When matched then
Update set Target.Address = Source.Address ,Target.Design = Source.Design,Target.EmailId = Source.EmailId ,Target.Ename = Source.Ename ,Target.ManagerId = Source.ManagerId , Target.Salary = Source.Salary ,Target.DeptId = Source.DeptId ,Target.DeptName = Source.DeptName ,Target.Location = Source.Location;
This is error while executing the above merge statement
The insert column list used in the MERGE statement cannot contain multi-part identifiers. Use single part identifiers instead.
Please suggest me where i am wrong..
Niraj SevalkarMERGE INTO EmpDept Target
Using (SELECT E.Address,
e.Design,
e.EmailId,
e.EmpId,
e.Ename,
e.ManagerId,
e.Salary,
D.DeptId,
D.DeptName,
D.Location
FROM Employee E
INNER JOIN Dept D
ON E.DeptId = D.DeptId) AS Source (Address, Design, EmailId, EmpId, EName, ManagerId, Salary, DeptId, DeptName, Location)
ON Source.EmpId = Target.EmpId
WHEN NOT matched THEN
INSERT (Address,
Design,
EmailId,
EmpId,
Ename,
ManagerId,
Salary,
DeptId,
DeptName,
Location)
VALUES (Address,
Design,
EmailId,
EmpId,
EName,
ManagerId,
Salary,
DeptId,
DeptName,
Location)
WHEN matched THEN
UPDATE SET Address = Source.Address,
Design = Source.Design,
EmailId = Source.EmailId,
Ename = Source.Ename,
ManagerId = Source.ManagerId,
Salary = Source.Salary,
DeptId = Source.DeptId,
DeptName = Source.DeptName,
Location = Source.Location; -
How to use outer join in Target table
hi all:
how to use outer joing and trunc in target table?Good morning,
Can you be more specific?
What do you want to join, what needs to be truncated, what's the Loading Type of your target table-object, etc.
In general the following applies.
An outer join is specified on the JOIN operator, under Operator Properties you can specify the Join Condition, for example:
tab1.uk_col1 = tab2.uk_col1(+)
and
tab1.uk_col2 = tab2.uk_col2(+)Truncating a table in a mapping can only be done in combination with inserting the dataset, setting the loading type of a table to TRUNCATE/INSERT.
Apart from that there is a predefined OWB transformation called WB_TRUNCATE_TABLE, this can also be used to truncate a table.
Cheers, Patrick -
Problem when doing inner join for three tables....
DATA: V3 TYPE VBAP-MAKTL.
SELECT single vbap~matkl into V3
from VBAP
inner join VBFA
inner join LIPS
on LIPSPOSNR = VBFAPOSNN
and vbapvbeln = vbfavbelv
and vbapposnr = vbfaposnv
where LIPSVBELN = VBFAVBELN = '0080000834'
and vbfa~vbtyp_n = 'J'
and LIPS~J_3ASIZE = '0884'.
Error: Wrong expression "INNER" in from clause...Hello Tushar,
Why you are using the 3 table inner join. If the volume of data is big then this statement will give to time out. Use "for all entries" statement to select the data from the table.
Like
select field1 field2 from LIPS into i_lips
where LIPS~J_3ASIZE = '0884'.
select f3 f4 from vbfa into i_vbfa for all entries in i_lips where field1 = i_lips-field1 and so on
and
use same to select data from VBAP.
Hope this will help -
How to use the TableSorter for two tables at the same view?
Hello,
I am using the TableSorter object in order to sort Dynpro tables.
Suppose I have two tables at the same view, is it possible to use it seperatly for both of them?
I assume that at the wdModifyView method I will need to catch the table that the user clicked on, yet I don't have an idea of how to do it...Hi Roy,
Constructor of TableSorter
public TableSorter(IWDTable table, IWDAction sortAction, Comparator[] comparators)
So, you have to create instance of TableSorter class for each table on the view.
best regards, Maksim Rashchynski. -
How to use dynamic query for Result table
Hello Experts,
I want to use dynamic query and then display the result in the assignment block.
Using dynamic query BTQAct and BTQRAct and base on some search criteria i want tofilter and then append the result in the result table of that custom context node, and then it should display the result in the view in UI.
SO can you please provide me the samplle code on how to use the dynamic query and append in the result table.
Regards.Hi,
Please find below sample code:
data: query TYPE REF TO cl_crm_bol_dquery_service,
result TYPE REF TO if_bol_bo_col.
DATA: lt_params TYPE crmt_name_value_pair_tab,
lwa_params TYPE crmt_name_value_pair.
query = cl_crm_bol_dquery_service=>get_instance( 'BTQAct' ). " Get instance of dynamic query
Set general query parameter for maximum number of hits
lwa_params-name = 'MAX_HITS' .
lwa_params-value = '50'.
APPEND lwa_params TO lt_params.
query->set_query_parameters( it_parameters = lt_params ).
query->add_selection_param( iv_attr_name = 'OBJECT_ID'
iv_sign = 'I'
iv_option = 'EQ'
iv_low = <lv_objectid>
iv_high = '' ). " Set your search criteria. Repeat this code if you have multiple parameters
"You can find possible search options for a query object in GENIL_BOL_BROWSER
result ?= query->get_query_result( ). " Get result from your search query
me->typed_context-> <your result context node>->set_collection( result ).
Here you will have to create a context node in your view which would refer to query result object like for BTQAct its BTQRAct
Hope this helps.
e Regards,
Bhushan -
How to use change document for AUSP table in MM02?
Hi All,
I am working with MM02. When I change the characteristic value in classification view, I want that change to be logged in CDHDR table.
I have created a change document object for AUSP table and generated update program for that. Now that program needs to be called in some <b>badi</b> or <b>exit</b> which can be called upon saving in MM02 after changing the values in classification view.
Can anybody give me some idea where can I call that program.
Any help wud be appreciated.
Regards,
PragyaHi
You have 2 possible solutions to meet this requirement.
Option 1: Implement point # 3 of SAP OSS Note 943559
Option 2: This is a workaround solution to skip standard SAP check for activation of change documents of Classification system and allow entries to be written into CDHDR and CDPOS table through MM01 / MM02 / CL20N tcode
Solution: Implement an implicit enhancement inside include program 'LCLVFF10', at end of subroutine 'FILL_REDUN' i.e. line number '337'.
Here modify the entry of table 'REDUN' where OBTAB = 'MARA' and set the flag 'AEBLGZUORD' equal 'X'. This will activate the change document creation for Change Object 'CLASSIFY' in CDHDR and CDPOS tables.
Sample Code
LOOP AT redun WHERE obtab EQ 'MARA'.
redun-aeblgzuord = 'X'.
ENDLOOP. -
Hello All
i have these to tables
country: name,population
borders: country1,country2
every country have some neghbors, in borders table,
now i should calculate sum of pupulation of all neighbors of every country
thank u so much for ur help
I use oracle 11g
bestThis is the SQL to create the table
now i hope i will get an answer
-- File created - Tuesday-April-30-2013
-- DDL for Table BORDERS
CREATE TABLE "intern"."BORDERS" ("COUNTRY1" CHAR(2), "COUNTRY2" CHAR(2), "LENGTH" NUMBER)
COMMENT ON COLUMN "intern"."BORDERS"."COUNTRY1" IS 'a country code'
COMMENT ON COLUMN "intern"."BORDERS"."COUNTRY2" IS 'a country code'
COMMENT ON COLUMN "intern"."BORDERS"."LENGTH" IS 'length of the border between country1 and country2'
COMMENT ON TABLE "intern"."BORDERS" IS 'informations about neighboring countries'
REM INSERTING into intern.BORDERS
SET DEFINE OFF;
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ad','es',63);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('md','ua',939);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mk','yu',221);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ml','mr',2237);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ml','ne',821);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ml','sn',419);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mm','th',1800);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mn','ru',3543);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mr','sn',813);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mw','mz',1569);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mw','tz',475);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mw','zm',837);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mx','us',3141);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('my','th',506);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mz','sz',105);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mz','tz',756);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mz','za',491);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mz','zm',419);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('mz','zw',1231);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('na','za',967);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('na','zm',233);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ne','ng',1497);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ne','td',1175);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ng','td',87);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('no','ru',196);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('no','se',1619);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('om','sa',676);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('om','ye',288);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('pl','ru',206);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('pl','sk',444);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('pl','ua',526);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('qa','sa',60);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ro','ua',531);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ro','yu',476);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('ru','ua',1576);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('rw','tz',217);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('rw','ug',169);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sa','ye',1458);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sd','td',1360);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sd','ug',435);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sk','ua',97);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sy','tr',822);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('sz','za',430);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('tj','uz',1161);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('tm','uz',1621);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('tz','ug',396);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('tz','zm',338);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('za','zw',225);
Insert into intern.BORDERS (COUNTRY1,COUNTRY2,LENGTH) values ('zm','zw',797);
-- DDL for Index BORDERS_KEY
CREATE UNIQUE INDEX "intern"."BORDERS_KEY" ON "intern"."BORDERS" ("COUNTRY1", "COUNTRY2")
-- Constraints for Table BORDERS
ALTER TABLE "intern"."BORDERS" ADD CONSTRAINT "BORDERS_KEY" PRIMARY KEY ("COUNTRY1", "COUNTRY2") ENABLE
ALTER TABLE "intern"."BORDERS" ADD CONSTRAINT "BORDERS_LENGTH_CHECK" CHECK (
Length > 0
) ENABLE
-- File created - Tuesday-April-30-2013
-- DDL for Table COUNTRY
CREATE TABLE "intern"."COUNTRY" ("NAME" VARCHAR2(40), "CODE" CHAR(2), "CAPITAL" VARCHAR2(40), "PROVINCE" VARCHAR2(40), "POPULATION" NUMBER, "AREA" NUMBER)
COMMENT ON COLUMN "intern"."COUNTRY"."NAME" IS 'the country name'
COMMENT ON COLUMN "intern"."COUNTRY"."CODE" IS 'the internet country code (two letters)'
COMMENT ON COLUMN "intern"."COUNTRY"."CAPITAL" IS 'the name of the capital'
COMMENT ON COLUMN "intern"."COUNTRY"."PROVINCE" IS 'the province where the capital belongs to'
COMMENT ON COLUMN "intern"."COUNTRY"."POPULATION" IS 'the population number'
COMMENT ON COLUMN "intern"."COUNTRY"."AREA" IS 'the total area'
COMMENT ON TABLE "intern"."COUNTRY" IS 'the countries of the world with some data'
REM INSERTING into intern.COUNTRY
SET DEFINE OFF;
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Andorra','ad','Andorra la Vella','Andorra la Vella',69865,468);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('United Arab Emirates','ae','Abu Dhabi','Abu Dhabi',2523915,82880);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Afghanistan','af','Kabul','Kabul',28513677,647500);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Antigua and Barbuda','ag','Saint Johns','Saint John',68320,442.6);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Netherlands','nl','Amsterdam','Noord-Holland',16318199,41526);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Norway','no','Oslo','Akershus',4574560,324220);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Nepal','np','Kathmandu','Kathmandu',27070666,140800);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Nauru','nr',null,null,12809,21);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Niue','nu',null,null,2156,260);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('New Zealand','nz','Wellington','Wellington',3993817,268680);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Oman','om','Muscat','Muscat',2903165,212460);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Panama','pa','Panama','Panama',3000463,78200);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Peru','pe','Lima','Lima y Callao',27544305,1285220);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('French Polynesia','pf','Papeete','Iles du Vent',266339,4167);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Papua New Guinea','pg','Port Moresby','National Capital District',5420280,462840);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Philippines','ph','Manila','National Capital Region',86241697,300000);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Pakistan','pk','Islamabad','Federal Capital Area',159196336,803940);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Poland','pl','Warsaw','Mazowieckie',38626349,312685);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Saint Pierre and Miquelon','pm','Saint-Pierre','Saint-Pierre',6995,242);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Pitcairn Islands','pn',null,null,46,47);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Puerto Rico','pr','San Juan','San Juan',3897960,9104);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Palestine','ps','Ramallah','Gaza Strip',3762005,6220);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Portugal','pt','Lisbon','Lisboa e Vale do Tejo',10524145,92391);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Palau','pw','Koror','Koror',20016,458);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Paraguay','py','Asuncion','Asuncion',6191368,406750);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Qatar','qa','Doha','Doha',840290,11437);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Reunion','re','Saint-Denis','Saint-Denis',766153,2517);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Romania','ro','Bucharest','Bucharest',22355551,237500);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Russia','ru','Moscow','Moscow',143782338,17075200);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Rwanda','rw','Kigali','Ville de Kigali',7954013,26338);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Saudi Arabia','sa','Riyadh','Riyadh',25795938,1960582);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Solomon Islands','sb','Honiara','Guadalcanal',523617,28450);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Seychelles','sc',null,null,80832,455);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Sudan','sd','Khartoum','Khartoum',39148162,2505810);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Sweden','se','Stockholm','Stockholm',8986400,449964);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Singapore','sg',null,null,4353893,692.7);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Saint Helena','sh','Jamestown','Saint Helena',7415,410);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Slovenia','si','Ljubljana','Osrednjeslovenska',2011473,20273);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Svalbard','sj','Longyearbyen','Svalbard',2756,62049);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Slovakia','sk','Bratislava','Bratislavsky',5423567,48845);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Sierra Leone','sl','Freetown','Western',5883889,71740);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('San Marino','sm','San Marino','San Marino',28503,61.2);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Senegal','sn','Dakar','Dakar',10852147,196190);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Somalia','so','Mogadishu','Banadir',8304601,637657);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Suriname','sr','Paramaribo','Paramaribo',436935,163270);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Sao Tome and Principe','st','Sao Tome','Agua Grande',181565,1001);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('El Salvador','sv','San Salvador','San Salvador',6587541,21040);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Syria','sy','Damascus','Damascus',18016874,185180);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Swaziland','sz','Mbabane','Hhohho',1169241,17363);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Turks and Caicos Islands','tc',null,null,19956,430);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Chad','td','NDjamena','Chari-Baguirmi',9538544,1284000);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Togo','tg','Lome','Maritime',5556812,56785);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Thailand','th','Bangkok','Bangkok Metropolitan Area',64865523,514000);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tajikistan','tj','Dushanbe','Dushanbe',7011556,143100);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tokelau','tk',null,null,1405,10);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Turkmenistan','tm','Asgabat','Asgabat',4863169,488100);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tunisia','tn','Tunis','Tunis',9974722,163610);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tonga','to','Nukualofa','Tongatapu',110237,748);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('East Timor','tp','Dili','Dili',1019252,15007);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Turkey','tr','Ankara','Ankara',68893918,780580);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Trinidad and Tobago','tt','Port of Spain','Port of Spain',1096585,5128);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tuvalu','tv','Vaiaku','Funafuti',11468,26);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Taiwan','tw','Taipei','Taipei Hsien',22749838,35980);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Tanzania','tz','Dar es Salaam','Dar es Salaam',36588225,945087);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Ukraine','ua','Kiev','Kiev',47732079,603700);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Uganda','ug','Kampala','Central',26404543,236040);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('United Kingdom','uk','London','England',60270708,244820);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('United States','us','Washington','District of Columbia',293027571,9631418);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Uruguay','uy','Montevideo','Montevideo',3399237,176220);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Uzbekistan','uz','Tashkent','Tashkent',26410416,447400);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Holy See','va',null,null,921,0.44);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Saint Vincent and the Grenadines','vc','Kingstown','Saint George',117193,389);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Venezuela','ve','Caracas','Distrito Capital',25017387,912050);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('British Virgin Islands','vg','Road Town','Tortola',22187,153);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Virgin Islands','vi','Charlotte Amalie','Saint Thomas',108775,352);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Vietnam','vn','Ha Noi','Dong Bang Song Hong',82689518,329560);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Vanuatu','vu','Vila','Shefa',202609,12200);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Wallis and Futuna','wf','Matautu','Hahake',15880,274);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Samoa','ws','Apia','Apia Urban Area',177714,2944);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Yemen','ye','Sana','Amanah al-Asmah',20024867,527970);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Mayotte','yt','Mamoudzou','Mayotte',186026,374);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Serbia and Montenegro','yu','Belgrade','Central Serbia',10825900,102350);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('South Africa','za','Pretoria','Gauteng',42718530,1219912);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Zambia','zm','Lusaka','Lusaka',10462436,752614);
Insert into intern.COUNTRY (NAME,CODE,CAPITAL,PROVINCE,POPULATION,AREA) values ('Zimbabwe','zw','Harare','Harare',12671860,390580);
-- DDL for Index COUNTRY_KEY
CREATE UNIQUE INDEX "intern"."COUNTRY_KEY" ON "intern"."COUNTRY" ("CODE")
-- DDL for Index COUNTRY_NAME_UNIQUE
CREATE UNIQUE INDEX "intern"."COUNTRY_NAME_UNIQUE" ON "intern"."COUNTRY" ("NAME")
-- Constraints for Table COUNTRY
ALTER TABLE "intern"."COUNTRY" ADD CONSTRAINT "COUNTRY_AREA_CHECK" CHECK (
Area >= 0
) ENABLE
ALTER TABLE "intern"."COUNTRY" ADD CONSTRAINT "COUNTRY_KEY" PRIMARY KEY ("CODE") ENABLE
ALTER TABLE "intern"."COUNTRY" MODIFY ("NAME" CONSTRAINT "COUNTRY_NAME_NOTNULL" NOT NULL ENABLE)
ALTER TABLE "intern"."COUNTRY" ADD CONSTRAINT "COUNTRY_NAME_UNIQUE" UNIQUE ("NAME") ENABLE
ALTER TABLE "intern"."COUNTRY" ADD CONSTRAINT "COUNTRY_POPULATION_CHECK" CHECK (
Population >= 0
) ENABLE -
Hi,
Here is my requirement, i have 7 parameters in my report(Site,Account,LOB,year,Month,WeekDay and Date_Filter),
and in my report i have one table and one Chart,
my requirement is the table in the report has to show the data for 6 parameters only i.e(Site,Account,LOB,year,Month and WeekDay).so the table has to consider only 6 parameters, and it has ignore the 7th parameter, table should not consider Date_Filter parameter.
And Chart has to consider all 7 parameters.
so, when we preview the report table has to show the data for only 6 parameters and chart has to show the data for all 7 parameters.
if there is a way to get this Please reply me ASAP, it is an urgent requirement.
Thanks in Advance,
NaveenHi Naveen,
Refer below link to create multiple datasets as suggested by Gnanadurai
http://technet.microsoft.com/en-us/library/ff714047(v=sql.105).aspx
Thanks
Swapna -
How to use outer join on 2 tables with Oracle 8i
Could anyone tell me the Oracle 8i syntax equivalent to :
select user.name, city.adress, contry.name
from user
left outer join city on (user.rCity = city.code)
left outer join country on (user.rCountry = country.code)
I tried following :
select user.name, city.adress, contry.name
from user, city, contry
where user.rCity (+) = city.code
and user.rCountry (+) = country.code
but displayed following error :
ORA-01417: a table may be outer joined to at most one other table
Thank youLogically I would expect a user to have a city and a country, or not. In that case the outer join should be on the other tables. Making your query:
select user.name, city.adress, country.name
from user, city, country
where user.rCity = city.code (+)
and user.rCountry = country.code (+);
Maybe you are looking for
-
I'm trying to upload my book to ibooks. I'm in the itunes producer, latest version. I am at the rights & pricing page and both the publication type and the price tier are grayed out. When I get to the deliver page, it says I have errors, so I go back
-
Do i need norton or other security for my mac Thanks
do i need norton or other security for my mac
-
Anyone keep the original files stored outside of Aperture?
I upload all my RAW files to Aperture, and throw away the files on my desktop afterwards. I have heard a few stories on here of people's libraries getting corrupt, updates deleting projects etc. Does anyone keep their files on a different drive or lo
-
I have two WRT 610N hooked up to 2 Sony Blu Ray N460 players. Use the wireless for streaming, works most of the time but then out of nowhere while watching a movie the network connection will be dropped. It is the same on both units, sometimes they
-
Satellite C660-174 - Rattling covered by warranty?
I have a Toshiba Satellite C660-174 and it rattles in the top right hand corner near the CD drive as if something is loose. I am wondering if i should send the laptop back to be repaired under the warranty or if there is a way to solve the problem my