Oracle equivalent of SQLDMO (Microsoft)

Is there a library/dll/object that is COM complient that will allow one to do DML, etc.?
Or does Oracle have a linkable object for Microsoft C/C++, like Embedded SQL. I guess a better question is does the embedded SQL complie in Microsoft C (v. 6.0)?

A slight correction to odie's post. I think you want min not max to replicate the Access first function, but see below to be sure. So:
min(upper(trim(tre.dname))) keep (dense_rank first order by tre.gcusno) as dname_std
user10860953 wrote:How does one ignore null values?The min and max functions will ignore nulls automatically, so if there is a null value in tre.dname, it will not be be returned, unless all of the values are null. For example:
SQL> WITH t AS (
  2     SELECT 65 id, 'ABCD' col FROM dual UNION ALL
  3     SELECT 37, 'DEFG' FROM dual UNION ALL
  4     SELECT 65, 'DEFG' FROM dual UNION ALL
  5     SELECT 65, null FROM dual UNION ALL
  6     SELECT 70, null FROM dual UNION ALL
  7     SELECT 70, null FROM dual UNION ALL
  8     SELECT 37, 'ABC' from dual)
  9  SELECT id,
10         MIN(col) keep (DENSE_RANK FIRST ORDER BY id) min_dname_std,
11         MAX(col) keep (DENSE_RANK FIRST ORDER BY id) max_dname_std
12  FROM t
13  GROUP BY id;
        ID MIN_ MAX_
        37 ABC  DEFG
        65 ABCD DEFG
        70John

Similar Messages

  • What is the Oracle equivalent of the Microsoft Access FIRST function?

    Using: Oracle 10gR2 RAC on SUSE Linux 9 (10.2.0.3)
    In the process of converting a Microsoft Access database to Oracle, an Access query is using the FIRST function.
    What is the Oracle equivalent of the Microsoft Access FIRST function?
    In the attempt to convert, the Oracle FIRST_VALUE function was used. However, the same results was not achieved.
    Thanks,
    (BLL)
    Query:
    h2. ACCESS:
    SELECT
         TRE.GCUSNO,
         UCASE([DCUSNO]) AS DCUSNO_STD,
         *FIRST(UCASE([DNAME])) AS DNAME_STD*,
         *FIRST(UCASE([DADDR])) AS DADDR_STD*,
         *FIRST(UCASE([DCITY])) AS DCITY_STD*,
         TRE.DSTATE,
         FIRST(TRE.DZIP) AS DZIP,
         TRE.DREGN,
         TRE.DDIST,
         TRE.DSLSMN,
         TRE.DCHAIN,
         TRE.MARKET,
         TRE.MKTPGM,
         TRE.EUMKT
    FROM
         TRE
    GROUP BY
         TRE.GCUSNO,
         UCASE([DCUSNO]),
         TRE.DSTATE,
         TRE.DREGN,
         TRE.DDIST,
         TRE.DSLSMN,
         TRE.DCHAIN,
         TRE.MARKET,
         TRE.MKTPGM,
         TRE.EUMKT;
    h2. ORACLE:
    SELECT DISTINCT
    TRE.GCUSNO,
    UPPER(TRIM(TRE.DCUSNO)) AS DCUSNO_STD,
    UPPER(TRIM(TRE.DNAME)) AS DNAME_STD,
    UPPER(TRIM(TRE.DADDR)) AS DADDR_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DNAME)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DNAME_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DADDR)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DADDR_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DCITY)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DCITY_STD,
    TRE.DSTATE,
    TRE.DZIP,
    FIRST_VALUE(UPPER(TRIM(TRE.DZIP)) IGNORE NULLS) OVER (ORDER BY TRE.DZIP ASC) AS DZIP,
    TRE.DREGN,
    TRE.DDIST,
    TRE.DSLSMN,
    TRE.DCHAIN,
    TRE.MARKET,
    TRE.MKTPGM,
    TRE.EUMKT
    FROM CRM.TREUP100R TRE
    GROUP BY
    TRE.GCUSNO,
    UPPER(TRIM(TRE.DCUSNO)),
    TRE.DNAME,
    TRE.DADDR,
    TRE.DCITY,
    TRE.DSTATE,
    TRE.DZIP,
    TRE.DREGN,
    TRE.DDIST,
    TRE.DSLSMN,
    TRE.DCHAIN,
    TRE.MARKET,
    TRE.MKTPGM,
    TRE.EUMKT;

    A slight correction to odie's post. I think you want min not max to replicate the Access first function, but see below to be sure. So:
    min(upper(trim(tre.dname))) keep (dense_rank first order by tre.gcusno) as dname_std
    user10860953 wrote:How does one ignore null values?The min and max functions will ignore nulls automatically, so if there is a null value in tre.dname, it will not be be returned, unless all of the values are null. For example:
    SQL> WITH t AS (
      2     SELECT 65 id, 'ABCD' col FROM dual UNION ALL
      3     SELECT 37, 'DEFG' FROM dual UNION ALL
      4     SELECT 65, 'DEFG' FROM dual UNION ALL
      5     SELECT 65, null FROM dual UNION ALL
      6     SELECT 70, null FROM dual UNION ALL
      7     SELECT 70, null FROM dual UNION ALL
      8     SELECT 37, 'ABC' from dual)
      9  SELECT id,
    10         MIN(col) keep (DENSE_RANK FIRST ORDER BY id) min_dname_std,
    11         MAX(col) keep (DENSE_RANK FIRST ORDER BY id) max_dname_std
    12  FROM t
    13  GROUP BY id;
            ID MIN_ MAX_
            37 ABC  DEFG
            65 ABCD DEFG
            70John

  • Looking for the oracle equivalent of T-SQL 'SELECT TOP n'

    Hi,
    I'm looking for the Oracle equivalent of T-SQL 'SELECT TOP n'
    and can't find any. There is SAMPLE(n) function but it supposed
    to pick up random values and I'm not sure if it's possible to
    make it select top values. Please help 8-)
    Thanx

    Hi Marina.
    Oracle does not have a functionality like SQL Server for TOP
    selection. The ROWNUM option should be used with great care and
    you may get unreliable results.
    Try looking at Metalink
    Doc ID: 291065.999
    Doc ID: 267329.999
    - They discuss this issue, and solutions.

  • Oracle Equivalent to SQL Server Linked Servers

    I'm trying to make that jump over to Oracle. One of the things I am doing is replicating everything I do in MS SQL 2005 to Oracle 10g. In Microsoft, I pull data from AS/400 through a linked server. I'm having trouble finding anything on the web on this, but I think I'm using the wrong terms. So I have two questions.
    1. What do you called a linked server in the Oracle terminology?
    2. Is it possible to link to AS/400 through Oracle and ISeries Access?
    Thanks
    Adam

    For Oracle to Oracle links, look up 'database links'; for third party databases, look at 'Heteregenous services'.
    There are two varieties of heteregenous services - 'transparent gateways' which are paid options and the basic version which essentially uses ODBC.

  • Oracle equivalent of MySql commands and code.

    Hi,
    Does anyone know the Oracle equivalent of the following? I'm not a DBA and my DBA doesn't know MySQL. TIA
    Assign access rights: login as root user to mysql:
    mysql -uroot -pYourSecretPassword
    On some MySQL installations, the root user has no password, in that case drop
    the -p parameter.
    Then grant the necessary access rights using the following commands: (this will
    automatically create the users)
    GRANT ALL ON daisyrepository.* TO daisy@"%" IDENTIFIED BY "daisy";
    GRANT ALL ON daisyrepository.* TO daisy@localhost IDENTIFIED BY "daisy";
    (The localhost entries are necessary because otherwise the default access rights
    for anonymous users @localhost will take precedence.)
    and create the database using:
    CREATE DATABASE daisyrepository;
    jack

    GRANT ALL ON daisyrepository.* TO daisy@% IDENTIFIED
    BY "daisy";This means:
    GRANT ALL privileges
    ON all tables and views in schema 'daisyrepository'
    To user daisy from any host.
    There are several problems in translation to Oracle:
    1) Oracle has a few more privs than MySQL, in part because there are a few more object types. You need to be more restrictive than 'GRANT ALL';
    2) Oracle does not support wild cards or patterns grants against a schema's objects. You need to specify each object individually;
    3) Oracle users are database users, not host users, so daisy@% does not make any sense at all. You specify the database user name, or perhaps group users into roles and specify the role name.
    This is discussed in the SQL Reference manual, in the 'GRANT' chapter, for each version of the database. The docs are at http://docs.oracle.com
    Have fun :-p

  • Oracle equivalent of...

    What is the oracle equivalent of a sql datatype bigint as an IDENTITY column with identity seed 1 and identity increment 1. I am very new to oracle so I am using TOAD to create this table. So im just looking for a KEY field such as an ID field that just creates its own number every time data is entered into any column.
    Kind of like ACCESS's autonumber field. Where or what datatype in TOAD do I select for this and tell it that it should automatically create the next ID number.
    For example I insert 4 rows
    "Jon"
    "Bob"
    "Steve"
    "Mark"
    The result in the table should be:
    1 Jon
    2 Bob
    3 Steve
    4 Mark
    (the numbers are automatic)...If I delete steve then it becomes
    1 Jon
    2 Bob
    4 Mark
    (gaps are of course OK since this is just an identity column).
    Thanks,
    Jon
    PS: Is there a way toi change my oracle forum password ? I cant seem to find that either.

    You can use a sequence and insert it in a trigger :
    TEST@db102 SQL> create sequence test_seq nocache;
    Sequence created.
    TEST@db102 SQL> create table test(c1 number not null , c2 varchar2(50));
    Table created.
    TEST@db102 SQL> create or replace trigger test_trig
      2  before insert on test
      3  for each row
      4  begin
      5     select test_seq.nextval into :new.c1 from dual;
      6* end;
    TEST@db102 SQL> /
    Trigger created.
    TEST@db102 SQL> insert into test(c2) values('Jon');
    1 row created.
    TEST@db102 SQL> insert into test(c2) values('Bob');
    1 row created.
    TEST@db102 SQL> insert into test(c2) values('Steve');
    1 row created.
    TEST@db102 SQL> insert into test(c2) values('Mark');
    1 row created.
    TEST@db102 SQL> select * from test;
            C1 C2
             1 Jon
             2 Bob
             3 Steve
             4 Mark
    TEST@db102 SQL>                                                      

  • Oracle equivalent of SQL - URGENT

    UPDATE tblA A INNER JOIN tblB B ON (A.TRAN_REF_NO = B.TRAN_REF_NO) AND (A.LINE_TYPE = B.LINE_TYPE) SET A.FLAG = 'U'
    WHERE B.UPDT_ACT_CD='I'. This SQL works fine in SQL Server.
    I need an Oracle equivalent of the above SQL that will work with 9i. It's very urgent, I tried some syntax and everything was hit with error.

    Hi,
    UPDATE PRE_STG_FIF_GL_CROSS_REF A INNER JOIN STG_FIF_GL_CROSS_REF B ON (A.TRAN_REF_NO = B.TRAN_REF_NO) AND (A.LINE_TYPE = B.LINE_TYPE) AND (A.COST_RETAIL_FLAG = B.COST_RETAIL_FLAG) AND (A.TRAN_CODE = B.TRAN_CODE) AND (A.LOCATION = A.LOCATION) AND (A.SUBCLASS = B.SUBCLASS) AND (A.CLASS = B.CLASS) AND (A.DEPT = B.DEPT)
    SET B.DR_CCID = A.DR_CCID, B.DR_SEQUENCE1 = A.DR_SEQ1, B.DR_SEQUENCE2 = A.DR_SEQ2, B.DR_SEQUENCE3 = A.DR_SEQ3, B.DR_SEQUENCE4 = A.DR_SEQ4, B.DR_SEQUENCE5 = A.DR_SEQ5, B.DR_SEQUENCE6 = A.DR_SEQ6, B.DR_SEQUENCE7 = A.DR_SEQ7,B.CR_CCID = A.CR_CCID, B.CR_SEQUENCE2 = A.CR_SEQ2, B.CR_SEQUENCE3 = A.CR_SEQ3, B.CR_SEQUENCE4 = A.CR_SEQ4, B.CR_SEQUENCE5 = A.CR_SEQ5, B.CR_SEQUENCE6 = A.CR_SEQ6, B.CR_SEQUENCE7 = A.CR_SEQ7, B.LST_UPDT_ID = A.Userid, B.LST_UPDT_DTTM = A.Date_Time
    WHERE ((B.UPDT_ACT_CD)='I' Or (B.UPDT_ACT_CD)='U')
    I migrated the above access query to below oracle query and it gives me an error.
    UPDATE STG_FIF_GL_CROSS_REF c
    SET
    DR_CCID,
    DR_SEQUENCE1, DR_SEQUENCE2, DR_SEQUENCE3, DR_SEQUENCE4, DR_SEQUENCE5, DR_SEQUENCE6, DR_SEQUENCE7,
    CR_CCID,
    CR_SEQUENCE1, CR_SEQUENCE2, CR_SEQUENCE3, CR_SEQUENCE4, CR_SEQUENCE5, CR_SEQUENCE6, CR_SEQUENCE7,
    LST_UPDT_ID,LST_UPDT_DTTM
    ) =
    SELECT A.DR_CCID,
    A.DR_SEQ1,A.DR_SEQ2,A.DR_SEQ3,A.DR_SEQ4,A.DR_SEQ5, A.DR_SEQ6,A.DR_SEQ7,
    A.CR_CCID,
    A.CR_SEQ1,A.CR_SEQ2,A.CR_SEQ3,A.CR_SEQ4,A.CR_SEQ5, A.CR_SEQ6,A.CR_SEQ7,
    A.USERID,A.DATE_TIME
    FROM xrfsys.PRE_STG_FIF_GL_CROSS_REF A,STG_FIF_GL_CROSS_REF B WHERE
    B.TRAN_REF_NO = A.TRAN_REF_NO AND
    B.LINE_TYPE = A.LINE_TYPE AND
    B.TRAN_CODE = A.TRAN_CODE AND
    B.LOCATION = A.LOCATION AND
    B.SUBCLASS = A.SUBCLASS AND
    B.CLASS = A.CLASS AND
    B.DEPT = A.DEPT AND
    B.COST_RETAIL_FLAG = A.COST_RETAIL_FLAG)
    WHERE (c.UPDT_ACT_CD='I' Or c.UPDT_ACT_CD='U')
    It throws,ORA-01427: single-row subquery returns more than one row. Please help me to convert this access query to oracle equivalent. The sub query returns multiple records. There are 7 unique records between the two tables and they are returned as output of sub query.

  • Oracle equivalent of SQL IDENTITY Column

    Is there an Oracle equivalent of the MS SQL and Sybase IDENTITY column that creates an automatically incrementing number for each row added?
    Thanks in advance.
    Andy Llewellyn
    [email protected]

    Oracle has what's called a sequence but it's not actually a column in a table. It's a database object that generates
    a sequential number. Here's a simple example of how it works. You can look in the manual for more information.
    SQL> create sequence tt start with 1 nocache;
    Sequence created.
    SQL> create table test(c1 varchar2(1),c2 number);
    Table created.
    SQL> insert into test values('A',tt.nextval);
    1 row created.
    SQL> /
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from test;
    C C2
    A 1
    A 2

  • How do i install oracle plug-in for microsoft IIS ??

    how do i install oracle plug-in for microsoft IIS ??

    I'm not sure what is that plug-in that you talk about.
    If you mean the mechanisms that allows IIS to be the entry point to Oracle9iAS then you should probably ask this in the iAS discussion forum. or look for it in the online documentation on OTN.

  • Oracle equivalent of DECRYPT_CHAR() in DB2

    Dear All,
    We are working in a migration project. We are migrating ODI interfaces from DB2 to Oracle.
    The function DECRYPT_CHAR() is used in one of the procedure script. I could not able to find oracle equivalent of DECRYPT_CHAR() function.
    Could you anyone please provide any pointers on this.
    Thanks a lot in advance.

    Hi,
    As per my experience, there is NO direct function reside for this in Oracle, rather it has inbuild packages to do decryption and encryption but still you need to create a user defined function in your schema.
    Thanks,
    Guru

  • How to make data base link from oracle 11g r2 to microsoft sql 2008 express

    I need to make data base link from oracle 11g r2 to microsoft sql 2008 express to make replication between then
    please help me !
    I didn't know what is the user and password in the command which create database link

    To replicate data you can ude Database Gateway for ODBC or Database Gatewy for MS SQl Server. Please use the search engine of this forum if you ant to get more details about each product.
    Some SQl Servers are set up to use Windows authentication only. In this case you won't be able to connect to the SQL Server as Windows authentication isn't supported with the gateways. You have to make sure your SQL server is supporting username and password authentication - a common user is the "sa" user. Regarding the username/password, please get in touch with your SQL Server Admin.

  • Oracle Equivalent user

    Hi,
    OS: IBM-AIX
    Oracle: Oracle10g 10.2.0.3.0
    I created Oracle user with relavent groups. With logging in as oracle user, I can perform DBA activities.
    My senario is that, I have to create oracle equivalent user say (neworacle). So I have created neworacle user in unix and assigned Oinstall and dba groups.
    I try to login as 'neworacle' user and try to take export of a schema.
    I get the following error
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    ORA-31626: job does not exist
    ORA-31633: unable to create master table "USR.SYS_EXPORT_SCHEMA_05"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.KUPV$FT", line 863
    ORA-01116: error in opening database file 5
    ORA-01110: data file 5: '/oracle/oradata10g/unbdb/DXML01.dbf'
    ORA-27092: size of file exceeds file size limit of the process
    Additional information: 131071
    Additional information: 944529
    Are this errors cause due to exporting dump through a new user 'neworacle'?
    Is it possible to perform oralce activities using 'neworacle'?
    Thanks in advance
    KSG
    Edited by: KSG on Dec 3, 2009 11:57 AM

    KSG wrote:
    Issue solved.
    I gave datafile access permission to the neworacle user
    and ulimit to unlimited
    Why did you need to give access to datafile 5 to the new user? In fact to change my question to a statement. You should not have had any need to give access to the datafiles to any users.The oracle account should own them and that manages all access to them.
    John
    www.jhdba.wordpress.com

  • Oracle equivalent for OBJECTPROPERTY

    Hi Friends,
    I want the oracle equivalent for the following sql code,
    Select @Command = 'IF OBJECTPROPERTY(object_id('''+ @TableName + '''), ''TableHasForeignRef'') = 1
                              DELETE FROM ' + @TableName + '
                          ELSE
                              TRUNCATE TABLE ' + @TableName
    EXEC sp_MSForEachTable @CommandI have tried to find out, but no use. Please help me.
    Thanks,
    Ram.

    Ram wrote:
    I have tested a table which has foreign key. But the count returned from the query is 0.
    Have I implemented your query in the right way?Same like in SQL Server, Oracle does not allow truncating table if it has a PK or UK which is referenced by FK. There are no issues truncating table with FK. Again, it is table with PK/UK where you might not be able to truncate if that PK/UK is referenced by FK. And SQL Server property TableHasForeignRef = TRUE means there is a FK (on a different table or maybe even on same table if it is self-referencing FK) which is referencing PK/UK on a table in question. Query I suggested returns 1 if table has a PK or UK which is referenced by FK. Otherwise it returns 0. So if, in your case, table MY_TABLE owned by user DBO_XYZ has just FK, 0 is correct and you can truncate it. If it would return 1, you would not be able to truncate and would have to delete.
    SY.

  • Oracle version of the Microsoft Application Blocks for Data Access

    Where can I find an Oracle version of the Microsoft Application Blocks for Data Access? Is it tied to any specific version of the Oracle Client software? I currently have version 8.1.7.3 installed.

    I think that DAAB 3.0 only has support for ODBC and OLEDB, which indeed can be used for Oracle. The Nile 3.0 program has an OracleHelper file, but this one uses the Microsoft Dataprovider for Oracle RDBMS. With some minor changes you can make this version work with the ODP.NET that Oracle provides.
    The issue I'm trying to convey is, that it seems hard to use the Microsoft Application Blocks using ODP.NET. As I described earlier, the LOBs and REF Cursors are reference types that actually point to data in the Database. This means, that the Connection to the database must be open to get to the Data.
    In the DataHelper, you open the Connection and get the data you need. The DataHelper should then clean up and close the Connection. Then you pass the data to the caller. However, since we're dealing with Reference types, a closed connection means no data.
    So I guess the only way to make this easy to use and not having to assume the caller/developer will open and close connections, you must copy the data in an instance of a DataSet, before you close the connection and then pass the Dataset back to the caller.
    I wonder if people have delt with this issue and what their solution looks like.
    thnx

  • Oracle equivalent of SQL DTS package

    In process of migrating SQL database to Oracle database what is Oracle equivalent of SQL DTS package???

    Data transformation services are something totally different, that have nothing to do with migration process. Can you please be more specific with your question? If you really want an answer, then you can consider the conversion phase....
    But, again, there is no reason to compare these two.
    If you want you can read about Oracle's data warehouse concepts, probably ETL is the true answer to your question

Maybe you are looking for