ORA-00918: column ambiguously defined : while using inner Select
Hi
could you please help me to solve the following from.
I have a query like this
SELECT * FROM (SELECT ZMV.VENDOR_NAME,FR.PO_NUM,ZMV.PART_NUMBER,FR.ZAC_ITEM_DESCRIPTION,ZMV.QUANTITY_ORDERED,FR.QUANTITY_RECEIVED,ZMV.PO_UOM_CODE,FR.VENDOR_INV,FR.FORWARDER_REF,FR.PCS,TY.DESCRIPTION,FR.GROSS_WGT,FR.NET_WGT,FR.CFT,TR.DESCRIPTION,FR.PRO,FR.FORWARDER_REMARK,FR.RECAP_ID,FR.ZAC_REMARK,FR.SHIPMENT_BY FROM FWD_RECAP FR,ZAC_METRO_VIEW ZMV,FWD_MASTER_TYPE TY,FWD_MASTER_TRUCK TR WHERE FR.TYPE_ID=TY.TYPE_ID AND FR.TRUCK_ID=TR.TRUCK_ID AND FR.PO_LINE_ID=ZMV.PO_LINE_ID AND FR.PACKAGE_ID=0 AND FR.OPERATIONING_UINT_ID=511 AND FR.FORWARDER='METRO,ITALY' ORDER BY FR.PO_LINE_ID DESC) WHERE ROWNUM <=10
But while executing the following error showing,
SELECT * FROM (SELECT ZMV.VENDOR_NAME,FR.PO_NUM,ZMV.PART_NUMBER,FR.ZAC_ITEM_DESCRIPTION,ZMV.QUANTIT
ERROR at line 1:
ORA-00918: column ambiguously defined
For this problem i got some answers from web sites, they saying as follows, but i am using like that only.
(ORA-00918: COLUMN AMBIGUOUSLY DEFINED)
Use table aliases and prefix all column names by their aliases when more than one table is involved in a query. This reduces parse time AND prevents future syntax errors if someone adds a column to one of the tables with the same name as a column in another table.
awaiting your immediate reply
Thankyou
Jobin [[email protected]]
In your inline view you have fields
TY.DESCRIPTION and TR.DESCRIPTION which are the same
name DESCRIPTION for covered SQL.
place TY.DESCRIPTION TY_DESCRIPTION and
TR.DESCRIPTION TR_DESCRIPTION in your code:
SELECT * FROM (SELECT ZMV.VENDOR_NAME,FR.PO_NUM,ZMV.PART_NUMBER,FR.ZAC_ITEM_DESCRIPTION,ZMV.QUANTITY_ORDERED,FR.QUANTITY_RECEIVED,ZMV.PO_UOM_CODE,FR.VENDOR_INV,FR.FORWARDER_REF,FR.PCS,TY.DESCRIPTION TY_DESCRIPTION ,FR.GROSS_WGT,FR.NET_WGT,FR.CFT,TR.DESCRIPTION TR_DESCRIPTION,FR.PRO,FR.FORWARDER_REMARK,FR.RECAP_ID,FR.ZAC_REMARK,FR.SHIPMENT_BY FROM FWD_RECAP FR,ZAC_METRO_VIEW ZMV,FWD_MASTER_TYPE TY,FWD_MASTER_TRUCK TR WHERE FR.TYPE_ID=TY.TYPE_ID AND FR.TRUCK_ID=TR.TRUCK_ID AND FR.PO_LINE_ID=ZMV.PO_LINE_ID AND FR.PACKAGE_ID=0 AND FR.OPERATIONING_UINT_ID=511 AND FR.FORWARDER='METRO,ITALY' ORDER BY FR.PO_LINE_ID DESC) WHERE ROWNUM <=10
Rgds
Similar Messages
-
How to get rid of ROWID in Join query -- ORA-00918: column ambiguously defined
Hi, All
the source of my data block is from two tables Emp and Title. My select statements is:
select a.name, b.title, b.start_date, b.end_date from Emp a, Title b where a.id = b.emp_id
But at run time, I got "ORA-00918: column ambiguously defined"
the wrapped statement becomes:
SELECT ROWID,a.name, b.title, b.start_date, b.end_date from Emp a, Title b where a.id = b.emp_id
I run the query in SQL*PLUS, found out it was ROWID caused problem.
Can anybody tell me how to get rid of ROWID? or I missed something in datablock defination?
Thanks in adance.
DeborahI guess you are using oracle 7.x. In Oracle 8 and onwards, database lets you select ROWID from the views based on multiple views as long as view definition does not contain any aggregated functions or DISTINCT in it. Now coming back to forms ..Forms runtime engine uses ROWID to identify rows uniquely unless specified otherwise. If you are using forms 4.5/5.0 against Oracle 7.x , then change these properties and you should be able to run the form.
BLOCK PROPERTY
Key Mode : can be either updateable OR Non-updateable
( Certainly not 'Unique' .. That forces forms runtime engine to use ROWID to identify unique rows. )
ITEM PROPERTY
Identify one of the block items as unique. And then set the following property
Primary Key : True.
This should take care of rowid problem.
Regards,
Murali.
Hi, All
the source of my data block is from two tables Emp and Title. My select statements is:
select a.name, b.title, b.start_date, b.end_date from Emp a, Title b where a.id = b.emp_id
But at run time, I got "ORA-00918: column ambiguously defined"
the wrapped statement becomes:
SELECT ROWID,a.name, b.title, b.start_date, b.end_date from Emp a, Title b where a.id = b.emp_id
I run the query in SQL*PLUS, found out it was ROWID caused problem.
Can anybody tell me how to get rid of ROWID? or I missed something in datablock defination?
Thanks in adance.
Deborah -
Eclipselink producing incorrect sql - ORA-00918: column ambiguously defined
We have a table with many columns .A1 .A2 .A3.... .A125 .N1 .N2 .N3... .N95 and with a simple jpql join it comes up with 2 columns that are ...AS N1150 and causing an ambiguous column error ...
Does any one know of a valid workround or if this is a known bug. No problems were present in toplink, just eclipselink....
it appears to be doing a count and suffixing the count to the column name to make sure the columns have unique id's - but failing:
K1 -> K1 _1_
N41 -> N41 _2_
N11 -> N11 _50_
... then 100 columns later
N1 -> N1 _150_
the jpql is :
@NamedQuery(name=NamedQueryNames.XREF_IMPORT_SELECT,
query="SELECT t FROM Tran t, Xref x "+
" WHERE t.key = x.a1 "+
" AND x.key.k1 = :partial "+
" AND x.key.k2 LIKE :partialX " +
" ORDER BY x.key.k2")
Tran has fields k1,k2, a1, a2...a125, n1, n2...n95
xref has k1,k2,a1,a2..a5, n1,n2,n3
the sql eclipse link produces for the query is :
SELECT *
FROM
(SELECT
/*+ FIRSTROWS */
a.*,
ROWNUM rnum
FROM
(SELECT t1.K1 AS K11,
t1.N41 AS N412,
t1.N40 AS N403,
t1.N45 AS N454,
t1.N44 AS N445,
t1.A120 AS A1206,
t1.N43 AS N437,
t1.A121 AS A1218,
t1.N42 AS N429,
etc
t1.N25 AS N2547,
t1.N10 AS N1048,
t1.N12 AS N1249,
t1.N11 AS N1150,
t1.N17 AS N1751,
a load more columns
t1.A65 AS A65147,
t1.A68 AS A68148,
t1.A67 AS A67149,
t1.N1 AS N1150,
t1.A41 AS A41151,
t1.N5 AS N5152,
etc
FROM COREXFA t0,
CORETRA t1
WHERE (((t1.K1 = t0.A1)
AND (t0.K1 = ?))
AND (t0.K2 LIKE ?))
ORDER BY t0.K2 ASC
) a
WHERE ROWNUM <= ?
WHERE rnum > ?This issue is cause by the aliasing done because you are using firstResult/maxResult. I think there is already a bug logged for this issue, please vote for the bug.
See,
http://old.nabble.com/Duplicate-aliases-generated-for-columns-%281.1.3%29-td28039552.html
Some workarounds would be,
- avoid using firstResult/maxResult
- rename the columns
- use native SQL
- use a cursor query instead of firstResult/maxResult
James : http://www.eclipselink.org -
Strange behaviuor (bug?) with view (ora-918 column ambiguously defined)
Hallo everybody,
the following code works as expected;
select substr(fire_id,-4,2) as ct,zone_id, count(fire_id),sum(a_total) from
(select *
from fire right join fire_zone using (fire_id)
where definition_id = 1
and checked = 1
and substr(fire_id,-4,2) in (21,23)
and fire_id between 190400000000 and 200900000000)
group by substr(fire_id,-4,2),zone_id
order by ct, zone_id
but when a define a view for the subquery:
create or replace view tempfire as
select *
from fire right join fire_zone using (fire_id)
where definition_id = 1
and checked = 1
and substr(fire_id,-4,2) in (21,23)
and fire_id between 190400000000 and 200900000000
and then run
select substr(fire_id,-4,2) as ct,zone_id, count(fire_id),sum(a_total) from tempfire
group by substr(fire_id,-4,2),zone_id
order by ct, zone_id
I got the error ora-00918 column ambiguously defined for zone_id.
Is this a bug or is there a reason?
Thank you in advance,
Cheers,
Boris
Edited by: boris on Nov 19, 2009 6:49 AM
Edited by: boris on Nov 19, 2009 6:52 AMuser503699
I followed your suggestion and now it works. Thank you !
But something is strange ... this is the result of the desc tempfire ... and all the column names are different ...
desc tempfire
Name Null Type
FIRE_ID NOT NULL NUMBER(12)
START_DATE DATE
END_DATE DATE
LOCALITY VARCHAR2(56)
X_COORD NUMBER(6)
Y_COORD NUMBER(6)
COORD_RELIABILITY_ID NUMBER(1)
ALTITUDE NUMBER(4)
SITE_ID NUMBER(1)
EXPO_ID NUMBER(1)
SLOPE NUMBER(3)
X_BUSH NUMBER(1)
X_COPPICE NUMBER(1)
X_COPPICE_MIXED NUMBER(1)
X_SELVA NUMBER(1)
X_HIGH_FOREST_HARDWOOD NUMBER(1)
X_HIGH_FOREST_SOFTWOOD NUMBER(1)
X_HIGH_FOREST_MIXED NUMBER(1)
X_PIONEER NUMBER(1)
X_FORESTATION NUMBER(1)
S_BUSH NUMBER(8,2)
S_COPPICE NUMBER(8,2)
S_COPPICE_MIXED NUMBER(8,2)
S_SELVA NUMBER(8,2)
S_HIGH_FOREST_HARDWOOD NUMBER(8,2)
S_HIGH_FOREST_SOFTWOOD NUMBER(8,2)
S_HIGH_FOREST_MIXED NUMBER(8,2)
S_PIONEER NUMBER(8,2)
S_FORESTATION NUMBER(8,2)
A_FOREST NUMBER(8,2)
A_GRASSLAND NUMBER(8,2)
A_NONPRODUCTIVE NUMBER(8,2)
A_TOTAL NUMBER(8,2)
D_CASTANEA NUMBER(1)
D_QUERCUS NUMBER(1)
D_FAGUS NUMBER(1)
D_BETULA NUMBER(1)
D_OTHER_HARDWOOD NUMBER(1)
D_PINUS NUMBER(1)
D_PICEA NUMBER(1)
D_LARIX NUMBER(1)
D_OTHER_SOFTWOOD NUMBER(1)
DIAMETER NUMBER(3)
LITTER_ID NUMBER(1)
HERB_LAYER_ID NUMBER(1)
BUSH_LAYER_ID NUMBER(1)
FIRE_SURFACE NUMBER(1)
FIRE_CROWN NUMBER(1)
FIRE_SINGLE_TREE NUMBER(1)
FIRE_SUBSURFACE NUMBER(1)
DAMAGE_FOREST_ID NUMBER(1)
DAMAGE_SOIL_ID NUMBER(1)
HEIGHT_DAMAGE NUMBER(4,2)
F_PROTECTION NUMBER(1)
F_ECONOMIC NUMBER(1)
F_RECREATION NUMBER(1)
CAUSE_ID NUMBER(2)
OTHER_CAUSE VARCHAR2(200)
CAUSE_RELIABILITY_ID NUMBER(1)
ALARM_FORESTDEP DATE
CHECKED NUMBER(1)
DATA_FROM_FORESTDEP NUMBER(1)
DATA_FROM_FIREMANDEP NUMBER(1)
DATA_FROM_HISTORY NUMBER(1)
INSERT_DATE DATE
INSERT_BY VARCHAR2(16)
UPDATE_DATE DATE
UPDATE_BY VARCHAR2(16)
OLD_TI_AFFDFO VARCHAR2(1)
OLD_TI_S_SPES NUMBER(8,2)
OLD_TI_PICFOR VARCHAR2(1)
OLD_TI_FIRE_TYPE VARCHAR2(1)
OLD_TI_DOMINANT_SPECIES VARCHAR2(1)
OLD_TI_CAUSE VARCHAR2(2)
OLD_TI_FOREST_TYPE VARCHAR2(1)
START_DATE_RELIABILITY_ID NUMBER(1)
END_DATE_RELIABILITY_ID NUMBER(1)
DEFINITION_ID NUMBER(1)
ZONE_ID NOT NULL NUMBER(8)
79 rows selected
I'm still interested hoe to use hints. Can anybody tell me?
Thank you
Boris -
'column ambiguously defined' due to automatic addition of rowid to every JDBC calls
We are using Weblogic 6.0 spf 1 and Oracle as back end.
When ever we fire an SQL using JDBC, Weblogic automatically adds 'rowid' to the
select clause and fires the SQL. If Oralce returns the error 'ORA-00918: column
ambiguously defined', the rowid is removed and the SQL is run as requested.
For example, when we say -
SELECT *
FROM SOME_TABLE
Rowid is added blindly and executed query will be
SELECT rowid, *
FROM SOME_TABLE
Oracle throws 'Column Ambigiously defined'. Upon this error weblogic fires originally
requested query
SELECT *
FROM SOME_TABLE
Another condition where it always fails is in case of SQL joins.
Is there any way to avoid adding rowid to the SQL statments?
Thanks
SatishI would appreciate an answer to this same question: "Can the automatic addition of rowid after the select be prevented"? as it is causing several index hints to be rejected.
-
Hi,
Our oracle version has been upgraded from 10g to 11g.
After upgrade we face serious problem in compiling several packages, procedures and views and that throws an error "Column Ambiguously Defined", which was running perfectly in 10g version.
I have come through several blogs like, this problem occurs for many ppl as part of upgrade from 10g to 11g and the only solution is to change the code.
But in our case we have many numbers of objects like procedures, packages and views where this error occurs, do we have any common solution for overcome this problem (without changing the code)?
Regards,
Ananthe7a47215-0e59-4d88-a082-7ad5e83ce5b0 wrote:
Hi,
Our oracle version has been upgraded from 10g to 11g.
After upgrade we face serious problem in compiling several packages, procedures and views and that throws an error "Column Ambiguously Defined", which was running perfectly in 10g version.
I have come through several blogs like, this problem occurs for many ppl as part of upgrade from 10g to 11g and the only solution is to change the code.
But in our case we have many numbers of objects like procedures, packages and views where this error occurs, do we have any common solution for overcome this problem (without changing the code)?
Regards,
Ananth
You will need to bite the bullet & change the code -
select distinct hp.SYER_PEMBILANG||'/'||hp.SYER_PEMBILANG semua, kp.NAMA kod_pihak_nama,
kb.nama kod_bpm_nama,
kd.NAMA kod_daerah_nama,
kl.NAMA kod_lot_nama,
mo.ID_MOHON ,
ha.NO_LOT,
ha.KOD_HAKMILIK,
ha.NO_HAKMILIK
kd.NAMA kod_daerah_nama
from
mohon mo,
mohon_pihak mp join kod_pihak kp on (mp.kod_pihak=kp.kod),
hakmilik ha join kod_bpm kb on(ha.kod_bpm=kb.kod)
join kod_daerah kd on(ha.kod_daerah=kd.kod)
join kod_lot kl on (ha.KOD_LOT=kl.kod),
mohon mo join kod_caw kc on(mo.kod_caw=kc.kod),
kod_caw kc join kod_daerah kd on(kc.kod_daerah=kd.kod),
mohon_hakmilik mh,
hakmilik_pihak hp
where
mp.KOD_PIHAK ='PG'
and mo.KOD_CAW=kc.KOD
and kc.KOD_DAERAH=kd.kod
and mo.id_mohon=:p_id_mohon
and ha.KOD_BPM=kb.KOD
and ha.KOD_DAERAH=kd.KOD
and ha.KOD_LOT=kl.KOD
and mo.ID_MOHON=mh.ID_MOHON
and mh.id_hakmilik=ha.ID_HAKMILIK
and mo.ID_MOHON=mp.ID_MOHON
and mp.KOD_PIHAK=kp.KOD
and hp.ID_HAKMILIK=ha.ID_HAKMILIKcolumn ambiguously defined
Edited by: user9093689 on Nov 8, 2010 12:55 AMIs nobody going for the "new" syntax?
I belive this makes the relationship between tables so much more visible (and a LEFT to mohon would be not possible with "old" JOIN.
SELECT
DISTINCT hp.SYER_PEMBILANG||'/'||hp.SYER_PEMBILANG semua, kp.NAMA kod_pihak_nama,
kb.nama kod_bpm_nama,
kd.nama kod_daerah_nama,
kl.nama kod_lot_nama,
mo.id_mohon ,
ha.no_lot,
ha.kod_hakmilik,
ha.no_hakmilik
kd.nama kod_daerah_nama
FROM mohon_pihak mp
INNER JOIN kod_pihak kp
ON (mp.kod_pihak=kp.kod)
INNER JOIN kod_bpm kb
ON(ha.kod_bpm=kb.kod)
INNER JOIN kod_lot kl
ON (ha.KOD_LOT=kl.kod)
-- twice INNER join kod_daerah kd
INNER JOIN hakmilik ha
on ( ha.KOD_BPM=kb.KOD
AND ha.kod_daerah=kd.kod
AND ha.KOD_DAERAH=kd.KOD
AND ha.KOD_LOT=kl.KOD)
-- twice INNER JOIN mohon mo
INNER join kod_caw kc
ON(mo.kod_caw=kc.kod)
-- twice INNER JOIN kod_caw kc
INNER join kod_daerah kd
ON(kc.kod_daerah=kd.kod)
INNER JOIN mohon_hakmilik mh
ON (mh.id_hakmilik=ha.id_hakmilik)
INNER JOIN hakmilik_pihak hp
ON hp.id_hakmilik=ha.id_hakmilik
INNER JOIN mohon mo
ON ( mo.ID_MOHON= mh.ID_MOHON
AND mo.KOD_CAW = kc.KOD
AND mo.ID_MOHON=mp.ID_MOHON)
WHERE
mp.KOD_PIHAK ='PG'
AND mo.id_mohon=:p_id_mohon
;--andy -
ORA-00600: internal error code while using packages
ORA-00600: internal error code, arguments: [kkxpityp1], [ ] , [ ] , [ ] , [ ] , [ ] , [ ]
I am trying to use a select * from table(IBLCOMAN04.shortage.getIblTbl) where
IBLCOMAN04: is the schema name
shortage: is the package name
getIblTbl is a table function.
The resultset obtained from select * from table(IBLCOMAN04.shortage.getIblTbl) is used to print a report.
we are using a pipeline function in getIblTbl to generate this report. but it is failing with the following error.
Any workaround or solutions to this???Hi,
Please try looking into this link, it has some information on the error you are getting.
ORA-00600
Thanks -
Runtime Error while using Dynamic Selection
Hi,
We are getting a runtime error while using a dynamic selection. One of the fields has got an apostrophe in the middle of the text and so the condition is returning an error SAPSQL_WHERE_PARANTHESES.
Let's say the value in the field is SCV's. So the WHERETAB is filled as 'SCV's' or `SCV's`. An exception is caught in this case as there is no closing apostrophe.
Let us know if anyone has come across a similar issue and any help is appreciated.
Regards,
SarvesHi Sarves,
as Rob said.
check also the [ORACLE FAQS|http://www.orafaq.com/faq/how_does_one_escape_special_characters_when_writing_sql_queries] or [SQL SERVER u2013 How to Escape Single Quotes|http://blog.sqlauthority.com/2008/02/17/sql-server-how-to-escape-single-quotes-fix-error-105-unclosed-quotation-mark-after-the-character-string/]
Honestly: Before posting here and getting a whole lot of more or less useless comments just use your favorite search engine.
Regards,
Clemens -
Java.sql.SQLException: Invalid column index Query: while using ROWNUM
hi ,
i am getting the invalid column index query error while executing following query .i m able to run it properly without using rownum but when i append rownum i m getting error.i m using apache queryrunner for execution of query.
java.sql.SQLException: Invalid column index Query: select * from (
SELECT
TO_CHAR(A.REQ_FOR_RATING_ID) RFQID,
TO_CHAR(F.COV_PLAN_ID) COVPLANID,
B.FIRM_NAME FIRMNAME,
B.PRIMARY_ZIP_CD ZIP,
A.PRODUCR_CD PRODUCERCD,
A.PRODUCR_NAME PRODUCER,
H.COV_NAME COVDESP,
C.SALE_OFFC_CD SALEOFFCCD,
C.USR_OFFC_NAME USROFFC,
C.USR_NAME USR,
C.USR_REP_CD USRREPCD,
to_char((SELECT TO_CHAR(COUNT(EMP_NBR)) COUNT FROM ROSTR_DATA WHERE ROSTR_ID = F.ROSTR_ID)) AS count,
TO_CHAR(B.SIC_CD) SICCD,
F.INDSTRY_TYPE_IND INDTYPEIND,
TO_CHAR(F.MANL_SIC_FCTR_NBR) MANSICFACTOR,
TO_CHAR(F.UW_OVERD_SIC_FCTR_NBR) UWOVERDSICFACTOR,
TO_CHAR(G.AREA_FCTR_NBR) STRAREAFACTOR,
G.COV_ID COVID,
F.PLAN_APPRVL_STATUS_CD PLANAPPRVLCD,
F.PLAN_PROGRS_STATUS_CD PLANPROGRESSSTATUSCD ,
F.PLAN_SALE_ASSMNT_CD PLANSALEASSMTCD,
F.CREATD_DT CREATEDDT,
NVL(to_char(F.PLAN_RELSED_DT),' ') PLANRELSEDDT,
TO_CHAR(F.PLAN_RELSED_BY_ID) PLANRELSEDBYID,
TO_CHAR(F.PROPOSD_EFF_DT) PROPOSDEFFECTIVEDT,
TO_CHAR(A.GRACE_PERIOD_NBR) GRACEPERIOD,
A.RNWL_15_MONTH_IND FIFTEENMONTHRNWLIND ,
I.CO_DESC_TXT COMPANYNAME ,
NVL(to_char(F.PLAN_APPRVL_DT),' ') approvedDt,
(Select U.USR_NAME from USR_DETL U WHERE U.USR_ID = F.PLAN_RELSED_BY_ID) as planRelsedByName,
(Select U.USR_NAME from USR_DETL U WHERE U.USR_ID = F.PLAN_APPRVR_ID) as approvedByName,
'' createdByName,
ROWNUM rnum
FROM
REQ_FOR_RATING A,
FIRM B,
USR_DETL C,
SALE_OFFICE D,
QUOTE_SCENRIO E,
QUOTE_COV G,
COV_PLAN F,
COV_LKUP H,
CO_LKUP I
WHERE
A.FIRM_ID = B.FIRM_ID AND
A.SALE_REP_ID = C.USR_ID AND
C.SALE_OFFC_CD = D.SALE_OFFC_CD AND
A.REQ_FOR_RATING_ID=E.REQ_FOR_RATING_ID AND
E.QUOTE_SCENRIO_ID=G.QUOTE_SCENRIO_ID AND
G.QUOTE_COV_ID=F.QUOTE_COV_ID AND
G.COV_ID=H.COV_ID AND
I.CO_CD = F.CO_CD AND
TO_CHAR(F.CREATD_DT,'YYYYMMDD') > TO_CHAR(TO_DATE('07/16/2007', 'MM/DD/YYYY HH24:MI:SS'),'YYYYMMDD') AND
TO_CHAR(F.CREATD_DT,'YYYYMMDD') < TO_CHAR(TO_DATE('10/16/2007', 'MM/DD/YYYY HH24:MI:SS'),'YYYYMMDD')
and rownum <=?) where rnum >=? Parameters: [07/15/2007 00:00:00, 10/15/2007 23:59:59, 1117, 1]That's a SQL fault, not a JDBC/Java fault.
-
Relationship between tables while using inner joins.
Hi,
I had a few clarifications on "inner joins", and as i was going through the forum, i came across two points,
1. In one of the threads it said " inner joins is applicable for tables that have a parent child relationship.
2. In another thread it said " inner join is established from master table (the table on the left) to the transcation table (the table on the right)".
I have two clarifications based on the above points.
1. Is it necessary that the tables on which im performing an inner join should have a parent-child/children relationship or is it enough that the tables just have a common field.
2. Also is it necessary that the master table should come first, (or can i use any child table from where i can fetch the records when there is a mater table in my report) as shown below.
Eg: select * <fields> from <master table> inner join <table> on <field> into <itab>.
Edited by: Narayananchandran on Dec 27, 2010 12:31 PMhave two clarifications based on the above points.
1. Is it necessary that the tables on which im performing an inner join should have a parent-child/children relationship or is it enough that the tables just have a common field.
2. Also is it necessary that the master table should come first, (or can i use any child table from where i can fetch the records when there is a mater table in my report) as shown below.
Eg: select * <fields> from <master table> inner join <table> on <field> into <itab>
1) NO
2) NO -
ORA-00600: internal error code while using UpdateXML to update xml content
Hi,
I have been using the UpdateXML command to replace content of xml stored in XMLType. It was working absolutely fine.
Below is the query:
UPDATE temp d SET d.message_content = updateXML(d.message_content,'//*[.="Test" ]/text()','"Test123"') WHERE existsNode(d.message_content,'//*[.="Test"]')=1";
But now i'm getting an exception as follows:
ORA-00600: internal error code, arguments: [qmcxeUpdateXml:2.1], [], [], [], [], [], [], []
The table uses a Free Test Index.
I searched the forum and found from the given link https://forums.oracle.com/forums/thread.jspa?threadID=2352772 that corrupted Index may be the cause of this problem. I'm still clueless :(
Can someone help me?Hi sprightee,
That thread you found seems to be a different problem (Ora-600 argument is different)
I think you have hit bug 6811908, at least if Odie is correct about your version.
Bug says No workaround - Fixed in 11.1.0.8
Regards
Peter -
ORA-01017 from SQL Developer while using SYS account
Hi,
We are seeing "ora-1017:invalid username/password" when trying to connect using sys user as SYSDBA Role in SQL Developer. The same account works fine in SQL*plus. The remote_login_password param is set to EXCLUSIVE and the file orapw$SID is also there.
Any inputs to resolve this error is appreciated.
Thanks
SathyaAs sqlplus seems to be working for you and sqldeveloper has its own forum, please post this in the sqldeveloper forum.
Sybrand Bakker
Senior Oracle DBA -
ORA-02063: preceding line error while using dblink
CREATE OR REPLACE PROCEDURE TEST AS
BEGIN
DECLARE
v_circle VARCHAR(10);
CURSOR c1 IS SELECT file_number,SUBSTR(file_name,INSTR(file_name,'.',1,2)+1,LENGTH(file_name)) AS ftm_id FROM TABLE1 WHERE trim(a.start_TIME) = trim(SYSDATE-1);
BEGIN
FOR r1 IN c1 LOOP
BEGIN
dbms_output.put_line(r1.file_number);
SELECT CIRCLE INTO v_circle FROM METHODLOG@ictprd_to_amdica a,METHODINFO_INTEC_DASHBORD@ictprd_to_amdica b
WHERE a.METHOD=b.method_name AND FTMID=r1.ftm_id;
UPDATE TABLE1 SET CIRCLE=v_circle WHERE FILE_number=r1.file_number;
COMMIT;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END;
END LOOP;
END;
END;When posting code, use the \ tag at the start and at the end of the code being copy and and pasted. This formats the code into a readable format for forum members to view..
Also, it is a bad idea to commit inside a loop. Each commits does "+work"+ and user resources. If you loop iterates a 1000 times, it means doing a "1000 units of work" plus "using a 1000 units of resources".
It is much faster, and use less resources, when you only commit once at the end of the loop.
You also need to consider what happens when doing the 501st row, the loop fails. You now have 500 updated rows and 500 rows that have not been updated. Only.. which is which? It makes far better sense to update all 1000 rows and succeed, or not to update any rows (using a rollback) when any single row update fails.
Finally, you should use SQL to do as much of the processing for you. It is slow and expensive using a SQL to ship data from the SQL engine into the PL engine, and then ship that very same data back to the SQL engine to run another SQL statement. Stay within the SQL engine.
You could rewrite this entire block of code as a single SQL statement. -
Short dump while using call selection-screen mdynnr
Hi ALL,
I need your help and information.
In programmes, We are using the statament " CALL SELECTION-SCREEN MDYNNR "
and passing the screens dynamically into variable mdynnr.
And the programme is going to dump after executing 50 times.
When we
can we use any other statement instead of CALL SELECTION-SCREEN MDYNNR.
Your information helps us lot.
Thanks in advance.
Srinivasa Reddy.Hi,
As you know Call Screen is the statement, but you will get the problem if you are going to call it in the same LUW repeatedly. So, FM is the only convenient way to do it. This is very easy. Just create a FM and replace you statement with this FM. Hopefully this will solve your problem.
Check this comment " When you call a new main program in order to use a screen sequence (for example, using CALL TRANSACTION), a new SAP LUW begins. This may be an undesired effect, especially when you are trying to modularize a transaction that updates the database.
An alternative to this is to use an external procedure, whose main program is linked to a screen sequence, and which contains the corresponding dialog modules. Procedures run in the same SAP LUW and internal session as their calling program."
Thanks,
Maybe you are looking for
-
Can I add a 2nd Hard Drive to my new Pavilion dv6 notebook?
I would like to add a 2nd hard drive (preferably SSD) to my "HP Pavilion dv6-6188ca Entertainment Notebook PC" I am hoping there is an option to at least replace the DVD drive with a hard drive caddy? What are my options? Thanks!
-
Logic Pro 7 Hybrid Bass plug-in
I've just upgraded from Logic Pro 7 to Logic 8. I've come to load some of my songs to mix in 5.1 and found that some of the plug-ins that I used to key sounds in some of my tracks is no longer there. The GarageBand plug-in Hybrid Bass is gone, and ma
-
Possible video problems in iTunes 8.1 [no grid or cover flow views]
I had posted this problem under iTunes, but mentors there suggested instead I connect it to a video problem *"...my video drivers or other related problems I've had over the last two months with the iPhoto...* *Ah, didn't know about that. Try re-post
-
5800 XpressMusic - V 50.0.005 - Unable to see all ...
I recently updated my phone 5800 XpressMusic to latest firmware V 50.0.005 (Customer Version 50.0.005.C03.01) but I am unable to see many changes. The only changes that I notice are - kinetic scrolling, change in the way browser displays the page and
-
SAP REACh Compliance Project Management Capabilities
Dear experts, Do you have any list of the report names is SRC that can be used for project management? (i.e. Endpoint coverage, Status of registration at Substance level...) Many thanks and best regards, Alberto