Convert sql mysql to oracle

It is possible to obtain result in ORACLE with this one sql of MYSQL
SELECT DISTINCT EntidadID, NOMBRE, MATCH(NOMBRE, Acronimo) AGAINST ('text') As Score FROM oracle.DE_ENTIDAD WHERE MATCH(NOMBRE,
Acronimo) AGAINST ('text') ORDER BY Score DESC,NOMBRE
ASC
Sorry for my english

There's no MATCH or AGAINST keyword in Oracle, if you want to do a full text search you could use Oracle Text with the CONTAINS keyword. Here's a link to the documentation 10g2, since you didn't mention your oracle version):
http://download-uk.oracle.com/docs/cd/B19306_01/text.102/b14218/csql.htm#CCREF0104
C.

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.

  • Converting SQL SERVER  to Oracle

    Hey everyone,
    I have one thesis about database. I have a plan to making a program to convert database with sql server to Oracle Database. Anyone have made some programs that similar with mine ?? Anyone can give me some informations? Can you tell me about the concept??
    Thanks everyone....

    aDiny wrote:
    can you tell me the concept and example programs that able to do this job like that?
    1. Define data in source
    2. Define destination.
    3. Read data from source (based on 1)
    4. Map date to destination (based on 1 and 2)
    5. Write data to destination (based on 2)

  • How to get .ocp file when converting sql database to oracle database?

    Hi all,
    Hope doing well,
    sir i am using sql developer tool for migration from sql server to oracle
    i am using this offline but i don't know how to create .ocp file
    please help me.
    it's urgent
    waiting for reply.
    thanks in advance.

    The OCP files are created during OFFLINE Migration. In SQl Developer click on Tools -> Migration -> Create Database Capture Scripts. Choose an output directory, make sure to select the correct platform (Windows) and select MS SQl Server from the drop down list.
    You'll get in the directory specified earlier the batch and OCP files required to create the source model using the offline method.
    Have a look at this web site: http://www.oracle.com/technetwork/products/migration/sqlserver-095136.html
    It contains more info including a link to a video demonstrating the offline capture method.

  • Issue in converting sql query to oracle

    Hi Friends,
    I have a sql query as follows,
    Select Name From SysObjects Where XType = 'U' And Name = @NameI want to convert this to oracle. I have tried to convert this in someways. But I'm getting errors only. Please anyone help me to fix this issue.
    Thanks,
    Ram

    Most Oracle dictionary views come in DBA_, ALL_ and USER_ flavours. Probably you don't have privileges to view DBA_OBJECTS, in which case try ALL_OBJECTS or <a gref="http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2005.htm">USER_OBJECTS</a>.
    Based on what I read, you might need something like
    SELECT * FROM all_objects WHERE owner &lt;> 'SYS' AND object_type = 'TABLE'btw a sure way to wind up Oracle professionals is to use "SQL" to mean another DBMS product and not Structured Query Language. As you may have noticed, we have SQL over here as well.

  • Sql Developer wont convert Sql Server to Oracle lob w Oracle 11gr2 client

    I have the Sql Developer 2.1.1.64 loaded on a Windows machine accessing Oracle 11g release 2 database on a linux box with no jre. I have the latest version of java (1.6.0.21) and jdk (6 u 21). When I loaded Oracle 11g r2 client onto my windows box, all sql server tables could be moved to my Oracle repository except tables that converted from a Sql Server 2005 type of nvarchar(max) to nclob. I would just get every row in the error column during the move.
    Turns out when I uninstalled the Oracle 11g r2 client and installed the Oracle 11g r1 client, it worked.

    I'm afraid you're in the wrong forum. This is the Berkeley DB Java Edition forum.
    --mark                                                                                                                                                                                   

  • 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 SQL to PL/ORACLE

    Hi All,
    I have the MSSQL SQL statement as below:
    select column_name
    from information_schema.key_column_usage
    where constraint_name in ( select constraint_name
    from information_schema.table_constraints
    where table_name = 'cppuUTMSTATS' and constraint_type = 'PRIMARY KEY' )
    order by ordinal_position;
    I would like to have the equivalent PL statement for ORACLE.
    Please help.
    Thanks,
    JP

    The only possible problem I see is that you're trying
    to order with a non selected column, you need that
    the order by column is in the select to make it
    work.Really?
    SQL> select ename, job
      2  from emp
      3  order by empno
      4  ;
    ENAME      JOB
    SMITH      CLERK
    ALLEN      SALESMAN
    WARD       SALESMAN
    JONES      MANAGER
    MARTIN     SALESMAN
    BLAKE      MANAGER
    CLARK      MANAGER
    SCOTT      ANALYST
    KING       PRESIDENT
    TURNER     SALESMAN
    ADAMS      CLERK
    JAMES      CLERK
    FORD       ANALYST
    MILLER     CLERK
    14 rows selected.
    SQL>I don't have a problem with ordering by columns that aren't selected.

  • Convert sql/server to oracle

    I have a problem with left joint
    sql/server
    GTxtSQL = " select E.*, CodFamille, LibFamille, CodSFamille, LibSFamille, " _
    & " CodLocal, LibLocal, CodService, LibService, F.CodFourn, F1.CodFourn as CodFournSAV " _
    & " from tp_Index_1 IX, t_Equip E, t_Famille_E FE, t_ESFamille SFE, t_Service S, t_Local_E L, t_Fourn F, t_Fourn F1 " _
    & " where ClePerso=" & GClePerso & " and IX.cle1=E.CleEquip " _
    & " and E.CleFamille*=FE.CleFamille_E and E.CleSFamille*=SFE.CleESFamille" _
    & " and E.CleService*=S.CleService and E.CleLocal*=L.CleLocal_E " _
    & " and E.CleFourn*=F.CleFourn and E.CleFournSAV*=F1.CleFourn " _
    & " order by LibEquip "
    i can't have many left joint= (+) on one table?
    GTxtSQL = " select E.*, CodFamille, LibFamille, /*CodSFamille, LibSFamille, */" _
    & " CodLocal, LibLocal, CodService, LibService, F.CodFourn, F1.CodFourn as CodFournSAV " _
    & " from tp_Index_1 IX, t_Equip E, t_Famille_E FE,/* t_ESFamille SFE,*/ t_Service S, t_Local_E L, t_Fourn F, t_Fourn F1 " _
    & " where ClePerso=" & GClePerso & " and IX.cle1=E.CleEquip " _
    & " and E.CleFamille=FE.CleFamille_E /*and E.CleSFamille=SFE.CleESFamille*/" _
    & " and E.CleService=S.CleService and E.CleLocal=L.CleLocal_E " _
    & " and E.CleFourn=F.CleFourn and E.CleFournSAV(+)=F1.CleFourn " _
    & " order by LibEquip "
    thank's for your answer.

    I'm afraid you're in the wrong forum. This is the Berkeley DB Java Edition forum.
    --mark                                                                                                                                                                                   

  • Convert from mysql db to oracle

    hi all,
    i want to convert data from mysql database to oracle database.
    what kind of mechanism i want to use?
    if any mechanism like DTS in SQLserver is there to covert?

    Hi,
    We did mysql to oracle migration some time back and played with workbench tool and many other softwares available.
    However our experience was not so good with these tools, each tool had its own limitation and was not able to migrate 100% data. Even the speed of migration was too slow which would have violated our production SLAs.
    So after spending a month with these tools we finally decided to create our own scripts for data migration. We used tools like TOAD and SQL Yok to create the DDL for the tables and other DB objects.
    For the data migration we downloaded the mysql data in flat files and used sql loader to upload the same data in oracle. Even if this was a time consuming activity but this resulted in 100% data migration with no record getting failed and the time taken for this activity was around 6 Hrs in comparison to time of 24-28 Hrs that the workbench tool took.
    Amar

  • Problems using Quick Migrate in SQL Developer 1.5 for MySQL to Oracle 10g

    Hi all,
    I am trying to use SQL Developer 1.5 migration tools (Quick Migrate) to perform online capture and build source model to migrate from MySQL 5.x to Oracle 10g on Windows platform. I get these errors and the Quick Migrate process fails:
    oracle.dbtools.metadata.persistence.PersistableObject.doInsert(PersistableObject.java:238)
    I did a search and used the sqldeveloper.cmd script but still fails. Then I created a new database and truncated the repository. I now get the above error plus two new ones listed below:
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    Error loading nls:OALL8 is in an inconsistent state
    Error occurred during capture: Protocol violation
    It fails during the capture process for MySQL 5.1 database
    when it begins to capture the tables from MySQL.
    Does anyone know how to resolve these issues when migrating from MySQL to Oracle 10g using Quick Migrate with SQL Developer 1.5 release?
    Regards,
    Ben Prusinski
    Message was edited by:
    benprusinski
    Message was edited by:
    benprusinski

    Hi all,
    I put the following in my sqldeveloper.cmd file:
    SET ORACLE_HOME=%CD%
    What is very confusing is that with SQL Developer 1.5, there are several levels and several SQL Developer executables! I am really not sure which of these to use:
    I created the SQLDeveloper 1.5 directory called SQLDeveloper1_5 on Windows:
    1) cd C:\sqldeveloper1_5\sqldeveloper-5338
    there exists a sqldeveloper.exe
    2) cd c:\sqldeveloper1_5\sqldeveloper-5338\sqldeveloper\sqldeveloper.exe
    3) cd c:\sqldeveloper1_5\sqldeveloper-5338\sqldeveloper\sqldeveloer\bin\sqldeveloper.exe
    Which SQLDeveloper 1.5 executable should I be using and where should I place the
    sqldeveloper.cmd file?
    Also I did try to use a different database and schema for the repository with Quick Migrate but it appears a bug exists in SQL Developer 1.5 version that causes errors with Quick Migrate for MySQL to Oracle? Is this correct?
    As an update, I ran the following commands:
    cd to
    c:\sqldeveloper1_5\sqldeveloper-5338\sqldeveloper\sqldeveloper\bin
    sqldeveloper.cmd sqldeveloper.exe
    Start sqldeveloper.exe
    Perform standard capture for MySQL using the new mig2 schema as the new repository
    It starts the capture but fails on the errors below:
    Error loading nls:OALL8 is in an inconsistent state
    UPDATE
    ============================
    I tried this again and it worked with the exception of one error message listed below:
    Here are the steps that I followed:
    1. Create a Windows cmd script
    Put the following entries in the script:
    SET ORACLE_HOME=%CD%
    save the command windows script as sqldeveloper.cmd
    Copy this script to the base installation directory for SQLDeveloper
    Example:
    1. cd c:\SQLDeveloper1_5\sqldeveloper-5338\sqldeveloper
    2. Start SQLDeveloper with the command script that you created earlier
    Example:
    Open a Windows shell prompt window and execute the following scripts:
    a) sqldeveloper.cmd sqldeveloper.exe
    b) sqldeveloper.exe
    3) In SQL Developer 1.5
    From the Migrate menu,
    a) Delete current repository and create a new schema in Oracle target database call it mig2.
    b) Then create a new repository in SQL Developer 1.5
    c) Right mouse click on the MySQL 5.x database and choose capture
    It worked with the exception of one error message:
    o.jdbc.driver.OracleDriver     
    Error while registering Oracle JDBC Diagnosability MBean.
    So it looks like something is screwed up with my JDBC drivers and configuration for MySQL. How do I diagnose the JDBC driver issue for MySQL?
    Thanks!!!
    Ben
    Thanks
    Ben

  • CONVERT function in SQL Server to oracle

    All,
    How to convert CONVERT function in SQL Server to oracle, below mentioned format is in SQL Server:
    variable1 = convert(numeric(20), SUBSTRING( parameter1,parameter2,parameter3)
    parameter1 datatype nvarchar2(100)
    parameter2 datatype bigint
    parameter3 datatype bigint
    I did bit R&D, but was not successful..but still getting on..
    If any help that would be great...
    Regards,
    ~ORA

    You cannot specify the precision/scale or length of input paramters to a stored procedure in Oracle, or at least the pl/sql engine does not respect the sizing. Assuming that you want to do something with variable1 in the procedure, and not just return it, the Oracle equivalent would be something along the lines of:
    SQL> CREATE FUNCTION f (p_param1 IN VARCHAR2,
      2                     p_param2 IN NUMBER,
      3                     p_param3 IN NUMBER) RETURN NUMBER IS
      4     l_var1 NUMBER(20) := SUBSTR(p_param1, p_param2, p_param3);
      5  BEGIN
      6     RETURN l_var1 * 10;
      7  END;
      8  /
    Function created.
    SQL> SELECT f('ABC10DEF', 4, 2) FROM dual;
    F('ABC10DEF',4,2)
                  100You may need to adjust the return type to match what you are actually returning.
    You can also use this iin a direct assignment in pl/sql without doig a select, something like:
    SQL> DECLARE
      2     l_num NUMBER(20);
      3  BEGIN
      4     l_num := f('ABC10DEF', 4, 2);
      5     DBMS_OUTPUT.Put_Line('The number is: '||l_num);
      6  END;
      7  /
    The number is: 100John

  • Convert java.sql.Date to oracle.jbo.domain.Date in oaf

    Hi,
    Need to dafault NeedBydate(i get in from query as below) to a messagelovinput and make it read only.
    i am facing some issue in converting from java.sql.Date to oracle.jbo.domain.Date.
    unable to figure out the problem.
    below is the sample code im trying to use.
    PreparedStatement ps=pageContext.createPreparedStatement("select sysdate from dual");
    ResultSet rs=ps.executeQuery();
    if (rs!=null && ps.next()
    java.sql.Date sqlDate= rs.getDate(1);
    oracle.jbo.domain.Date oracleDate = new oracle.jbo.domain.Date(sqlDate.getTime());
    vorow.setAttribute("Datevalue",oracleDate);
    this is my assumption : to set to UI i need date in format dd-Mon-yyyy.(am i correct? as to get that format i tried to use simple date format class but no use)
    when i tried to use simple date format :unpaseable date exception was raised.
    please guide.

    Hi,
    Why are you using this code???
    PreparedStatement ps=pageContext.createPreparedStatement("select sysdate from dual");
    ResultSet rs=ps.executeQuery();
    if (rs!=null && ps.next()
    java.sql.Date sqlDate= rs.getDate(1);
    oracle.jbo.domain.Date oracleDate = new oracle.jbo.domain.Date(sqlDate.getTime());
    you can get sysdate using this and then set it
    oracle.jbo.domain.Date currentDate = am.getOADBTransaction().getCurrentUserDate();
    java.text.SimpleDateFormat displayDateFormat = new java.text.SimpleDateFormat ("yyyy-MM-dd");
    String DateForm = displayDateFormat.format(currentDate.dateValue());
    oracle.jbo.domain.Date dateset = new oracle.jbo.domain.Date(DateForm);
    and then set the attribute
    vorow.setAttribute("Datevalue",dateset);
    Thanks,
    Gaurav

  • Converting T-SQL proc into Oracle

    I need help in converting the following stored procedure into PL/SQL code. Basically I need to know corresponding function names for the various T-SQL constructs below. The parameter @PROC_NUM is passed by the caller with value @@PROCID which is the T-SQL global variable for the ID of the current stored procedure being executed by SQL Server. Thanks in advance for all the help.
    CREATE PROCEDURE [dbo].MARS_MPPM_HANDLE_ERROR
         @PROC_NUM          INT
    AS
    BEGIN
         -- SET NOCOUNT ON added to prevent extra result sets from
         -- interfering with SELECT statements.
         SET NOCOUNT ON;
         DECLARE @ERROR_NUMBER          INT
         DECLARE @ERROR_SEVERITY          INT
         DECLARE @ERROR_STATE          INT
         DECLARE @ERROR_PROCEDURE     Varchar(1000)
         DECLARE @ERROR_LINE               INT
         DECLARE @ERROR_MESSAGE          Varchar(8000)
         DECLARE @PROC_NAME               Varchar(255)
         SELECT
              @ERROR_NUMBER = ERROR_NUMBER(),
              @ERROR_SEVERITY = ERROR_SEVERITY(),
              @ERROR_STATE = ERROR_STATE(),
              @ERROR_PROCEDURE = ERROR_PROCEDURE(),
              @ERROR_LINE = ERROR_LINE(),
              @ERROR_MESSAGE = ERROR_MESSAGE(),
              @PROC_NAME = OBJECT_NAME( @PROC_NUM )
              IF 50000 = @ERROR_NUMBER
              BEGIN
                   RAISERROR( '%s -> %s', 16, 1, @PROC_NAME, @ERROR_MESSAGE )
              END
              ELSE
              BEGIN
                   RAISERROR( '%s -> Error Number = %d, Error Severity = %d, Error State = %d, Error Procedure = %s, Error Line = %d, Error Message = %s',
                        16,
                        1,
                        @PROC_NAME,
                        @ERROR_NUMBER,
                        @ERROR_SEVERITY,
                        @ERROR_STATE,
                        @ERROR_PROCEDURE,
                        @ERROR_LINE,
                        @ERROR_MESSAGE )
              END
    END

    875311 wrote:
    I need help in converting the following stored procedure into PL/SQL code.
    Re: How can i rewrite this code into java?
    This is true of any language, to adapt to this case
    1) Learn T-SQL
    2) Understand what that code does, that is, what its job is.
    3) Learn PL/SQL.
    4) Write PL/SQL code that fulfills the requirements fleshed out in step 2.
    The absolutely wrong way to do it is to try a mindless, mechanical translation.
    Re: How can i rewrite this code into java?
    >
    Seriously, you need to go through a Java tutorial from the beginning. Just trying to force another language's syntax onto Java without actually understanding anything about Java, and then posting questions here when you get stuck--questions that you could have and should have answered by doing the tutoria--is a horrible approach.
    >
    Replace Java with PL/SQL for same answer.
    Getting started with PL/SQL
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10766/toc.htm
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/toc.htm
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17126/toc.htm

  • SQL Server to Oracle Converted Model missing users

    I am doing a migration from SQL Server to Oracle with about 100 users. The captured model seems to be correct and all of the users are there. But, when creating the Oracle Converted Model, not all of the users are being converted. On the first attempt, the Converted Model had only 21 users, and on the next attempt, the Converted Model only had 16 users. Does anyone know what could be causing this?

    Oracle Database XE does not allow more than one instance per server.
    To define a primary key correct syntax is:
    Create table summary(
    Field NOT NULL PRIMARY KEY,
    Or:
    PRIMARY KEY constraint tabla_PK (field)
    To generate the value of the primary key you must create a sequence before or after creating the table:
    Create Sequence summary_seq
    Start with 1
    Increment by 1
    Nocycle;
    You can use the sequence in INSERT INTO or through a trigger:
    With Insert Into:
    Insert into Summary
    Values (summary_seq.nextval, valkor1, value2 ,...);
    With a trigger:
    Create or replace Trigger BI_summary
    Before Insert on SUMMARY
    For each row
    Begin
    Select summary_seq.nextval into campoPK
    From dual;
    End;

Maybe you are looking for

  • ISE upgrade from 1.1 to 1.2.1 - lost CLI admin password?

    Hi, In a mysterious way I lost CLI Admin password in whole my ISE deployment (6 PSN, 1 ADM and 1 MNT node). I wondering how it is possible? Last time I logged to the nodes when I upgrade my deployment from ISE 1.1 to 1.2.1. Is this possible that I co

  • Update/change packing info VL02

    We are running on a 4.0B system. We want to use the packing functinality to pack materials onto pallet and pack the pallets onto trailers. I have found IDoc DELVRY01 and function module WS_DELIVERY_UPDATE. The problem is that they can only be use to

  • 3d graph axis text reversed

    Hi The 3d graph control is everything I could want for my application with one exception! When you rotate a graph, the text for the axes becomes reversed. I have seen other controls that handle this but the NI version does not seem to have an option

  • Is it possible to create a report combining data from 2 reports?

    Post Author: swalker CA Forum: General We are upgrading the application, ServiceCenter.  We have reports that show our Response and Resolution Metrics.  I have 2 set of reports, one for the old version and one for the new version.  I need to combine

  • Opening saved webpage redirects to file index folder

    I saved a webpage on Lion and now when I go to open it on Snow leopard it redirects me to file:/// which makes it so that I cannot view the file image. How can I make it so that I can look at the web page I saved?