ANSI Standard Query

HI Anyone can help me to have the correct ANSI Standard Query for the following
SELECT * FROM AFFILIATED_PERSON ap WHERE EXISTS (
SELECT 'x' FROM VB_HOUSEHOLD_MEMBERSHIP VBHM, VE_HOUSEHOLD_ORG_AFFIL VEHOAF
WHERE VEHOAF.family_household_id = vbhm.family_household_id
AND vehoaf.primary_type= 'ASGNLOCCAR'
AND vbhm.affiliated_person_id = ap.AFFILIATED_PERSON_ID )
AND EXISTS (
SELECT 'x' FROM VB_PERSON_ORG_ASSIGNMENT vbpoas, VB_PERSON_ORG_AFFILIATION vbpoaf
WHERE vbpoas.person_org_affil_id = vbpoaf.person_org_affil_id
AND vbpoaf.affiliated_person_id = ap.AFFILIATED_PERSON_ID)
ORDER BY ap.AFFILIATED_PERSON_ID
Thanks in advance
nattu

hey,
a. to me it seeems o.k.
b. trust no one :)
c. you can use: (from 10g sql reference)
FLAGGER
Syntax:
FLAGGER = { ENTRY | INTERMEDIATE | FULL | OFF }
The FLAGGER parameter specifies FIPS flagging, which causes an error message to be
generated when a SQL statement issued is an extension of ANSI SQL92. FLAGGER is a
session parameter only, not an initialization parameter.
In Oracle Database, there is currently no difference between entry, intermediate, or full
level flagging. After flagging is set in a session, a subsequent ALTER SESSION SET
FLAGGER statement will work, but generates the message, ORA-00097. This allows
FIPS flagging to be altered without disconnecting the session. OFF turns off flagging.
e.g.
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> alter session set flagger=full;
Session altered.
SQL> select * from dual where dummy ='X';
select * from dual where dummy ='X'
ERROR at line 1:
ORA-00097: use of Oracle SQL feature not in SQL92 Full Level
ORA-06550: line 2, column 32:
PLS-01454: No operator may be used with values of data type CHAR
SQL> alter session set flagger=off;
ERROR:
ORA-00097: use of Oracle SQL feature not in SQL92 Full Level
Session altered.
SQL> select * from dual where dummy ='X';
D
X
SQL>
Amiel Davis
Message was edited by:
Amiel D.

Similar Messages

  • ANSI Standard decode to CASE

    Hi all,
    select
    id
    ,one
    ,two
    From
         (select id
         , one
         , two
         , Max(decode(TYPE, "ER", 3*4, 4*7)
         from
              (select id
              , sum(one) as one
              , sum(two) as two
              from t1
              group by id)
         group by id, one, two
         ) temp inner join t2....
    The above query is just a sample structure to tell the problem that i am facing. It works fine, but i need to convert it to ANSI Standard.
    Hence I need to convert the DECODE to CASE statement. but if i convert to CASE, i need to use any of the GROUP BY FUNCTIONS, but if i use the MAX of any group by functions, the result would be wrong...how to overcome it
    Thanks

    Hi,
    Yes I did a silly mistake, the code I gave was for only the decode but when I converted it to case statement, there was a silly mistake, which i corrected.
    Now i corrected it to
    Select
         COL1
         , Col2
         , MAX(CASE WHEN Upper(TYPE) = 'YR' THEN Round(3.43*3, 2) END) AS CALC1
         , Max(CASE WHEN Upper(TYPE) = 'ZP' THEN Round(3.12*12, 2) END) AS CALC2
    From
         Group by....
    but now when i add a sum of the calc1 & calc2, I am not getting any results the column is blank. Is there anything that i missed
    Select
         COL1
         , Col2
         , MAX(CASE WHEN Upper(TYPE) = 'YR' THEN Round(3.43*3, 2) END) AS CALC1
         , Max(CASE WHEN Upper(TYPE) = 'ZP' THEN Round(3.12*12, 2) END) AS CALC2
         , (MAX(CASE WHEN Upper(TYPE) = 'YR' THEN Round(3.43*3, 2) END
         + Max(CASE WHEN Upper(TYPE) = 'ZP' THEN Round(3.12*12, 2) END)) as SUM3
    From
         Group by....
    Thanks

  • Can we duplicate standard query Search Master Agreements and Agreements.

    Hi Experts,
    I have a requirement to hide Agreement Manager and Business Unit & Region result fields in standard Search Master Agreements and Agreements query.
    I have duplicated this standard query and deleted Agreement Manager and Business Unit & Region result fields. Try to run this query but it is giving error.
    Execution Type is Java.
    Query Executor Class: com.sap.eso.contracts.query.SearchAllMAandAgreements
    Error:  SQL Exception: Fail to convert to internal representation, ANSI-92 SQL State: 99999, Vendor Error Code: 17059. Fail to convert to internal
              representation.
    Does anyone have idea about this functionality or how this standard query can be modified.
    Thanks,
    Lava

    Hi Lava,
    There is the Standard Query ODP-ESO-MasterAgreementList
    Duplicate the query and remove the fields from the Result fields whcih you dont want. I think you will get the result required.
    Thanks
    Kushagra A

  • How to change the standard query "Create a Master Agreement" by a custom one

    Hello Sourcing CLM experts,
    I would need to replace the standard query displayed when the user tries to create a Master Agreement by a custom query to filter the MA types according to some criteria:
    According to this post: Re: Create security profile for a document template in SAP Sourcing, I've tried to achieve it by doing the following steps:
    Create a new query as a copy of exsiting query FCI-ContractTypes
    Modify query group FCI-ContractTypesBP to include my custom query instead of the standard one to only list the MAType "Standard Master Agreement"
    Following you can see the change done into the query group FCI-ContractTypesBP:
    However, standard query has not been replaced and same set of MA Types are listed.
    Therefore, I would like to ask you:
    Is it possible to do this kind of modifications? If so, which query group need to be modified?
    If it is not possible, is there any other way to achieve that requirement?
    Thanks in advance for your time and support!
    Best regards,
    Isaac

    Hello again experts,
    If this query cannot be modified, is there any option to disable button below? Or at lease, to disable the query group to avoid the listing of MA Types when it is pressed?
    The reason is because we are going to set up the system in the way that only it will be possible to create Master Agreements from Template. However, if user keep on using that button he will be able to create MA from document types.
    Any ideas?
    Thanks again and best regards,
    Isaac

  • ANSI Standard Join with Nested Table

    Does anyone know how to (or whether you actually can) use ansi standard table joins with nested tables.
    Non-ansi standard would look something like this
    SELECT e.empno
    FROM departments d, TABLE(d.employees) e
    WHERE d.deptno = 10;
    Where d.employees is a nested table.
    But if I try ansi-standard I like such:
    SELECT e.empno
    FROM departments d
    JOIN TABLE(d.employees) e
    WHERE d.deptno = 10;
    I get
    ORA-00905: missing keyword
    because I have nothing to join it on.
    Your help is very much appreciated

    Both replies worked fine.
    I think I will go with the NATURAL JOIN as it seems the cleanest option.
    Thanks Guru 2748

  • For Container Freight payment can be downloaded through a standard query.

    for Container Freight payment can be downloaded through a standard query.
    Regards
    Mahesh

    hello, friend.
    are you using LE-Transportation?  if yes, there are some helpful t-codes such as VI11 and VI12.  you may also use t-code SQVI for queries, but you would have to know what tables to look for.
    hope this helped even if a bit.  reward, even a little if yes.
    thanks and regards.
    jty

  • How do I set date to ANSI standard format (YYMMDD) with the english language?

    Having difficulty with dates displayed in FireFox
    Microsoft desktop settings in Regional and Language options:
    YY MM DD (ANSI standard date format and Canadian Government standard (although dd mm yy and mm dd yy) are in common use)).
    Firefox setting: cannot find YY MM DD option, so used English/United Kingdom (DD MM YY) format
    An option for English language with ANSI date would be awesome.
    Is there a way to have Firefox display YY MM DD format without loosing English language?

    See if this helps: iPod: Changing the display language

  • Oracle - ANSI Standard

    I would like to know which ANSI standard does ORACLE follow?

    quoting wikipedia:
    SQL became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standards (ISO) in 1987. Since then, the standard has been enhanced several times with added features. However, issues of SQL code portability between major RDBMS products still exist due to lack of full compliance with, or different interpretations of, the standard. Among the reasons mentioned are the large size and incomplete specification of the standard, as well as vendor lock-in.
    I think you may be better off trying to write whatever it is you want to write and seeing if it works that way across databases.
    the thing is (and this goes for all databases): some things are more efficient written in the proprietary extensions to SQL than in ANSI SQL. Take recursive with clauses vs the connect by clause etc.
    edit:
    The other thing to be wary of is the potential for differing functionality depending on how you write your queries. for example even though the database supports ANSI joins, I encountered a bug whereby the result_cache functionality doesn't work when you use ANSI join syntax:
    result_cache on tables
    Edited by: WhiteHat on Jun 21, 2012 11:58 AM

  • "Expiring Agreements" Standard Query Issue

    Hi All,
    I m getting an issue regarding "Expiring Agreements" Standard Query.
    It should show all the master agreements and contracts.But if I have attached a subagreement to the masteragreement, then I m getting the following issue:
    1. Master agreement link is deactivated and subagreement link is activated.
    2. If subagreement link is not attached, then Master Agreement link is activated.
    Can any one help me in solving this issue.
    Any help will be appreciated.
    Thanks & Regards,
    Vignesh

    Hi Vignesh,
    The behavior you explained is the standard behavior for all out of the box MA related queries. If you would like to alter the behavior of the standard query, create a custom query by duplicating the standard one and modify the SQL.
    Regards,
    Vikram

  • Ansi standard join

    on toad for oracle it has a build in software for
    non-ANSI to ANSI
    this was the original query
    this new query would run forever, just by looking at the explain plan in toad,
    but what is wrong with it?

    looks like a bug in toad. cross joins create the cartesian product of the two joined tables wich is not what you want. the new query should rather be:
    SELECT p_item_master.item_master_id vid,
           des1,
           p_resv_type.resv_type_code,
           resv_type_desc,
           form_payment_req_yn
       FROM p_resv_type JOIN p_item_master on(P_ITEM_MASTER.ITEM_MASTER_ID=P_RESV_TYPE_ITEM.ITEM_MASTER_ID)
       JOIN p_resv_type_item  on ( P_RESV_TYPE.RESV_TYPE_CODE = P_RESV_TYPE_ITEM.RESV_TYPE_CODE
                  and P_RESV_TYPE_ITEM.PROPERTY_ID=TRIM(pvPropertyCode))
    WHERE p_resv_type_item.property_id = TRIM (pvpropertycode)
    ORDER BY des1
    maybe toad creates better results if you use alias names for your tables...
    bye
    TPD

  • BEX Standard Query

    Hi
    Initially when i transport the query for the first time from DEV, I need to create a BEX standard request. I created a bex standard request and transported. Now i want to transport few more queries.
    So now i need to create an other request in CTO. Here my doubt is do i need to assign the request to the PACKAGE or just create it.
    Regards
    Annie

    Hi,
    <i>As u said, when we transport the queries for the first time, we need not create a standard BeX request with truck icon.
    Did i get right?</i>
    Right, This is most used way.
    <i>And also you mean that when we make some changes to the queries that are already transported then we need to have BEX Standarad request. Am i right?</i>
    Right.
    <i>Now what i have done is..Collect all the queries in the in transoprt connection, clicked on BEX request (truck icon) and created a request. Now after collecting all the queries, i clicked on transoprt icon and saveed all the queries in the request.
    Is it the right way or will i get any problems later.</i>
    If those queries are getting tranport first time, have you checked whether the Query elements are collected in that request after saving them in in the request.
    Here generally we click on truck button and not  truck button with <i>BEx</i> label.
    With rgds,
    Anil Kumar Sharma. P

  • Standard Query Issue.

    Hi All,
    In Query Definition, for a query "Browse Product Category Tree view", when im trying to duplicate the query and save it then its throwing an error as :
    "The Java execution type is not allowed in a custom query."
    But we have a requirement to edit this query and on execution show the results directly instead of clicking on show button as the original query shows.
    in help.sap documentation they say "Query Executor Class" field in query is available for standard queries only.
    Can anyone throw some light on how to proceed for the requirement.
    Any help would be appreciated.!
    Thanks!

    Hi Vikram,
    We have a similar requirement now, where the query "Scorecard Report" is a java query, but we want to make changes in this query. We want to add new fields and remove few existing fields from it.
    Can u pls help us with this?.
    Thanks,
    Shikha

  • EDI , where to check is using EDIFACT or ANSI standard ?

    hi all SAP expert,
    I am new to EDI, where can i check whether my current system us using EDIFACT or ANSI or others protocol from SAP tcode ?
    Is it tcode WE20,  under the tab "EDI Standard" ?
    Rejoice !

    Hi,
    From SAP system, you doesn't know whether you are using either EDIFACT or ANSI format of the EDI message, unless and until you maintain that information in your SAP system as they are not mandatory information in SAP.
    You can goto WE20 transaction and double click on your message type and then goto EDI standard tab and you can find the details like EDI standard, Message type and version there.
    For SAP system, its least bothered about what type of edi messaging standards are used.
    Thanks,
    Mahesh.

  • MAP activate in the BEX/Standard query

    Hai,
       I want to make map in BEx report of one my query(based on activation of standard business content).
      As per rule I have one info object(0SOLD_TO) in QUERY for map.But map is not coming in my report. The geographical type is  dynamic geo-characteristics with values attribute.
    This is first time I am making map.
    I.e I want to make map for any one query.
    Any tips??? Thanks in advance.
    With Regards,
    Jaheer,Yanbu,Saudi arabia.

    Hi,
    The BEx Map is part of the Business Explorer. It is used for reporting on geo-relevant data.Check the link in below there you can find what you need exactly.
    BEx Map
    Regards,

  • Standard Query (Sq01) for Leave Details

    Hi Experts,
    I have created a query using SQ01 for Leave Details which includes all infotypes required viz. 2001, 2002 etc.
    When i use this query for any employee using any subtype/absence type, it works fine, but when i use it for a particular type i.e. On Duty, it do not brings any result although it has the data in the respected infotype. This absence type has been newly created by my functional consultant.
    Kindly let me know if there are any possible solutions for this. If yes, plz let me know the steps how to correct it.
    Prateek

    resolved.

Maybe you are looking for