SQL Error: ORA-01791: not a SELECTed expression 01791. 00000 -  "not a SELE

guys getting an error with a simple query. help me out please.
the query is:
select DISTINCT(product_code ||' ' || subproduct_code ||' '|| position_number) from alm_owner.wrr_recon_source order by product_code, subproduct_code, position_number;
Error report:
SQL Error: ORA-01791: not a SELECTed expression
01791. 00000 - "not a SELECTed expression"
*Cause:   
*Action:
any help is much appriciated.

Raghunadh wrote:
Yes. If he wants the result to be sorted on product_code, he can do something like:
select DISTINCT Det from (
select product_code ||' ' || subproduct_code ||' '|| position_number as Det
from alm_owner.wrr_recon_source)
order by substr(product_code,1);This will atleast sort the first section of the result. For example,
@raghu> select distinct det from (select empno ||' ' || ename ||' '|| sal Det from emp);
DET
7499 ALLEN 1600
7369 SMITH 5600
7844 TURNER 7000
7900 JAMES 950
7654 MARTIN 6500
7698 BLAKE 2850
7788 SCOTT 3000
7934 MILLER 6600
7566 JONES 2975
7839 KING 5000
7521 WARD 1250
7369 SMITH 800
7844 TURNER 1500
7876 ADAMS 1100
7934 MILLER 1300
7876 ADAMS 6200
7782 CLARK 2450
7521 WARD 6500
7900 JAMES 5900
7902 FORD 3000
@raghu> select distinct det from (
2  select empno ||' ' || ename ||' '|| sal Det from emp) order by substr(det,1);
DET
7369 SMITH 5600
7369 SMITH 800
7499 ALLEN 1600
7521 WARD 1250
7521 WARD 6500
7566 JONES 2975
7654 MARTIN 6500
7698 BLAKE 2850
7782 CLARK 2450
7788 SCOTT 3000
7839 KING 5000
7844 TURNER 1500
7844 TURNER 7000
7876 ADAMS 1100
7876 ADAMS 6200
7900 JAMES 5900
7900 JAMES 950
7902 FORD 3000
7934 MILLER 1300
7934 MILLER 6600(Dont worry about the records in emp table, I inserted some sample duplicate records to test something)I don't understand what SUBSTR(det,1) is for. That's the same as ORDER BY det surely? Which is also the same as ORDER BY empno ||' ' || ename ||' '|| sal....
Edited by: Bravid on Mar 2, 2012 11:56 AM

Similar Messages

  • ORA-01791: not a SELECTed expression - Order by

    Hi,
    Below query is executing in one system (database version 10.2 64 bit) without any error.
    select distinct CONTRACTOR_ID,CONTRACTOR_NAME from CONTRACTOR order by REGISTRATION_NO
    But same query is not working in other system (database version 10.2 32-bit). It throws ORA-01791: not a SELECTed expression error.
    Please clarify why it is working in one system and not working in other system
    Thanks,
    Sujnan

    Does the CONTRACTOR table have it's keys defined in both databases?
    Oracle can decide to not do the DISTINCT (and thus allow such ORDER BY), in case it is aware of some key-column being selected. Take a look at this, same query, one works, one doesn't due to absence of primary key:
    SQL> create table myemp(empno number not null primary key, job varchar2(10))
    Table created.
    SQL> select distinct empno from emp order by job;
         EMPNO
             2
             1
    SQL> alter table emp drop primary key;
    Table altered.
    SQL> select distinct empno from emp order by job;
    select distinct empno from emp order by job
    ERROR at line 1:
    ORA-01791: not a SELECTed expression
    SQL>

  • ORA-01791: not a SELECTed expression

    How can i fix this error? Any help is apprecaited..
    SQL> create table test(no number,no1 number);
    Table created.
    SQL> insert into test values(1,1);
    1 row created.
    SQL> select distinct no,no1
    2 from test order by no1;
    NO NO1
    1 1
    SQL> SELECT distinct no||'|'||no1 from test
    2 order by no1;
    order by no1
    ERROR at line 2:
    ORA-01791: not a SELECTed expression
    SQL>

    Shrinika wrote:
    How can i fix this error? Any help is apprecaited..
    SQL> create table test(no number,no1 number);
    Table created.
    SQL> insert into test values(1,1);
    1 row created.
    SQL> select distinct no,no1
    2 from test order by no1;
    NO NO1
    1 1
    SQL> SELECT distinct no||'|'||no1 from test
    2 order by no1;
    order by no1
    ERROR at line 2:
    ORA-01791: not a SELECTed expression
    SQL>SELECT distinct no||'|'||no1 from test order by 1;

  • SQL Error: ORA-01861: literal does not match format string

    Hello,
    I'm trying to do data mining on a web log which recorded one day web access information from a busy web server. I imported the data into Oracle Data miner, and created a table (WEBLOG). The idea is to create a new field, i.e. session, for the users so that each session could be thought as a representative of a user-intent (aka topic). Now based on this, data mining models would be used to cluster(group) the users based on their similarity. The first step is to prepare the data which involves using SQL queries. So first, all I did was to create a function for date and time. This is the following code I used,
    create or replace function ssndate(p_date in varchar2 default '03-01-18',
    p_time in varchar2)
    return number
    $if dbms_db_version.ver_le_10 $then
    deterministic
    $elsif dbms_db_version.ver_le_11 $then
    result_cache
    $end
    as
    begin
    return trunc((to_date(p_date||' '||p_time, 'dd-mm-yy hh24:mi:ss')
    - to_date('01-01-90','dd-mm-yy')) * (86400/2400));
    end ssndate;
    The function ssndate compiled successfully.
    The next step I took was to create a view through the following query,
    create or replace view WEBLOG_VIEWS
    as
    select (select ssndate(LOG_DATE, LOG_TIME) from dual) as "SESSION_DT",
    C_IP,
    CS_USER_AGENT,
    (CS_URI_STEM||'?'||CS_URI_QUERY) as WEB_LINK
    from WEBLOG;
    This was successful as well. The problem is in the next step where I try to do data grouping.
    create table FINAL_WEBLOG as
    select SESSION_DT, C_IP, CS_USER_AGENT,
    listagg(WEB_LINK, ' ')
    within group(order by C_IP, CS_USER_AGENT) "WEB_LINKS"
    from WEBLOG_VIEWS
    group by C_IP, CS_USER_AGENT, SESSION_DT
    order by SESSION_DT
    For this, I got the error,
    Error starting at line 1 in command:
    create table FINAL_LOG as
    select SESSION_DT, C_IP, CS_USER_AGENT,
    listagg(WEB_LINK, ' ')
    within group(order by C_IP, CS_USER_AGENT) "WEB_LINKS"
    from WEBLOG_VIEWS
    group by C_IP, CS_USER_AGENT, SESSION_DT
    order by SESSION_DT
    Error at Command Line:1 Column:7
    Error report:
    SQL Error: ORA-01861: literal does not match format string
    ORA-06512: at "DMUSER.SSNDATE", line 11
    ORA-06512: at line 1
    01861. 00000 - "literal does not match format string"
    *Cause:    Literals in the input must be the same length as literals in
    the format string (with the exception of leading whitespace).
    If the "FX" modifier has been toggled on, the literal must
    match exactly, with no extra whitespace.
    *Action:   Correct the format string to match the literal.
    I don't know where I'm going wrong with this.. the to_date function should be fine. In the data that I possess, the date and time are in no format. Example: 30118 and 0:00:09 respectively. If anyone has any clue about this I would be sincerely grateful for any help that I can get!! It's quite urgent..
    The Oracle version is 11.2.0.1.0
    Edited by: 975265 on Dec 5, 2012 5:31 PM

    975265 wrote:
    Ok.. Looks like I touched a nerve there. I apologize. I'm still a student, and this is the first time that I've tried something at this level. I'm still in the learning process, so I was hoping that someone could point me in the right direction in order to "fix" the data.Not so much touching a nerve as simply trying to implement a very very poor, but all too common, practice. Since you are a student (which we didn't know until this post) most people will cut you some slack. However, this little exchange should now be burned into your brain as you move forward. One of the very first rules of programming is to ALWAYS use the correct data types for your data. And along with that, never ever depend on implicit type conversions - always use the proper explicit conversion functions.
    And as a slight follow-on, when considering the appropriate data type, don't assume that just because we refer to a given element as a 'something number' that it is indeed a number. Telephone "numbers" are NOT numbers. U.S. Social Security "numbers" are NOT numbers. U.S. Postal Zip codes are NOT numbers. All are just character strings which, by convention, we limit to the same characters we use to represent numbers.
    And since this entire discussion came up around the representation of dates, you might want to take a look at http://edstevensdba.wordpress.com/2011/04/07/nls_date_format/
    Now, go forth and be a smarter programmer than your peers.
    Edited by: EdStevens on Dec 6, 2012 6:12 AM

  • SQL Error [ORA-00933: SQL command not properly ended

    I have following installed:
    7.9.6 BI Apps
    10.1.3.4 DAC
    8.6.0 Informatica
    Container JDE Enterprise 9.0
    Out of 211 tasks 69 tasks executed successfully.
    Error in workflow [SDE_JDE_PartyOrganisationDimension_Full].
    I have checked the session log file and understand that there is error with the SQL statement.
    Since it is Pre-built, the workflow should have run properly with correct SQl statement. But in this case it is not working.
    Is it because the SQL statement is too long?
    Any help will be greatly appreciated.
    Part of the log file
    RR_4035 : SQL Error [
    ORA-00933: SQL command not properly ended
    Database driver error...
    Function Name : Execute
    SQL Stmt : SELECT
    F0101.ABAN8,F0101.ABALKY,F0101.ABTAX,F0101.ABALPH,F0101.ABMCU,F0101.ABSIC,F0101.ABAT1, F0101.ABTAXC, F0101.ABATP, F0101.ABATR,F0101.ABEFTB,F0101.ABAC01,
    F0101.ABAC02, F0101.ABAC03, F0101.ABAC04, F0101.ABAC05, F0101.ABAC06, F0101.ABAC07, F0101.ABAC08, F0101.ABAC09, F0101.ABAC10, F0101.ABAC11,
    F0101.ABAC12, F0101.ABAC13, F0101.ABAC14, F0101.ABAC15, F0101.ABAC16, F0101.ABAC17, F0101.ABAC18, F0101.ABAC19, F0101.ABAC20, F0101.ABAC21, F0101.ABAC22, F0101.ABAC23,
    F0101.ABAC24, F0101.ABAC25, F0101.ABAC26, F0101.ABAC27, F0101.ABAC28, F0101.ABAC29, F0101.ABAC30,F0101.ABUSER, F0101.ABUPMJ,F0101.ABUPMT,F0101.ABTICKER, F0101.ABEXCHG, F0101.ABDUNS,
    F0101.ABNOE,F0101.ABGROWTHR,F0101.ABYEARSTAR,F0101.ABREVRNG, D.FaxPhoneArea, d.Phonearea, D.Fax AS Fax ,D.Phone As Phone,D.WPUPMJ AS WPUPMJ,R.Email AS Email,R.Internet As Internet,R.EAupmj As EAUPMJ,F0111.WWAN8,F0111.WWIDLN,
    F0111.WWSLNM,F0111.WWGNNM,F0111.WWMDNM,F0111.WWSRNM,F0111.WWUSER,F0111.WWUPMJ,F0111.WWUPMT,F0111.WWNTYP,F0111.WWNICK,F0111.WWPCM,F0116.ALAN8,
    F0116.ALEFTB,F0116.ALADD1,F0116.ALADD2,F0116.ALADD3,F0116.ALADD4, F0116.ALADDZ, F0116.ALCTY1,F0116.ALADDS,F0116.ALCTR, F0116.ALUPMJ,F0116.ALUPMT,F03012.AIAN8, F03012.AICO,F03012.AIMCUR,F03012.AICRCD,F03012.AIACL,
    F03012.AIARPY,F03012.AIDB,F03012.AICRCA,F03012.AIASTY,F03012.AISPYE,F03012.AIOPY,F03012.AIPOPN,F03012.AIDAOJ,F03012.AIAN8R,F03012.AICPGP,F03012.AIFRTH,
    F03012.AIMAN8,F03012.AIUPMJ,F03012.AIUPMT, F03012.AICUSTS,F03012.AITERRID, F03012.AIDTEE, F0401.A6AN8, F0401.A6MCUP, F0401.A6CRRP,F0401.A6CRCA, F0401.A6AN8R,F0401.A6CPGP, F0401.A6FRTH, F0401.A6UPMJ,F0401.A6UPMT, CAST(F0101.ABAC03 AS CHAR(10)) AS FLEX_ATTRIB_1_CHAR,
    CAST(F0101.ABAC23 AS CHAR(10)) AS FLEX_ATTRIB_2_CHAR,
    CAST(F0101.ABAC05 AS CHAR(10)) AS FLEX_ATTRIB_3_CHAR,
    CAST(F0101.ABAC15 AS CHAR(10)) AS FLEX_ATTRIB_4_CHAR,
    CAST(F0101.ABAC09 AS CHAR(10)) AS FLEX_ATTRIB_5_CHAR,
    CAST(F0101.ABAC11 AS CHAR(10)) AS FLEX_ATTRIB_6_CHAR,
    CAST(F0101.ABAC19 AS CHAR(10)) AS FLEX_ATTRIB_7_CHAR,
    CAST(F0101.ABAC21 AS CHAR(10)) AS FLEX_ATTRIB_8_CHAR,
    CAST(F0101.ABAC27 AS CHAR(10)) AS FLEX_ATTRIB_9_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_10_CHAR,
    CAST(F0101.ABAC17 AS CHAR(10)) AS FLEX_ATTRIB_11_CHAR,
    CAST(F0101.ABAC06 AS CHAR(10)) AS FLEX_ATTRIB_12_CHAR,
    CAST(F0101.ABAC08 AS CHAR(10)) AS FLEX_ATTRIB_13_CHAR,
    CAST(F0101.ABAC14 AS CHAR(10)) AS FLEX_ATTRIB_14_CHAR,
    CAST(F0101.ABAC22 AS CHAR(10)) AS FLEX_ATTRIB_15_CHAR,
    CAST(F0101.ABAC28 AS CHAR(10)) AS FLEX_ATTRIB_16_CHAR,
    CAST(F0101.ABAC18 AS CHAR(10)) AS FLEX_ATTRIB_17_CHAR,
    CAST(F0101.ABAC10 AS CHAR(10)) AS FLEX_ATTRIB_18_CHAR,
    CAST(F0101.ABAC20 AS CHAR(10)) AS FLEX_ATTRIB_19_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_20_CHAR,
    CAST(F0101.ABAC30 AS CHAR(10)) AS LINE_OF_BUSINESS,
    CAST(F0101.ABAC14 AS CHAR(10)) AS REGION,
    CAST(NULL AS CHAR(10)) AS ACCNT_AHA_NUM,
    CAST(F0101.ABAC07 AS CHAR(10)) AS ACCNT_CLASS,
    CAST(F0101.ABAC11 AS CHAR(10)) AS ACCNT_HIN_NUM,
    CAST(F0101.ABAC02 AS CHAR(10)) AS ACCNT_REGION,
    CASt(F0101.ABAC08 AS CHAR(10)) AS ACCNT_VALUE,
    CAST(F0101.ABAC16 AS CHAR(10)) AS CUST_CAT_CODE, '0' AS X_CUSTOM
    from F0101
    INNER JOIN F03012 ON F0101.ABAN8 = F03012.AIAN8
    LEFT OUTER JOIN F0401 ON F0101.ABAN8 = F0401.A6AN8
    LEFT OUTER JOIN F0116 ON F0101.ABAN8 = F0116.ALAN8 AND F0101.ABEFTB = F0116.ALEFTB
    LEFT OUTER JOIN F0111 ON F0101.ABAN8 = F0111.WWAN8 AND F0111.WWIDLN =
    LEFT OUTER JOIN (select a.WPAN8 as an8,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) FaxPhoneArea,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Fax,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Phone,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) Phonearea,
    max(wpupmj) as WPUPMJ
    from F0115 a,
    (select WPAN8,WPPHTP ,min(WPRCK7) MinWPRCK7 from F0115
    group by WPAN8,WPPHTP
    ) b
    where a.WPAN8=b.WPAN8 and a.wpidln =0
    group by a.WPAN8)D on f0101.aban8 = D.an8
    LEFT OUTER JOIN (SELECT P.EAAN8 as an8,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Email,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Internet,Max(eaupmj) as EAupmj
    FROM F01151 P,
    (SELECT EAAN8,EAETP,MIN(EARCK7) MinRck7E from f01151
    group by eaan8,eaemal,eaetp)Q
    where
    P.EAAN8 = Q.EAAN8 and P.EAIDLN =
    GROUP BY P.EAAN8)R on f0101.aban8 = R.an8
    union
    SELECT
    F0101.ABAN8,F0101.ABALKY,F0101.ABTAX,F0101.ABALPH,F0101.ABMCU,F0101.ABSIC,F0101.ABAT1, F0101.ABTAXC, F0101.ABATP, F0101.ABATR,F0101.ABEFTB,F0101.ABAC01,
    F0101.ABAC02, F0101.ABAC03, F0101.ABAC04, F0101.ABAC05, F0101.ABAC06, F0101.ABAC07, F0101.ABAC08, F0101.ABAC09, F0101.ABAC10, F0101.ABAC11,
    F0101.ABAC12, F0101.ABAC13, F0101.ABAC14, F0101.ABAC15, F0101.ABAC16, F0101.ABAC17, F0101.ABAC18, F0101.ABAC19, F0101.ABAC20, F0101.ABAC21, F0101.ABAC22, F0101.ABAC23,
    F0101.ABAC24, F0101.ABAC25, F0101.ABAC26, F0101.ABAC27, F0101.ABAC28, F0101.ABAC29, F0101.ABAC30,F0101.ABUSER, F0101.ABUPMJ,F0101.ABUPMT,F0101.ABTICKER, F0101.ABEXCHG, F0101.ABDUNS,
    F0101.ABNOE,F0101.ABGROWTHR,F0101.ABYEARSTAR,F0101.ABREVRNG, D.FaxPhoneArea, d.Phonearea, D.Fax AS Fax ,D.Phone As Phone,D.WPUPMJ AS WPUPMJ,R.Email AS Email,R.Internet As Internet,R.EAupmj As EAUPMJ,F0111.WWAN8,F0111.WWIDLN,
    F0111.WWSLNM,F0111.WWGNNM,F0111.WWMDNM,F0111.WWSRNM,F0111.WWUSER,F0111.WWUPMJ,F0111.WWUPMT,F0111.WWNTYP,F0111.WWNICK,F0111.WWPCM,F0116.ALAN8,
    F0116.ALEFTB,F0116.ALADD1,F0116.ALADD2,F0116.ALADD3,F0116.ALADD4, F0116.ALADDZ, F0116.ALCTY1,F0116.ALADDS,F0116.ALCTR, F0116.ALUPMJ,F0116.ALUPMT,F03012.AIAN8, F03012.AICO,F03012.AIMCUR,F03012.AICRCD,F03012.AIACL,
    F03012.AIARPY,F03012.AIDB,F03012.AICRCA,F03012.AIASTY,F03012.AISPYE,F03012.AIOPY,F03012.AIPOPN,F03012.AIDAOJ,F03012.AIAN8R,F03012.AICPGP,F03012.AIFRTH,
    F03012.AIMAN8,F03012.AIUPMJ,F03012.AIUPMT, F03012.AICUSTS,F03012.AITERRID, F03012.AIDTEE, F0401.A6AN8, F0401.A6MCUP, F0401.A6CRRP,F0401.A6CRCA, F0401.A6AN8R,F0401.A6CPGP, F0401.A6FRTH, F0401.A6UPMJ,F0401.A6UPMT, CAST(F0101.ABAC03 AS CHAR(10)) AS FLEX_ATTRIB_1_CHAR,
    CAST(F0101.ABAC23 AS CHAR(10)) AS FLEX_ATTRIB_2_CHAR,
    CAST(F0101.ABAC05 AS CHAR(10)) AS FLEX_ATTRIB_3_CHAR,
    CAST(F0101.ABAC15 AS CHAR(10)) AS FLEX_ATTRIB_4_CHAR,
    CAST(F0101.ABAC09 AS CHAR(10)) AS FLEX_ATTRIB_5_CHAR,
    CAST(F0101.ABAC11 AS CHAR(10)) AS FLEX_ATTRIB_6_CHAR,
    CAST(F0101.ABAC19 AS CHAR(10)) AS FLEX_ATTRIB_7_CHAR,
    CAST(F0101.ABAC21 AS CHAR(10)) AS FLEX_ATTRIB_8_CHAR,
    CAST(F0101.ABAC27 AS CHAR(10)) AS FLEX_ATTRIB_9_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_10_CHAR,
    CAST(F0101.ABAC17 AS CHAR(10)) AS FLEX_ATTRIB_11_CHAR,
    CAST(F0101.ABAC06 AS CHAR(10)) AS FLEX_ATTRIB_12_CHAR,
    CAST(F0101.ABAC08 AS CHAR(10)) AS FLEX_ATTRIB_13_CHAR,
    CAST(F0101.ABAC14 AS CHAR(10)) AS FLEX_ATTRIB_14_CHAR,
    CAST(F0101.ABAC22 AS CHAR(10)) AS FLEX_ATTRIB_15_CHAR,
    CAST(F0101.ABAC28 AS CHAR(10)) AS FLEX_ATTRIB_16_CHAR,
    CAST(F0101.ABAC18 AS CHAR(10)) AS FLEX_ATTRIB_17_CHAR,
    CAST(F0101.ABAC10 AS CHAR(10)) AS FLEX_ATTRIB_18_CHAR,
    CAST(F0101.ABAC20 AS CHAR(10)) AS FLEX_ATTRIB_19_CHAR,
    CAST(NULL AS CHAR(10)) AS FLEX_ATTRIB_20_CHAR,
    CAST(F0101.ABAC30 AS CHAR(10)) AS LINE_OF_BUSINESS,
    CAST(F0101.ABAC14 AS CHAR(10)) AS REGION,
    CAST(NULL AS CHAR(10)) AS ACCNT_AHA_NUM,
    CAST(F0101.ABAC07 AS CHAR(10)) AS ACCNT_CLASS,
    CAST(F0101.ABAC11 AS CHAR(10)) AS ACCNT_HIN_NUM,
    CAST(F0101.ABAC02 AS CHAR(10)) AS ACCNT_REGION,
    CASt(F0101.ABAC08 AS CHAR(10)) AS ACCNT_VALUE,
    CAST(F0101.ABAC16 AS CHAR(10)) AS CUST_CAT_CODE, '0' AS X_CUSTOM
    from F0101
    LEFT OUTER JOIN F03012 ON F0101.ABAN8 = F03012.AIAN8
    INNER JOIN F0401 ON F0101.ABAN8 = F0401.A6AN8
    LEFT OUTER JOIN F0116 ON F0101.ABAN8 = F0116.ALAN8 AND F0101.ABEFTB = F0116.ALEFTB
    LEFT OUTER JOIN F0111 ON F0101.ABAN8 = F0111.WWAN8 AND F0111.WWIDLN =
    LEFT OUTER JOIN (select a.WPAN8 as an8,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) FaxPhoneArea,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Fax,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPPH1 end) Phone,
    min(case when a.WPPHTP= and a.WPRCK7=b.MinWPRCK7 then WPAR1 end) Phonearea,
    max(wpupmj) as WPUPMJ
    from F0115 a,
    (select WPAN8,WPPHTP ,min(WPRCK7) MinWPRCK7 from F0115
    group by WPAN8,WPPHTP
    ) b
    where a.WPAN8=b.WPAN8 and a.wpidln =0
    group by a.WPAN8)D on f0101.aban8 = D.an8
    LEFT OUTER JOIN (SELECT P.EAAN8 as an8,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Email,
    min(case when P.EAETP= and P.EARCK7=Q.MinRCK7E then EAEMAL end) Internet,Max(eaupmj) as EAupmj
    FROM F01151 P,
    (SELECT EAAN8,EAETP,MIN(EARCK7) MinRck7E from f01151
    group by eaan8,eaemal,eaetp)Q
    where
    P.EAAN8 = Q.EAAN8 and P.EAIDLN =
    GROUP BY P.EAAN8)R on f0101.aban8 = R.an8
    Oracle Fatal Error
    Database driver error...
    Function Name : Execute
    *****************************************************

    "ORA-00933: SQL command not properly ended"
    this error may be seen due to reasons like the Informatica properties are not set correct.
    Are all the informatica properties set correct? how many ETL jobs completed, what analytic apps are in the ETL process?

  • Migrating from Sql server get SQL Error: ORA-00936: missing expression

    All,
    I'm migrating from Sql Server to oracle 10g and I'm getting a
    "SQL Error: ORA-00936: missing expression" error
    when the following create table statement is executed. It appears 10g does not like the CREATE DEFAULT xxxx as xxx syntax. Any ideas??
    CREATE TABLE EnvCapitalOtherCostAtom (
    EnvID CHAR(36) NOT NULL,
    CapitalID CHAR(36) NOT NULL,
    Seq FLOAT DEFAULT
    CREATE DEFAULT D_Set_To_Zero
         AS 0
    NOT NULL,
    AtomID CHAR(36) DEFAULT
    CREATE DEFAULT D_NewGUID
         AS newid
    NOT NULL,
    AtomName VARCHAR2(100) NOT NULL,
    AtomName_dqa NUMBER(5,0) DEFAULT
    CREATE DEFAULT D_DQA_Dflt
         AS 10
    NOT NULL,
    CreatedOnTimeStamp TIMESTAMP(6) NOT NULL,
    LastEditedOnTimeStamp TIMESTAMP(6) NOT NULL,
    TFDubh_dqa NUMBER(5,0),
    record_flags NUMBER(5,0) DEFAULT
    CREATE DEFAULT D_Record_Flags
         AS 0
    NOT NULL,
    record_dqa NUMBER(5,0) DEFAULT
    CREATE DEFAULT D_Record_DQA
         AS 30
    NOT NULL
    );

    Hi Chris,
    not sure SQL Server accepts the syntax you provided either. Even more I have checked MSDN(http://msdn2.microsoft.com/en-us/library/ms173565.aspx) and they recommend:
    Avoid using CREATE DEFAULT in new development work, and plan to modify applications that currently use it. Instead, use default definitions created using the DEFAULT keyword of ALTER TABLE or CREATE TABLE. CREATE DEFAULT will be removed in a future version of Microsoft SQL Server.
    In Oracle you should do the same either use DEFAULT in CREATE TABLE statement or in ALTER TABLE, have a look at http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_constraints.htm#sthref626 for more details.
    The proper Oracle syntax for your DDL should be something like:
    CREATE TABLE EnvCapitalOtherCostAtom (
    EnvID CHAR(36) NOT NULL,
    CapitalID CHAR(36) NOT NULL,
    Seq FLOAT DEFAULT 0 NOT NULL,
    AtomID CHAR(36) DEFAULT SYS_GUID() NOT NULL,
    AtomName VARCHAR2(100) NOT NULL,
    AtomName_dqa NUMBER(5,0) DEFAULT 10 NOT NULL,
    CreatedOnTimeStamp TIMESTAMP(6) NOT NULL,
    LastEditedOnTimeStamp TIMESTAMP(6) NOT NULL,
    TFDubh_dqa NUMBER(5,0),
    record_flags NUMBER(5,0) DEFAULT 0 NOT NULL,
    record_dqa NUMBER(5,0) DEFAULT 30 NOT NULL
    );

  • SQL Error: ORA-00942: table or view does not exist + CX_RS_SQL_ERROR

    HI ,
    we are facing below issue while activating info object xxxxxxxx
    " SQL Error: ORA-00942: table or view does not exist "  and   " CX_RS_SQL_ERROR  "
    can any one help us out to resolve this issue.
    Thanks,
    EDK......

    Hi,
    Check the corrections given in the note 990764:
    Reason and Prerequisites
    Up to now, using a characteristic with its own master data read class as the InfoProvider was not supported. This is now released but it is not available for all modelings. Using the attributes in the query is not supported for characteristics that have their own master data read class. Using the attributes in the query causes a termination. The following errors may occur in this case:
    ORA-00942: table or view does not exist
    Fehler in CL_SQL_RESULT_SET  Include NEXT_PACKAGE
    RAISE_READ_ERROR in CL_RSDRV_VPROV_BASE
    Solution
    SAP NetWeaver 2004s BI
               Import Support Package 11 for SAP NetWeaver 2004s BI (BI Patch 11 or SAPKW70011) into your BI system. The Support Package is available once Note 0914305 "SAPBINews BI 7.0 Support Package 11", which describes this Support Package in more detail, has been released for customers.
    In urgent cases you can implement the correction instructions.
    The correction instructions contain the tightened inspection for characteristics.
    Regards,
    Anil Kumar Sharma .P

  • SQL Error: ORA-12899: value too large for column

    Hi,
    I'm trying to understand the above error. It occurs when we are migrating data from one oracle database to another:
    Error report:
    SQL Error: ORA-12899: value too large for column "USER_XYZ"."TAB_XYZ"."COL_XYZ" (actual: 10, maximum: 8)
    12899. 00000 - "value too large for column %s (actual: %s, maximum: %s)"
    *Cause:    An attempt was made to insert or update a column with a value
    which is too wide for the width of the destination column.
    The name of the column is given, along with the actual width
    of the value, and the maximum allowed width of the column.
    Note that widths are reported in characters if character length
    semantics are in effect for the column, otherwise widths are
    reported in bytes.
    *Action:   Examine the SQL statement for correctness.  Check source
    and destination column data types.
    Either make the destination column wider, or use a subset
    of the source column (i.e. use substring).
    The source database runs - Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    The target database runs - Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    The source and target table are identical and the column definitions are exactly the same. The column we get the error on is of CHAR(8). To migrate the data we use either a dblink or oracle datapump, both result in the same error. The data in the column is a fixed length string of 8 characters.
    To resolve the error the column "COL_XYZ" gets widened by:
    alter table TAB_XYZ modify (COL_XYZ varchar2(10));
    -alter table TAB_XYZ succeeded.
    We now move the data from the source into the target table without problem and then run:
    select max(length(COL_XYZ)) from TAB_XYZ;
    -8
    So the maximal string length for this column is 8 characters. To reduce the column width back to its original 8, we then run:
    alter table TAB_XYZ modify (COL_XYZ varchar2(8));
    -Error report:
    SQL Error: ORA-01441: cannot decrease column length because some value is too big
    01441. 00000 - "cannot decrease column length because some value is too big"
    *Cause:   
    *Action:
    So we leave the column width at 10, but the curious thing is - once we have the data in the target table, we can then truncate the same table at source (ie. get rid of all the data) and move the data back in the original table (with COL_XYZ set at CHAR(8)) - without any issue.
    My guess the error has something to do with the storage on the target database, but I would like to understand why. If anybody has an idea or suggestion what to look for - much appreciated.
    Cheers.

    843217 wrote:
    Note that widths are reported in characters if character length
    semantics are in effect for the column, otherwise widths are
    reported in bytes.You are looking at character lengths vs byte lengths.
    The data in the column is a fixed length string of 8 characters.
    select max(length(COL_XYZ)) from TAB_XYZ;
    -8
    So the maximal string length for this column is 8 characters. To reduce the column width back to its original 8, we then run:
    alter table TAB_XYZ modify (COL_XYZ varchar2(8));varchar2(8 byte) or varchar2(8 char)?
    Use SQL Reference for datatype specification, length function, etc.
    For more info, reference {forum:id=50} forum on the topic. And of course, the Globalization support guide.

  • SQL Error: ORA-01704: string literal too long

    select * from table(fn_split('some 10000 characters with comma separation .........................'))
    Error report:
    SQL Error: ORA-01704: string literal too long
    01704. 00000 - "string literal too long"
    *Cause:    The string literal is longer than 4000 characters.
    *Action:   Use a string literal of at most 4000 characters.
    how to pass my 10k record string

    933663 wrote:
    The string is through a user interface.So, that interface is using what datatype for the string? What language is the interface written in?
    insert into table
    select * from table(fn_split('2,4,2,5,7'));Do you understand what a string literal is? You cannot provide a varchar2 string that exceeds 4000 bytes from within SQL. Fact. It just cannot be done.
    If you are passing the string from a user interface using a datatype that supports more than 4000 bytes, and you pass it directly to PL/SQL code by calling the function or procedure directly (not using SQL) then you can use up to 32767 bytes for your VARCHAR2.
    The code you've posted (which happens to be some of my own code posted years ago on these forums) takes a VARCHAR2 as an input. You would have to change that to accept a CLOB datatype and work on the CLOB instead. However, you still wouldn't be able to pass in a string literal of more than 4000 bytes from SQL for it.
    Looking at your other thread: Seperate the string value
    ... it looks like the 'user' is trying to pass in a table definition. What is it your application is trying to do? Surely you are not trying to create a table at run time?
    So explain, what is the business issue you are trying to solve? We may be able to provide a better way of doing it.

  • SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout

    Dear Friends,
    I executed the following stmsts:
    1)CREATE OR REPLACE DIRECTORY TEST_DIR AS 'd:\mydata';
    2)GRANT READ, WRITE ON DIRECTORY TEST_DIR TO wonders_mumbai1;
    3)CREATE TABLE ext_tab18 (
    old_cust VARCHAR2(8),
    new_cust VARCHAR2(8)
    ORGANIZATION EXTERNAL (
    TYPE oracle_loader
    DEFAULT DIRECTORY TEST_DIR
    ACCESS PARAMETERS (
    RECORDS DELIMITED BY NEWLINE
    BADFILE TEST_DIR:'bad-upload.bad'
    LOGFILE TEST_DIR:'log_upload.log'
    FIELDS TERMINATED BY ','
    OPTIONALLY ENCLOSED BY '"'
    MISSING FIELD VALUES ARE NULL
    REJECT ROWS WITH ALL NULL FIELDS
    (old_cust,new_cust))
    LOCATION ('datafile1.csv')
    REJECT LIMIT 0
    NOMONITORING;
    4)SELECT * FROM ext_tab18;
    1 -3 execute successfully.
    4 throws up the error:
    Error starting at line 1 in command:
    SELECT * FROM ext_tab18
    Error report:
    SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file log_upload.log
    OS error The system cannot find the file specified.
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    29913. 00000 - "error in executing %s callout"
    *Cause: The execution of the specified callout caused an error.
    *Action: Examine the error messages take appropriate action.
    What is to be done?

    Hi,
    Yes if I put it on the server it works.
    But if I put the file on the client in a shared folder and put the ip address as below:
    10.97.140.59\mydata
    it doesn't work.
    So it seems that this will work if the file is on the server and not on any client.
    If that be the case then it is a definite disadvantage.
    thanks for ur reply.

  • SQL Error: ORA-01873: the leading precision of the interval is too small

    Hi,
    My requirement is to get the current time stamp in Epoch time microsec format.
    I am trying to execute the following query
    select (CAST(((current_timestamp - TO_DATE('01/01/1970 00:00:00', 'MM-DD-YYYY HH24:MI:SS'))*24*60*60*1000000) AS varchar(32)) ) as "dt" from dual ;
    i am receiving the following error
    Error starting at line 1 in command:
    select (CAST(((current_timestamp - TO_DATE('01/01/1970 00:00:00', 'MM-DD-YYYY HH24:MI:SS'))*24*60*60*1000000) AS varchar(32)) ) as "dt" from dual
    Error report:
    SQL Error: ORA-01873: the leading precision of the interval is too small
    01873. 00000 - "the leading precision of the interval is too small"
    *Cause:    The leading precision of the interval is too small to store the
    specified interval.
    *Action:   Increase the leading precision of the interval or specify an
    interval with a smaller leading precision.
    but if i tried to do
    select (CAST(((sysdate - TO_DATE('01/01/1970 00:00:00', 'MM-DD-YYYY HH24:MI:SS'))*24*60*60*1000000) AS varchar(32)) ) as "dt" from dual ;
    is working fine but i am getting the wrong epochtime as sysdate does not have the timezone information.
    please help me how to make the first query work so that i can get the current_timestamp change it to gmt and convert it to Epoch time.
    please let me know if there is any other way to get the Epochtime.

    Depending if you want or not to include fraction of a second use:
    with t as (
               select  current_timestamp at time zone 'gmt' - to_timestamp_tz('01/01/1970 00:00:00 GMT','MM-DD-YYYY HH24:MI:SS TZR') interval_diff,
                       cast(current_timestamp at time zone 'gmt' as date) - to_date('01/01/1970 00:00:00', 'MM-DD-YYYY HH24:MI:SS') num_diff
                 from  dual
    select  cast(
                    extract(day from interval_diff) * 24 + extract(hour from interval_diff)
                   ) * 60 + extract(minute from interval_diff)
                  ) * 60 + extract(second from interval_diff)
                 ) * 1000000
                 AS varchar(32)
                ) as "ts",
            cast(num_diff * 24 * 60 * 60 * 1000000 AS varchar(32)) as "dt"
      from t
    ts                   dt
    1336237158093000     1336237158000000
    SQL>  SY.

  • XMLQuery SQL Error: ORA-00600: internal error code,

    Hi guys,
    I am trying to use XML feature of Oracle DB. What I am trying to implement is having XMLTYpe field in table and have some values in it and then query that table using XMLQuery(...). I started with example here : http://www.psoug.org/reference/xmlquery.html .
    I am able to create table, Insert data into table, but when I tried to run SELECT query it does not work
    "SELECT person_id, XMLQuery(
    'for $i in /PDRecord
    where $i /PDName = "Daniel Morgan"
    order by $i/PDName
    return $i/PDName'
    passing by value person_data
    RETURNING CONTENT) XMLData
    FROM person_data; "
    It throws error like
    "Error report:
    SQL Error: ORA-00600: internal error code, arguments: [qmxqrwRewExpr:1], [], [], [], [], [], [], []
    00600. 00000 - "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
    Am I missing any thing? or is my Oracle 10g DB is not compatible with XMLType ?
    Please help.

    Hi Marco,
    Thanks for replying.
    Oracle Database 10g Release 10.2.0.1.0 - Production. so as per you said it should work. I am sorry for being dumb, but I am not DBA guy. can you tell me how to check if XMLDB is installed properly? how can I look at DBA_REGISTRY and what kind of information I will find under DBA_REGISTRY?
    BTW I found another way of querying XMLType columns from here http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96620/xdb04cre.htm which uses extract(), existsNode(), etc.. function to accomplish some of the task. As of now I am still digging in it, so not sure which one will be better to use. I mean the link that I showed on my first thread or the above link.
    I am still curious why wouldnt my first thread query work.
    Thanks again.

  • Error ORA-01652 while running select query

    A select query returning millions of records is returning the following error.
    SQL Error [
    ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
    We requested DBA to increased the TEMP tablespace. He increased it to 20GB and also, changed to Autoextent.
    When we executed the query again, we got the same error ?
    What could be the reason of this issue and how it can be resolved ?

    All sort operations that don't fit into the SORT_AREA_SIZE will go to the temp tablespace (they can be seen as direct writes in the trace file).
    It can easy be the case, that your temp tablespace needs to be many GB in size [we have a table with millions of rows and for the loading/merging our temp is 80GB in size].
    May be you can change your process of loading i.e. with this select you fill a intermediate table (with CTAS) and do your processing there or even try to do the processing in SQL while building the table. You could also try to do the processing with a cursor and BULK COLLECT LIMIT 100 and then inserting into the target table with the FORALL statement.

  • SQL Error: ORA-29902: error in executing ODCIIndexStart() routine

    I am running a SDO_RELATE operation on 2 geometries from 2 different tables. Spatial indexes are already created and the tables are also versioned.
    Below is the spatial meta data for both the geometries in user_sdo_geom_metadata table:
    DIMINFO is :
    MDSYS.SDO_DIM_ELEMENT(MDSYS.SDO_DIM_ELEMENT(Easting,0,700000,0.001),MDSYS.SDO_DIM_ELEMENT(Northing,0,1300000,0.001),MDSYS.SDO_DIM_ELEMENT(Height,-100,2000,0.001))
    SRID is 27700
    When I use SDO_RELATE or ADO_ANYINTERACT on both the geometires, i am getting the below error.
    Error report:
    SQL Error: ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13243: specified operator is not supported for 3- or higher-dimensional R-tree
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 333
    29902. 00000 - "error in executing ODCIIndexStart() routine"
    *Cause:    The execution of ODCIIndexStart routine caused an error.
    *Action:   Examine the error messages produced by the indextype code and
    take appropriate action.
    Could you please let me know what should be the root cause for this issue?

    Hi
    Have you checked this posting?
    Re: ORA-13243
    Luc

  • Backup via Cron job - SQL ERROR: ORA-01031: insufficient privileges

    Hi,
    We are Using Oracle RAC - linux - SAP EP . We have scheduled online backup through crontab .
    Always we are getting below error when the backup job runs via crontab
    ================
    BR0278E Command output of '/usr/sap/EP1/SYS/exe/run/brtools -f printcmd -U /oracle/EP1/sapbackup/.begpjvay.003 'archive log list;' 'exit;' | /oracle/EP1/102_6
    4/bin/sqlplus /nolog':
    SQL*Plus: Release 10.2.0.5.0
    Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
    SQL> ERROR:
    ORA-01031: insufficient privileges
    SQL> ORA-01012: not logged on
    SQL>
    BR0280I BRBACKUP time stamp: 2011-08-22 02.00.12
    BR0279E Return code from '/usr/sap/EP1/SYS/exe/run/brtools -f printcmd -U /oracle/EP1/sapbackup/.begpjvay.003 'archive log list;' 'exit;' | /oracle/EP1/102_64
    /bin/sqlplus /nolog': 0
    BR0302E SQLPLUS call for database instance EP12 failed
    =====================
    whereas if i trigger the same commend
    brbackup -u / -c force -t online -m all -p <init*.sap> manually it end successfully.
    Kindly can anyone help over below issue.
    Regards,
    Ayyappan

    Hi Ayyappan,
    Thanks in Advance,
    We are also having same scenario with RAC and Linux, we are trying to configure backup and getting the same error could you please guide me how u resolved the issue, please help....
    Regards,
    Sumeesh

Maybe you are looking for

  • Resetting a game?

    I am creating a game where the challange is to collect all the coins while avoiding obsticules and before the times runs out. What I am trying to do is when the game runs out of time or the player has died, The player simply presses the R key on thei

  • I still can't get my child document to update from template.  What gives?

    Hello, Here is the document I'm trying to update: http://www.peterdanko.com/Eco-Eden.html Here is my template: http://peterdanko.com/Templates/ Here is my stylesheet that is attached to the template: http://peterdanko.com/productpagecode.css What I w

  • How to load different certificates in a keystore for mail sender adapter

    Hi, we are getting mails from different partners. Some have digital signatures others not. Now we wanna verify the mails with digital signatures. My problem is, that we have to enter the "keystore" and the "keystore entry" in the sender agreement - b

  • After downloading yosemite, can't import photos from camera to iPhoto

    After downloading Yosemite  10.10.1 to my Macbook Air, I can't import photos from camera to iPhoto. Had no problem before. It recognizes camera and says loading, but it never does load photos.

  • Flash mx in forms help

    Hi to all using form6i and run in client server can anyone here knows the step on how to put flash mx in forms..Please teach and help me... tnx