Regarding inner joins and calculations
Dear Experts,
I have a simple problem but i am a little confused. The problem is that i have 3 tables one is ekpo, ekes,ekbe
from ekpo i have to take matnr value and with respect to the matnr value i have to do this
Field discription is opening stock to get this value i have to do this
FOR ANY material sum of MENGE of EKES minus sum of MENGE of EKBE where VGABE=1
Where EKES. EBELN = EKBE. EBELN And EBELP
For input date range for EKBE BUDAT, EKES EINDT
could you help me out with this problem
Hi ,
Don't use inner join for 3 tables. Instead extract the data from 2 tables EKES and EKBE and store in a internal table. for EKPO store in another internal table. now you write the logic to calculate the desired result. By doing this way it will not cause any problems on performance.
Similar Messages
-
Difference between inner join and outer join
1.Difference between inner join and outer join
2.wht is the difference in using hide and get crusor value in interactive.
3. Using join is better or views in writting program . Which is better.Table 1 Table 2
A
B
C
D
D
E
F
G
H
a1
b1
c1
1
1
e1
f1
g1
h1
a2
b2
c2
1
3
e2
f2
g2
h2
a3
b3
c3
2
4
e3
f3
g3
h3
a4
b4
c4
3
|--|||--|
Inner Join
|--||||||||--|
| A | B | C | D | D | E | F | G | H |
|--||||||||--|
| a1 | b1 | c1 | 1 | 1 | e1 | f1 | g1 | h1 |
| a2 | b2 | c2 | 1 | 1 | e1 | f1 | g1 | h1 |
| a4 | b4 | c4 | 3 | 3 | e2 | f2 | g2 | h2 |
|--||||||||--|
Example
Output a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
DATA: DATE LIKE SFLIGHT-FLDATE,
CARRID LIKE SFLIGHT-CARRID,
CONNID LIKE SFLIGHT-CONNID.
SELECT FCARRID FCONNID F~FLDATE
INTO (CARRID, CONNID, DATE)
FROM SFLIGHT AS F INNER JOIN SPFLI AS P
ON FCARRID = PCARRID AND
FCONNID = PCONNID
WHERE P~CITYFROM = 'FRANKFURT'
AND P~CITYTO = 'NEW YORK'
AND F~FLDATE BETWEEN '20010910' AND '20010920'
AND FSEATSOCC < FSEATSMAX.
WRITE: / DATE, CARRID, CONNID.
ENDSELECT.
If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or a table alias.
Note
In order to determine the result of a SELECT command where the FROM clause contains a join, the database system first creates a temporary table containing the lines that meet the ON condition. The WHERE condition is then applied to the temporary table. It does not matter in an inner join whether the condition is in the ON or WHEREclause. The following example returns the same solution as the previous one.
Example
Output of a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
DATA: DATE LIKE SFLIGHT-FLDATE,
CARRID LIKE SFLIGHT-CARRID,
CONNID LIKE SFLIGHT-CONNID.
SELECT FCARRID FCONNID F~FLDATE
INTO (CARRID, CONNID, DATE)
FROM SFLIGHT AS F INNER JOIN SPFLI AS P
ON FCARRID = PCARRID
WHERE FCONNID = PCONNID
AND P~CITYFROM = 'FRANKFURT'
AND P~CITYTO = 'NEW YORK'
AND F~FLDATE BETWEEN '20010910' AND '20010920'
AND FSEATSOCC < FSEATSMAX.
WRITE: / DATE, CARRID, CONNID.
ENDSELECT.
Note
Since not all of the database systems supported by SAP use the standard syntax for ON conditions, the syntax has been restricted. It only allows those joins that produce the same results on all of the supported database systems:
Only a table or view may appear to the right of the JOIN operator, not another join expression.
Only AND is possible in the ON condition as a logical operator.
Each comparison in the ON condition must contain a field from the right-hand table.
If an outer join occurs in the FROM clause, all the ON conditions must contain at least one "real" JOIN condition (a condition that contains a field from tabref1 amd a field from tabref2.
Note
In some cases, '*' may be specified in the SELECT clause, and an internal table or work area is entered into the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the FROM clause, according to the structure of each table work area. There can then be gaps between table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, not simply by counting the total number of fields. For an example, see below:
Variant 3
... FROM tabref1 LEFT [OUTER] JOIN tabref2 ON cond
Effect
Selects the data from the transparent database tables and/or views specified in tabref1 and tabref2. tabref1 und tabref2 both have either the same form as in variant 1 or are themselves join expressions. The keyword OUTER can be omitted. The database tables or views specified in tabref1 and tabref2 must be recognized by the ABAP-Dictionary.
In order to determine the result of a SELECT command where the FROM clause contains a left outer join, the database system creates a temporary table containing the lines that meet the ON condition. The remaining fields from the left-hand table (tabref1) are then added to this table, and their corresponding fields from the right-hand table are filled with ZERO values. The system then applies the WHERE condition to the table.
Left outer join between table 1 and table 2 where column D in both tables set the join condition:
Table 1 Table 2
A
B
C
D
D
E
F
G
H
a1
b1
c1
1
1
e1
f1
g1
h1
a2
b2
c2
1
3
e2
f2
g2
h2
a3
b3
c3
2
4
e3
f3
g3
h3
a4
b4
c4
3
|--|||--|
Left Outer Join
|--||||||||--|
| A | B | C | D | D | E | F | G | H |
|--||||||||--|
| a1 | b1 | c1 | 1 | 1 | e1 | f1 | g1 | h1 |
| a2 | b2 | c2 | 1 | 1 | e1 | f1 | g1 | h1 |
| a3 | b3 | c3 | 2 |NULL|NULL|NULL|NULL|NULL|
| a4 | b4 | c4 | 3 | 3 | e2 | f2 | g2 | h2 |
|--||||||||--|
Regards
Prabhu -
Are inner join and equijoin are same....?
are inner join and equijoin are same....?
WhiteHat wrote:
interesting it says that - an equi join is a type of inner join but you can't really say they are the same thing.Simply said it it like this:
Equi join means compare two tables where a value is in each table using an equal sign.
An inner join means: We use the INNER JOIN keyword and have a join condition between the two tables.
example1
select *
from emp
inner join dept on emp.dept_no = dept.dept_no;This example is an inner join and also an equi join.
example2
select *
from emp
inner join dept on emp.dept_no >= dept.dept_no;This example is an inner join which is NOT an equi join.
How to interpret the outcome is a different story (in this case it doesn't make much sense). However the syntax is correct and it is an inner join. But since it doesn't use the equal operator it is an non-equi join. -
hi friends,
how to use inner join and outer join methods in abap. pls explainyou have to code them
Seriously, I suggest you take an ABAP class, it's out of the scope of this forum to tech you how to program joins.
Markus -
Urgent: Regarding Inner join relation b/w MSEG, MKPF, MARA and MAKT
I have written o code like below for inner join. However, The program has take much more time to give out put. Could any one please correct the below inner join statement. Its very urgent.
Thanks for your help.
SELECT mseg~mblnr
mseg~matnr
mseg~werks
mseg~charg
mseg~lifnr
mseg~bualt
mseg~erfmg
mseg~ebeln
mseg~ebelp
mkpf~budat
mara~zzshelf_life
makt~maktx
FROM mseg
INNER JOIN mkpf
ON mkpfmblnr EQ msegmblnr
INNER JOIN mara
ON msegmatnr EQ maramatnr
INNER JOIN makt
ON maramatnr EQ maktmatnr
INTO TABLE gt_mat_doc
WHERE mseg~matnr IN s_matnr
AND mseg~werks IN s_werks
AND mseg~lifnr IN s_lifnr
AND mseg~bwart EQ p_bwart
AND ( msegebeln NE ' ' AND msegebeln IN s_ebeln )
AND mkpf~budat IN s_budat
AND mara~mtart IN s_mtart
AND makt~spras EQ sy-langu.Hi,
Do like this
Types: begin of ty_mesg_mkpf,
mblnr type mseg-mblnr,
matnr type mseg-matnr,
werks type mseg-werks,
charg type mseg-charg,
lifnr type mseg-lifnr,
bualt type mseg-bualt,
erfmg type mseg-erfmg,
ebeln type mseg-ebeln,
ebelp type mseg-ebelp,
budat type mkpf-budat,
end of ty_mseg_mkpf,
Begin og ty_mara_makt,
matnr type mara-matnr,
zzshelf_life type mara-zzshelf_life,
maktx type makt-maktx,
end of ty_mara_makt.
Data: it_mseg_mkpf type table of ty_mseg_mkpf,
wa_mseg_mkpf type ty_mseg_mkpf,
it_mara_makt type table of ty_mara_makt,
wa_mara_makt type ty_mara_makt.
SELECT m1~mblnr
m1~matnr
m1~werks
m1~charg
m1~lifnr
m1~bualt
m1~erfmg
m1~ebeln
m1~ebelp
m2~budat
FROM mseg
INTO TABLE it_mseg_mkpf
INNER JOIN mkpf
ON m1mblnr EQ m2mblnr
WHERE m1~matnr IN s_matnr
AND m1~werks IN s_werks
AND m1~lifnr IN s_lifnr
AND m1~bwart EQ p_bwart
AND ( m1ebeln NE ' ' AND m1ebeln IN s_ebeln )
AND m2~budat IN s_budat
if sy-subrc = 0.
Select m3~matnr
m3~zzshelf_life
m4~maktx from mara as m3
INNER JOIN makt as m4
ON m3matnr EQ m4matnr
INTO TABLE it_mara_makt
where m3~mtart IN s_mtart
AND m4~spras EQ sy-langu.
endif.
loop at it_mseg_mkpf into wa_mseg_mkpf.
Move necessary field values from wa_mseg_mkpf to wa_mat_doc.
Read table it_mara_makt into wa_mara_makt with key matnr = wa_mseg_mkpf-matnr.
if sy-subrc = 0.
move remaining field values to wa_mat_doc.
append wa_mat_doc to gt_mat_doc.
clear wa_mat_doc.
endif.
endloop.
Regards,
Satish -
Hi Friends,
My code is;
SELECT T1~NUMBER SUM( T2~QUANT )
INTO (ZTABLE1-NUMBER, ZTABLE2-QUANT)
FROM ZTABLE1 AS T1
INNER JOIN ZTABLE2 AS T2
ON T1~NUMBER = T2~NUMBER
GROUP BY T2~VBELN.
ENDSELECT.
I am getting an error as;
The field T1~NUMBER from SELECT is missing in the GROUP BY clause. addition INTO wa or INTO(g1,...,gn) is required. fields of type "" or "T2-VBELN".
I couldn't understand anything from the error message. Can you help what the error message says and how can I do my desire on above query.
Thanks.Usually GROUP BY Is used to get only aggregated fields.
It is not meant for regular selection of fields.
Instead do a regular selection of all the fields without group by and do your aggregation in program logic as per your requirement.
In that way your performance will be better.
Regards
Sudhir Atluru -
Hi Guriji,s
I wrote one inner join query. it is working fine. but when i exceute this query it is fetching the data only 261 movement type but but i also fetch the data movement type 201. for this plz tell me the correction in this query.
select amatnr awerks abwart bbudat into table t_itab from mseg as a inner join mkpf as b
on amblnr = bmblnr
where awerks in plant and abwart = '261' or a~bwart = '201'
and btcode2 = 'mb1a' or btcode2 = 'mfbf' .
thanks.Hi Sachin
try to use like below
select amatnr awerks abwart bbudat into table t_itab from mseg as a inner join mkpf as b
on amblnr = bmblnr
where awerks in plant and ( abwart = '261' or a~bwart = '201' )
and ( btcode2 = 'mb1a' or btcode2 = 'mfbf' ).
or try to fill ranges like select-options or use like
select amatnr awerks abwart bbudat into table t_itab from mseg as a inner join mkpf as b
on amblnr = bmblnr
where awerks in plant and abwart in ('261', '201')
and btcode2 = 'mb1a' or btcode2 = 'mfbf' .
Regards
Praveen -
Inner join and select for all entries with respect to performance
Hi Friends,
I just want to know which is more efficient with respect to performance the Inner join or select for all entries?which is more efficient? and how? can you explain me in detail ?
Regards,
DineshINNER JOIN->
The data that can be selected with a view depends primarily on whether the view implements an inner join or an outer join. With an inner join, you only get the records of the cross-product for which there is an entry in all tables used in the view. With an outer join, records are also selected for which there is no entry in some of the tables used in the view.
http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ec77446011d189700000e8322d00/content.htm
FOR ALL ENTRIES->
Outer join can be created using this addition to the where clause in a select statement. It speeds up the performance tremendously, but the cons of using this variation are listed below
Duplicates are automatically removed from the resulting data set. Hence care should be taken that the unique key of the detail line items should be given in the select statement.
If the table on which the For All Entries IN clause is based is empty, all rows are selected into the destination table. Hence it is advisable to check before-hand that the first table is not empty.
If the table on which the For All Entries IN clause is based is very large, the performance will go down instead of improving. Hence attempt should be made to keep the table size to a moderate level.
Not Recommended
Loop at int_cntry.
Select single * from zfligh into int_fligh
where cntry = int_cntry-cntry.
Append int_fligh.
Endloop.
Recommended
Select * from zfligh appending table int_fligh
For all entries in int_cntry
Where cntry = int_cntry-cntry. -
Inner join and select for all entries with respect to performance in SAP
Hi Friends,
I just want to know which is more efficient with respect to performance the Inner join or select for all entries?which is more efficient?
Regards,
DineshI did some testing a while ago and found that a JOIN is usually a bit more efficient than FOR ALL ENTRIES. This wasn't always the case though, so the best thing to do is to write it both ways and see which is faster.
Rob -
The process time between INNER JOIN and join in WHERE clause
as u know, there are 2 kind of join
SELECT *
FROM tableA
INNER JOIN tableB
ON tableA.ID= tableB.ID
WHERE ....
and
SELECT *
FROM tableA, tableA
WHERE tableA.ID = tableB.ID
AND ....
I find the first one is faster in MS SQL Server.
But i test them in oracle and i find that it is the same. Is it correct?Who knows why SQL Server shows different timings. Perhaps it's just cos it's not good at knowing that the two things are the same.
The only difference in timing as far as Oracle is concerned is the time it takes to parse the syntax of the query, which will be nanoseconds. The execution time of two equivalent queries will not differ based on the factor of the syntax used. -
Need help with inner join and distinct rows
Hey Guys,
i have
1) BaseEnv Table
2) Link Table
3) BaseData Table
Link table has three columns Id,BaseEnvId,BaseDataId
the BaseEnvID is unique in the table where as BaseDataId can be repeated i.e multile rows of BaseEnv Table can point to same BaseData table row
Now i want to do BaseEnvTable inner join Link Table inner join BaseData Table and select 5 columsn ; Name,SyncName,Version,PPO,DOM from the BaseData table.. the problem is that after i do the inner join I get duplciate records..
i want to eliminate the duplicate records , can any one help me herePlease post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect.
This is minimal polite behavior on SQL forums. Now we have to guess and type, guess and type, etc. because of your bad manners.
CREATE TABLE Base_Env
(base_env_id CHAR(10) NOT NULL PRIMARY KEY,
Think about the name Base_Data; do you have lots of tables without data? Silly, unh?
CREATE TABLE Base_Data
(base_data_id CHAR(10) NOT NULL PRIMARY KEY,
Your Links table is wrong in concept and implementation. The term “link” refers to a pointer chain structure used in network databases and makes no sense in RDBMS. There is no generic, magic, universal “id” in RDBMS! People that do this are called “id-iots”
in SQL slang.
We can model a particular relationship in a table by referencing the keys in other tables. But we need to know if the relationship is 1:1, 1:m, or n:m. This is the membership of the relationship. Your narrative implies this:
CREATE TABLE Links
(base_env_id CHAR(10) NOT NULL UNIQUE
REFERENCES Base_Env (base_env_id),
base_data_id CHAR(10) NOT NULL
REFERENCES Base_Data (base_data_id));
>> The base_env_id is unique in the table where as base_data_id can be repeated I.e multiple rows of Base_Env Table can point [sic] to same Base_Data table row. <<
Again, RDBMS has no pointers! We have referenced an referencing tables. This is a fundamental concept.
That narrative you posted has no ON clauses! And the narrative is also wrong. There is no generic “name”, etc. What tables were used in your non-query? Replace the ?? in this skeleton:
SELECT ??.something_name, ??.sync_name, ??.something_version,
??.ppo, ??.dom
FROM Base_Env AS E, Links AS L, Base_Data AS D
WHERE ?????????;
>> I want to eliminate the duplicate records [sic], can any one help me here?<<
Where is the sample data? Where is the results? Please read a book on RDBMS so you can post correct SQL and try again.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Syntax errors in update query with inner joins and sub query.
Below is the query:
UPDATE sp_CFQ_Coord_Corrections
INNER JOIN (CFQ_Coord_Corrections
INNER JOIN CFQ_Referrals ON CFQ_Coord_Corrections.CorrID = CFQ_Referrals.RecID)
ON sp_CFQ_Coord_Corrections.ID = CFQ_Referrals.RecID
SET CFQ_Coord_Corrections.MatchFound = 1,
CFQ_Coord_Corrections.RecTblID = [CFQ_Referrals].[RecTblID],
sp_CFQ_Coord_Corrections.MatchFound = 1
WHERE (((CFQ_Coord_Corrections.MatchFound)=0)
AND ((sp_CFQ_Coord_Corrections.MatchFound)=0)
AND ((CFQ_Coord_Corrections.RecImported)=1)
AND ((CFQ_Referrals.RecFileName)='COORDCORR_SPOINT')
AND ((CFQ_Referrals.RecCombKey)='No.Match')
AND ((sp_CFQ_Coord_Corrections.RecImported)=1));
Error messages seen when executed:
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'INNER'.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near 'CFQ_Coord_Corrections'.
Please help.....Below is the query:
UPDATE sp_CFQ_Coord_Corrections
INNER JOIN (CFQ_Coord_Corrections
INNER JOIN CFQ_Referrals ON CFQ_Coord_Corrections.CorrID = CFQ_Referrals.RecID)
ON sp_CFQ_Coord_Corrections.ID = CFQ_Referrals.RecID
SET CFQ_Coord_Corrections.MatchFound = 1,
CFQ_Coord_Corrections.RecTblID = [CFQ_Referrals].[RecTblID],
sp_CFQ_Coord_Corrections.MatchFound = 1
WHERE (((CFQ_Coord_Corrections.MatchFound)=0)
AND ((sp_CFQ_Coord_Corrections.MatchFound)=0)
AND ((CFQ_Coord_Corrections.RecImported)=1)
AND ((CFQ_Referrals.RecFileName)='COORDCORR_SPOINT')
AND ((CFQ_Referrals.RecCombKey)='No.Match')
AND ((sp_CFQ_Coord_Corrections.RecImported)=1));
Error messages seen when executed:
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'INNER'.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near 'CFQ_Coord_Corrections'.
Please help.....
sp_CFQ_Coord_Corrections is a table and not a stored procedure.
are these both tables "sp_CFQ_Coord_Corrections" and "CFQ_Coord_Corrections" different ?? -
Any differences between inner join and join without any keyword(inner join)
Are there any differences between following two join statements?
Join Statement 1:
select column1, column2 from table1 t1, table2 t2 where t1.t1Key=t2.t2Key;
Join Statement 2:
select column1, column2 from table1 t1 inner join table2 t2 on t1.t1Key = t2.t2Key;
Thanks for your reply.
KevinHi, Kevin,
user13531850 wrote:
Are there any differences between following two join statements?To the system, those two are equivalent. They will produce exactly the same results, and will probably result in the same execution plan, so they will be equally efficient.
Some people find it easier to read and understand one rather than the other. Personally, I find the ANSI syntax (JOIN ... ON ...) easier to understand. The join conditions that apply to each table are listed right next to the table; you don't have to hunt through a long WHERE clause to find them. Also, it makes debugging easier. If you forget the join condition, then you get a syntax error, pinpointing where you forgot the join condition. Using the old syntax, if you forget a join condition, you get a cross-join, and it may not be obvious that any error occurred, but even if you do notice the mistake, you have no clue where it happened.
Join Statement 1:
select column1, column2 from table1 t1, table2 t2 where t1.t1Key=t2.t2Key;This is the old join syntax. It works in all versions of Oracle (so far).
Join Statement 2:
select column1, column2 from table1 t1 inner join table2 t2 on t1.t1Key = t2.t2Key;This is the ANSI join syntax. It works in Oracle 9.1 and higher. The keyword INNER is optional. -
Help with query - inner join and case
Hi this is the query I am having troble with, where is the correct place to add the case condition:
SELECT
FROM
END_USER_ORDERS EO
INNER JOIN ORDER_PRODUCTS OP
ON EO.EUO_ID = OP.EUO_ID
INNER JOIN PRODUCTS P
ON OP.PRD_ID = P.PRD_ID
CASE P.PRD_ID -- PROBLEM IS HERE
WHEN 'Online' Then 'Public'
END
INNER JOIN PRODUCT_VERSIONS PV
ON P.PRD_ID = PV.PRD_ID
AND PV.SIT_ID = 'DEFAULT'
AND PV.LOC_ID = 'UK'
LEFT OUTER JOIN ORDER_SESSIONS OS
ON OP.EUO_ID = OS.EUO_ID
AND OP.ORP_SEQ_NO = OS.ORP_SEQ_NO
LEFT OUTER JOIN SESSIONS S
ON OS.SES_ID = S.SES_ID
LEFT OUTER JOIN SUBJECTS SU
ON S.SUB_ID = SU.SUB_ID
WHERE EO.EUO_ID = 'bef8cd51-b398-4521-9350-f3a7c3885c59'
select * from END_USER_ORDERS
order by EUO_DATE desc
Many thankshmmm....one more point here, when you change your query use as below:
SELECT
Col1,Col2.... -- specify your columns
,CASE P.PRD_TYPE
WHEN 'Online' Then 'Public'
else P.PRD_TYPE -- to display others as original value
END AS [PRODUCT TYPE]
FROM
END_USER_ORDERS EO -
Inner Join and "PIVOT" results
Good day all;
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
"CORE 10.2.0.4.0 Production"
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
I have 2 tables that I would like to do a query on and then "pivot" the results. I understand that since this is 10g that the use of PIVOT is not supported.
(Corrected code issues :))
create table CT
DESIGN_ID NUMBER,
CT_ID VARCHAR2(15)
INSERT INTO CT VALUES ('654321','10QWER123456');
INSERT INTO CT VALUES ('987654','7ASDF654987');
INSERT INTO CT VALUES ('321654','82CHEV852963');
create table CXRF
DESIGN_ID NUMBER,
ROW_SEQ_NBR NUMBER,
XREF_CT_ID VARCHAR2(15)
INSERT INTO CXRF VALUES ('654321','1','25ABCD');
INSERT INTO CXRF VALUES ('654321','2','262ABCD');
INSERT INTO CXRF VALUES ('987654','1','14WXYZ');
INSERT INTO CXRF VALUES ('987654','2','34FRED');
INSERT INTO CXRF VALUES ('321654','1','1TOM');- Oops measure twice cut once..
select design_id,
ct_id,
xref_ct_id
from cxrf
INNER JOIN
ct
on(ct.design_id = cxrf.design_id) Desired results would look like this:
DESIGN_ID CT_ID XREF_CT_1 XREF_CT_2
654321 10QWER123456 25ABCD 262ABCDEdited by: GMoney on May 9, 2013 8:47 AM
Edited by: GMoney on May 9, 2013 8:49 AMPlease provide WORKING sql:
SQL> create table CT
2 (
3 DESIGN_ID NUMBER not null,
4 CT_ID VARCHAR2(2)
5 );
Table created.
SQL> INSERT INTO CT VALUES ('654321'','10QWER123456');
ERROR:
ORA-01756: quoted string not properly terminated
SQL> INSERT INTO CT VALUES ('987654','7ASDF654987');
INSERT INTO CT VALUES ('987654','7ASDF654987')
ERROR at line 1:
ORA-12899: value too large for column "SCOTT"."CT"."CT_ID" (actual: 11, maximum: 2)
SQL> INSERT INTO CT VALUES ('321654','82CHEV852963');
INSERT INTO CT VALUES ('321654','82CHEV852963')
ERROR at line 1:
ORA-12899: value too large for column "SCOTT"."CT"."CT_ID" (actual: 12, maximum: 2)
SQL>
SQL> create table CXRF
2 (
3 DESIGN_ID NUMBER
4 ROW_SEQ_NBR NUMBER
5 XREF_CT_ID VARCHAR2(12)
6 );
ROW_SEQ_NBR NUMBER
ERROR at line 4:
ORA-00907: missing right parenthesis
SQL> INSERT INTO CXRF VALUES ('654321','1','25ABCD');
INSERT INTO CXRF VALUES ('654321','1','25ABCD')
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> INSERT INTO CXRF VALUES ('654321','2','262ABCD');
INSERT INTO CXRF VALUES ('654321','2','262ABCD')
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> INSERT INTO CXRF VALUES ('987654','1','14WXYZ');
INSERT INTO CXRF VALUES ('987654','1','14WXYZ')
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> INSERT INTO CXRF VALUES ('987654','2','34FRED');
INSERT INTO CXRF VALUES ('987654','2','34FRED')
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> INSERT INTO CXRF VALUES ('321654','1','1TOM');
INSERT INTO CXRF VALUES ('321654','1','1TOM')
ERROR at line 1:
ORA-00942: table or view does not exist:p
Maybe you are looking for
-
How to design report like below
I Want to make report like this * I have Query Q1 (vendor_id, vendor_site_id, invoice_id, ....) * base on criteria on Q1 for example : vendor_site_code = vendor merchandise I want the output on Q2 (select field A, B,C) ==> I already design on Q_M bas
-
Acrobat 8.0 update 8.1.5 has bugs. How do I fix it?
Yesterday I installed (again) update 8.1.5 for my Acrobat Professional. After a successful installation, two things happen when i turn on the computer or try to run Acrobat. 1) When turning on the computer, I receive a message saying (in Portuguese,
-
How to send pdf or excel attachment as saved alv layout in email
Hi Guru, I am developing a report in which, i am sending report as excel attachment after clicking a button on top of alv grid, and pdf attachment after clicking another button on top of alv grid. I am sending mail by two ways they are: 1) I am popul
-
Dear All, Now my requirement is to extend materials from one plant to another plant.So i used BAPI_MATERIAL_SAVEDATA which is working fine.But if I open the material in tcode MM02 then material master extension is not happening. even if the
-
I bought adobe premiere 6.5 full box version some years back and never once opened it, will it now work with a 64bit OS, Window 7 Laptop?