How to convert Access query to Oracle?

I am trying to convert this query into an Oracle 8i query: -
SELECT *
FROM EMPLOYEE
LEFT JOIN ATTENDANCE ON EMPLOYEE.EMPID = ATTENDANCE.EMPID
WHERE ATTENDANCE.COL1="#"
AND ATTENDANCE.COL2>=#1/1/2007#
AND ATTENDANCE.COL2<Now()
GROUP BY EMPLOYEE.EMPID, EMPLOYEE.EMPNO;
How do I put the above query in plain Oracle join operator (+) notation? Thanks for the help.

Hi,
Let us take a look at the solution you had suggested -
EMPLOYEE.EMPID = ATTENDANCE.EMPID (+)
AND ATTENDANCE.COL1="#"
AND ATTENDANCE.COL2 >= TO_DATE ('1/1/2007','dd/mm/yyyy')
AND ATTENDANCE.COL2< SYSDATE;
Since we are outer joining ATTENDANCE but not using the (+) operator in the later filter conditions; it will still be a normal join i.e. it will not outer join on ATTENDANCE. That is my question.

Similar Messages

  • How to convert sql query to oracle query?

    Hi all,
    Hope doing well,
    sir i am using oracle database where i am running my sql query in oracle. but this query is not working properly. i used sql developer translation scratch editor to convert that.
    it's converted but i am not getting the exact value.
    which i was getting in sql server.
    here is my query below:
    SELECT C.*,ISNULL(P.Comp_Name,'') + ' (' + ISNULL(P.Comp_ID,'') + ')' Parent FROM Comp_Master C LEFT JOIN Comp_Master P ON C.Parent_ID = P.Comp_ID Where C.Comp_ID='C02'
    please convert it into oracle so that i can use this query
    thanks in advance.

    Try --
    1. Use NVL instead of isNull
    2. Use *||* instead of +*
    /* Formatted on 9-13-2012 4:39:09 PM (QP5 v5.163.1008.3004) */
    SELECT c.*, NVL (p.comp_name, '') || ' (' || NVL (p.comp_id, '') || ')' parent
        FROM comp_master c LEFT JOIN comp_master p ON c.parent_id = p.comp_id
    WHERE c.comp_id = 'C02'
    PS - Do remember to mark the solutions as Helpful or Correct. Thanks for understanding.

  • Access Query to Oracle Query conversion

    I am converting an Access database to Oracle 8.1.6.
    There are lot of reports in Access. HOw can I convert the Access
    query to Oracle equivalent query??? Is there any tool available
    for conversion???

    FYI,
    Microsoft Access is using ANSI SQL. And Oracle has introduced ANSI SQL from Oracle 9i so, it is also in 10g.
    Oracle 10g does not stop backward compatibilty so, It is depends on person. And I am not forcing you to migrate query from ACCESS to Oracle. I have simply answer the question which you have asked. Whether you want to perform efficiently or not it's your choice.
    But one thing is sure, ORACLE (9i or 10g) provides ANSI SQL and MS ACCESS is using ANSI sql so, this task is feasible. No doubt about it.

  • MS Access Query to Oracle

    Hi Gurus
    I am trying to convert a MS Access query to Oracle query, Having some trouble Need some help Please.
    This is the MS Access Query:
    Sum(IIf(LOAD1!ARRIVDATE<+Date()+7,LOADLINE1!QTY,0)/ITEM1!UOM) AS Loadtbl
    What would be the Oracle Query???
    Thank you

    Hello,
    well, the problem is the name of the column, ARRIVDATE< - while MS Access allows the "<" inside a column name, Oracle doesn't if you don't be careful. Please see this:
    SQL> create table testtab1 (arrivdate varchar2(100));
    Table created.
    SQL> desc testtab1
    Name Null? Type
    ARRIVDATE VARCHAR2(100)
    SQL> create table testtab2 (arrivdate< varchar2(100));
    create table testtab2 (arrivdate< varchar2(100))
    ERROR at line 1:
    ORA-00902: invalid datatype
    But this works:
    SQL> create table testtab2("ARRIVDATE<" varchar2(100));
    Table created.
    SQL> desc testtab2
    Name Null? Type
    ARRIVDATE< VARCHAR2(100)
    So your query might work if you put ARRIVDATE< in double quotes:
    Sum(DECODE(LOAD1."ARRIVDATE<"+SYSDATE+7,LOADLINE1.QTY,0)/ITEM1.UOM) AS Loadtbl
    Regards
    Wolfgang
    Edited by: wkobargs on Aug 8, 2012 7:51 AM
    Edited by: wkobargs on Aug 8, 2012 7:59 AM
    Edited by: wkobargs on Aug 8, 2012 8:00 AM

  • How to convert a dedicated running oracle server to a shared server

    i need help as to how to convert a dedicated running oracle server to a shared server.(step by step plz i am fairly a fresh person)
    there are presently 10 users but have to configure for 125 users accessing from 5 locations.
    also need how to implement connection manager

    125 users are not so much, unless your database server is a quite small one. Anyway, you have to configure Dispatchers and Shared Servers. See Configuring Oracle Database for Shared Server
    About Connection Manager see Configuring and Administering Oracle Connection Manager

  • How to connect access database through oracle sql prompt

    i want to connect access database via oracle , i am trying to import all the data in Access table into oracle table how it is possible .
    A.R

    The simplest way, if You have already created tables in Oracle DB, is to open the Access MDB, link Oracle tables via ODBC and build a query to append rows reading from Access tables to Oracle tables.
    Hope this helps
    Max

  • Access Query to Oracle View Tool

    We have a Access Database which creates forms and reports. It has lots of queries. we want the similar funtionalities in Oracle. Is there any tool that will convert these access queries to Oracle views. I used Migration workbench to convert the database but it can't convert the query.

    FYI,
    Microsoft Access is using ANSI SQL. And Oracle has introduced ANSI SQL from Oracle 9i so, it is also in 10g.
    Oracle 10g does not stop backward compatibilty so, It is depends on person. And I am not forcing you to migrate query from ACCESS to Oracle. I have simply answer the question which you have asked. Whether you want to perform efficiently or not it's your choice.
    But one thing is sure, ORACLE (9i or 10g) provides ANSI SQL and MS ACCESS is using ANSI sql so, this task is feasible. No doubt about it.

  • Help needed in changing Access query to Oracle query

    hello folks,
    I have already posted this question and got some help previously but i have additional query being added to the previous one so thought of seeking some help.here it goes
    Am having an access report which comes from a query. the current query behind the report is a consolidated one and comes from quite a few tables . My requirement is to develop a crystal report( which comes with a native oracle db driver) which should look same as the access report. But am unable to use the access query becoz of its format or something. So anyone please throw some light on this. Any help would be kindly appreciated.
    SELECT Debtor . EVENT_ID,
    Debtor . MEDCAP#,
    Debtor . Client Name,
    Debtor . CLIENT,
    Debtor . Provider ID,
    Debtor . GROUPNUMBER,
    "OPEN" AS Status,
    (IIf(clip_file = "Y", "Clip", "Open")) AS clipStatus,
    IIf(collect_only = "Y", "Collection Only", "Regular Collections") AS Collect ?,
    IIf(IsNull(Principal), 0, principal,
    IIf(IsNull(PAR_FLAG), "N", IIf(PAR_FLAG <> "N", "P", PAR_FLAG)) AS PAR_NPAR_FLAG,
    Right(PatientMemberID, 2) AS Patient Suffix
    FROM Period, Debtor
    INNER JOIN LOB_subtypes ON Debtor . SUBTYPE = LOB_subtypes . SUBTYPE
    WHERE (((Debtor . CLIENT) = "CV1") And ((Period . PeriodName) Is Not Null) And
    ((Debtor . STATUS) = "OPEN") And ((LOB_subtypes . LOB) = "PBA"));
    Thanks

    The expression...
    IIf(IsNull(Principal), 0, principal) - IIf(IsNull(PRORATED_TRANAMT), 0, prorated_tranamt)...is equivalent to...
    NVL(PRINCIPAL, 0) - NVL(PRORATED_TRANAMT, 0)Does that answer your question?
    As for...
    IIf(IsNull(PAR_FLAG), "N", IIf(PAR_FLAG&lt;&gt;"N", "P", PAR_FLAG))...you might try...
    CASE
        WHEN PAR_FLAG IS NULL THEN 'N'
        WHEN PAR_FLAG != 'N' THEN 'P'
        ELSE 'N'
    END

  • How to run simple query on oracle 11.2.0 ?

    hi
    i installed oracle 11.2.0 64bit on my Windows-7 64bit
    how i can connect and run any query on oracle ?
    what are the default tools that came with the installation and how to use it ?
    i sow in the forum that people write
    sql> select * from myTable ........
    how to get to this ?
    thanks in advance

    user1036207 wrote:
    hi
    i installed oracle 11.2.0 64bit on my Windows-7 64bit
    how i can connect and run any query on oracle ?
    what are the default tools that came with the installation and how to use it ?
    i sow in the forum that people write
    sql> select * from myTable ........
    how to get to this ?
    Open a command prompt and type
    sqlplus sys/syspwd@instance as sysdbaand you'll have yourself a sqlprompt.
    HTH
    //Johan

  • How to convert mongodb data  to oracle

    The requirement is I need to convert the mongodb or JSON data which is provided to us in Oracle format
    so that it can be used in Oracle Data Integrator ODI
    Edited by: 918554 on Aug 9, 2012 10:37 PM
    Edited by: 918554 on Aug 9, 2012 11:02 PM
    Kindly reply soon its urgent
    Edited by: 918554 on Aug 9, 2012 11:03 PM

    918554 wrote:
    how to convert mongodb data to oracleThis is NOT an Oracle problem or solution.
    http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart

  • How to convert MDX query to SQL

    Hi everyone,
    can you please suggest me, how to convert the below mdx query to sql query. can you please tell me what it is doing?
    CREATE MEMBER CURRENTCUBE.[Measures].[calculation]
     AS IIF(([Measures].[Clear Call Count],[Trouble Code].[Is Battery].&[Battery T-Code],[Service Provider].[Is Towmark].&[Towmark],[Provider Technician].[Is Towmark].&[Towmark]) = 0, NULL,
    ([Measures].[ Total Shipped],[Service Provider].[Is Towmark].&[Towmark],[Provider Technician].[Is Towmark].&[Towmark])/
    ([Measures].[Clear Call Count],[Trouble Code].[Is Battery].&[Battery T-Code],[Service Provider].[Is Towmark].&[Towmark],[Provider Technician].[Is Towmark].&[Towmark])),
    FORMAT_STRING = "Percent",
    VISIBLE = 1 ,  ASSOCIATED_MEASURE_GROUP = 'Sale'; 
    Thanks
    Vishu

    Hi Vishu,
    As Olaf said, this is a calculated member which used in MDX script in your cube, we cannot execute it in SQL Server Management Studio directly. Here are some document about calculated members and MDX script for your reference.
    Defining Calculated Members
    MDX Scripting Fundamentals (Analysis Services)
    Regards,
    Charlie Liao
    TechNet Community Support

  • Converting this query to Oracle-Help

    New account as my old email address has changed so I had to create a new one. Sucks!
    Either way can I please get some help with converting the query below to oracle syntax not microsoft sql. Cheers
    select  eventtypeid as Payment_Type,
         sum(commission_amount) as commission_amount,
         startdate as commission_date
    from
    SELECT distinct
              PERIOD.STARTDATE,
              Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE,
    case when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('2573','185')
         then 'D'
         when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('1126','1055')
         then 'O'
         when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('789','4000','785','871','1028','743')
         then 'R'
    else Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE
    end as SDC,
              Master_Usage.GENERICATTRIBUTE2 AS Service_Id,
              Master_Usage.EVENTTYPEID,
              sum(Master_Usage.CONTRIBUTIONVALUE) AS Commission_Amount
    FROM              Master_Usage INNER JOIN PERIOD
                   ON Master_Usage.PERIODSEQ = PERIOD.PERIODSEQ
              INNER JOIN (select distinct
                        lastname,
                        super_distributor_code,
                        distributor_code,
                        participantid,
                        startperiod
                   from Dealer_Hierarchy_107_114
                   where startperiod in ('107','108','110','111','112','114')
                   AND NOT POSITIONTYPEID LIKE 'MI %'
                   and not super_distributor_code = 'null' or distributor_code = 'null') as dealer_hierarchy
                   ON Master_Usage.GENERICATTRIBUTE1 = dealer_hierarchy.PARTICIPANTID and dealer_hierarchy.startperiod in ('107','108','110','111','112','114')
    WHERE          
              (NOT Master_Usage.PRODUCTID = 'IDDV' OR Master_Usage.PRODUCTID IS NULL)
              AND Master_Usage.PERIODSEQ in ('107','108','110','111','112','114')
              and Dealer_Hierarchy.startperiod in ('107','108','110','111','112','114')
              and Master_Usage.NAME not like '%revenue%'
              and Master_Usage.name not like '%GST%'
    group by      PERIOD.STARTDATE,
              Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE,
              Master_Usage.GENERICATTRIBUTE2,
              Master_Usage.EVENTTYPEID
    ) as asf
    group by asf.EVENTTYPEID,
          startdate
    order by commission_amount desc

    please see the bold section,
    could that be the reason ??
    select eventtypeid as Payment_Type,
         sum(commission_amount) as commission_amount,
         startdate as commission_date
    from
    SELECT distinct
              PERIOD.STARTDATE,
              Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE,
    case when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('2573','185')
         then 'D'
    when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('1126','1055')
         then 'O'
    when Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE in ('789','4000','785','871','1028','743')
         then 'R'
    else Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE
    end as SDC,
              Master_Usage.GENERICATTRIBUTE2 AS Service_Id,
              Master_Usage.EVENTTYPEID,
              sum(Master_Usage.CONTRIBUTIONVALUE) AS Commission_Amount
    FROM      Master_Usage INNER JOIN PERIOD
                   ON Master_Usage.PERIODSEQ = PERIOD.PERIODSEQ
              INNER JOIN (select distinct
                        lastname,
                        super_distributor_code,
                        distributor_code,
                        participantid,
                        startperiod
                   from Dealer_Hierarchy_107_114
                   where startperiod in ('107','108','110','111','112','114')
                   AND NOT POSITIONTYPEID LIKE 'MI %'
                   and not (super_distributor_code = 'null' or distributor_code = 'null') as dealer_hierarchy
                   ON Master_Usage.GENERICATTRIBUTE1 = dealer_hierarchy.PARTICIPANTID and dealer_hierarchy.startperiod in ('107','108','110','111','112','114')
    WHERE      
              (NOT Master_Usage.PRODUCTID = 'IDDV' OR Master_Usage.PRODUCTID IS NULL)
              AND Master_Usage.PERIODSEQ in ('107','108','110','111','112','114')
              and Dealer_Hierarchy.startperiod in ('107','108','110','111','112','114')
              and Master_Usage.NAME not like '%revenue%'
              and Master_Usage.name not like '%GST%'
    group by      PERIOD.STARTDATE,
              Dealer_Hierarchy.SUPER_DISTRIBUTOR_CODE,
              Master_Usage.GENERICATTRIBUTE2,
              Master_Usage.EVENTTYPEID
    ) as asf
    group by asf.EVENTTYPEID,
         startdate
    order by commission_amount desc

  • Convert SQL Query to Oracle

    Hi All,
    I have two queries of SQL for creating table.
    Query1.
    CREATE TABLE [dbo].[DocumentType] (
    [DocType] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
    [SubCat] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
    ) ON [PRIMARY]
    GO
    ALTER TABLE [dbo].[DocumentType] ADD
    CONSTRAINT [PK_DocumentType] PRIMARY KEY CLUSTERED
    [DocType],
    [SubCat]) ON [PRIMARY]
    Query2.
    CREATE TABLE [dbo].[SBU] (
    [SBU] [varchar] (51) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
    ) ON [PRIMARY]
    GO
    ALTER TABLE [dbo].[SBU] ADD
    CONSTRAINT [PK_SBU] PRIMARY KEY CLUSTERED
    [SBU]
    ) ON [PRIMARY]
    What will be the Query in Oracle??
    Please suggest!!!
    Regards,
    Shah

    Hi,
    First of all you need to go to scheme in which you need to create those tables. Or you can do it from sys user by giving allias.
    I will explaing you by going to user account.
    open command prompt --> sqlplus --> userid@database_name enter-->password
    write below commands :-
    CREATE TABLE  DocumentType
    DocType varchar(20) NOT NULL ,
    SubCat varchar(20)  NOT NULL
    ALTER TABLE DocumentType ADD
    CONSTRAINT PK_DocumentType PRIMARY KEY on (DocType);And same for the second table.
    Enjoy.

  • How to convert my query to SQL Procedure

    Hi all,
    I am running an SQL Query in my page process to set few items on my page.
    begin
    declare
    l_vc_arr2 APEX_APPLICATION_GLOBAL.VC_ARR2;
    begin
    IF APEX_APPLICATION.G_F01.COUNT = 0 THEN
    RAISE_APPLICATION_ERROR(-20001, 'Please select a email template to edit!!!');
    END IF;
    IF APEX_APPLICATION.G_F01.COUNT > 1 THEN
    RAISE_APPLICATION_ERROR(-20001, 'Please select a single email template to edit at a time!!!');
    END IF;
    FOR i in 1..APEX_APPLICATION.G_F01.count
    LOOP
    l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE(APEX_APPLICATION.G_F01(i),'$');
    :P32_SUBJECT := l_vc_arr2(1);
    :P32_TYPE := l_vc_arr2(2);
    :P32_BODY := l_vc_arr2(3);
    END LOOP;
    end;
    end;
    It is running perfectly fine. Now i want to convert this query into custom procedure. I am writing follwing code to create SQL Procedure,
    create or replace
    procedure Edit_EmailTemplate as
    begin
    declare
    l_vc_arr2 APEX_APPLICATION_GLOBAL.VC_ARR2;
    begin
    IF APEX_APPLICATION.G_F01.COUNT = 0 THEN
    RAISE_APPLICATION_ERROR(-20001, 'Please select a email template to edit!!!');
    END IF;
    IF APEX_APPLICATION.G_F01.COUNT > 1 THEN
    RAISE_APPLICATION_ERROR(-20001, 'Please select a single email template to edit at a time!!!');
    END IF;
    FOR i in 1..APEX_APPLICATION.G_F01.count
    LOOP
    l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE(APEX_APPLICATION.G_F01(i),'$');
    v(P32_SUBJECT) := l_vc_arr2(1);
    v(P32_TYPE) := l_vc_arr2(2);
    v(P32_BODY) := l_vc_arr2(3);
    END LOOP;
    end;
    end;
    but it is not getting compiled. Do anyone know what the problem is???
    With Regards,
    Sunil Bhatia

    hey thanks,
    but my problem is not of creating,
    it has been created and i can see it in sql browser. but it is not getting compiled
    it is returning with the following error
    Compilation failed,line 18 (13:22:08)
    PLS-00306: wrong number or types of arguments in call to 'V'Compilation failed,line 18 (13:22:08)
    PL/SQL: Statement ignoredCompilation failed,line 19 (13:22:08)
    PLS-00306: wrong number or types of arguments in call to 'V'Compilation failed,line 19 (13:22:08)
    PL/SQL: Statement ignoredCompilation failed,line 20 (13:22:08)
    PLS-00306: wrong number or types of arguments in call to 'V'Compilation failed,line 20 (13:22:08)
    PL/SQL: Statement ignored
    my statement is
    create or replace
    procedure Edit_EmailTemplate as
    begin
    declare
    l_vc_arr2 APEX_APPLICATION_GLOBAL.VC_ARR2;
    begin
    IF APEX_APPLICATION.G_F01.COUNT = 0 THEN
    RAISE_APPLICATION_ERROR(-20001, 'Please select a email template to edit!!!');
    END IF;
    IF APEX_APPLICATION.G_F01.COUNT > 1 THEN
    RAISE_APPLICATION_ERROR(-20001, 'Please select a single email template to edit at a time!!!');
    END IF;
    FOR i in 1..APEX_APPLICATION.G_F01.count
    LOOP
    l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE(APEX_APPLICATION.G_F01(i),'$');
    v('P32_SUBJECT') := l_vc_arr2(1);
    v('P32_TYPE') := l_vc_arr2(2);
    v('P32_BODY') := l_vc_arr2(3);
    END LOOP;
    end;
    end;

  • Converting a MS Access Query to Oracle SQL

    Hi,
    We have a large number of MS Access (2000) queries (mostly select queries -Some containing sub queries-) that need to be converted to Oracle's syntax to be used on our intranet instead of the existing Access frontend.
    Do you know of a tool that can do this?
    We understand that conversion tools are not always reliable, but even if 75% of the queries are converted for us we can then focus on the ones that pose problems.
    Regards,
    Charles McGrotty

    Hi Charles,
    The next release of OMWB ( version 92017, due at the end of this year) will contain some support for Select and Action queries. In that version, we will load queries from the source MS Access database into the OMWB repository. Since the MS Access plugin for OMWB does not currently contain a parser, the query text will be commented out and surrounded in an Oracle View stub - this means that the queries can, at least, be migrated to Oracle and then manually converted by the migrator from within the Oracle database. Often, the body text for a select query exactly matches the syntax for an Oracle view, so the manual work required to convert the queries may be minimal. This will be the first step in migrating MS Access Queries that the OMWB provides.
    I hope this information is useful,
    Tom.

Maybe you are looking for

  • How to Create JAVA proxies in PI 7.1 using NWDS

    Hi PI SDNers, Please guide me on "how to create JAVA proxy in PI 7.1 using NWDS". I used to create java proxies from Integration build tools->generate Java Proxy in Pi 7.0/XI3.0; Please advise me. Thanks in Advance... Ravi Kanakam

  • DB start & Stop With Multiple Homes

    I have four instances on my box in total. Two instances(orcl & prod) run on a file system, One instance (+Asm) is ASM storage and the last instance(test) uses the asm storage. Following are the contents of my oratab file in /etc/oratab orcl:/u01/orac

  • Query of two Table

    Dear Expert, If I want to make queries for two tables, for example I want to make a query for the list or amount of invoices for a certain group of clients with same master records such as geographic location, then how can I make the queries which in

  • ESET Smart Security says there's a trojan in the plugin for Firefox

    I'm trying to install the Flash plug-in for Firefox and after being forced to use the dumb DLM, the DLM downloads the plugin and tries to install it but my ESET Smart Security  throws up a message: A variant of Win32//TrojanDropper.Agent.OVE trojan h

  • Calculate Previous 12 months in ASO

    Hello All, I need to create members in Period dimension based on last 12 months. Like below MemberA = Jan2013+Dec2012+Nov2012+....+Feb2012 MemberB= Dec2012++Nov2012+....+Feb2012+Jan2012 MemberC=Nov2012+....+Feb2012+Jan2012+Dec2011 etc... We have sepa