Switch from MySQL to MS SQL Server, Query not working

I'm sure there is a simple setting somewhere for this, but cannot seem to find it and really would appreciate some assistance. Have an application which uses JDBC to connect to a MySQL DB to run the following query without an issue:
SELECT * FROM users
This returns the desired results. Changed to connect to MS SQL Server 2000 using the JDBC-ODBC bridge and the same query returns no results. The problem, SQL Server wants this query instead:
SELECT * FROM [users]
I don't want to have to change queries depending on the DB, as that is supposed to be one of the advantages of JDBC. Is there a setting in MySQL (or the JDBC driver) to have it work correctly if I pass table names in []? Or is there a setting in MS SQL Server (or in the JDBC, or ODBC) to have it accept queries without the []?
Or is there a different approach that I'm missing which would avoid this whole problem?
Thanks,
Matt

I suspect your database definitions are different. It has nothing to do with your java code.
The bracket syntax is used to indicate the more standard quoted identifiers in standard SQL.
Thus you could do this in oracle and in MS SQL Server...
SELECT * FROM "users"
I suspect that the above will work for your MS SQL Server database and will not work for your Oracle database. However if you created the table in oracle and specifically used "users" (with the double quotes around the name) when creating the table then it would work.
Of course if the database definitions are different it means you must use different SQL for each. Just as if the name of the table was 'other' rather than 'users'.

Similar Messages

  • Oracle 8i - PL/SQL sub query not working in PROC, but works ins SQL

    I have read about certain things not working in 8i and I think this is one of them, but I was wondering if anyone had a work around. In the place of the SELECT SYSDATE FROM DUAL, I have a table look up, where I am going to look up the OCN of the corresponding VENDOR_ID ( a column in the original query ). I am doing it in a decode statement because if the first condition in the decode statement is met, that's it. But if not, it needs to look up the OCN number in this other table. Simple enough, conceptually. I thought of a view but that necessitates a SELECT statement, too. Anyway, here is the code with the appropriate text bolded:
    CREATE OR REPLACE PROCEDURE tstINS_RATE_ROUTE_RECORDS_PROC (GET_CUR_PERIOD IN DATE) IS
         CUR_PERIOD DATE;
         BEGIN
         CUR_PERIOD := GET_CUR_PERIOD;
         Insert into RATE_ROUTE (
           CVBI_KEY
         , VENDOR_ID
         , OCN
         , ST_CD
         , PERIOD
         , MDFY_DT )
         Select
           C.CVBI_KEY
         , C.VENDOR_ID
         <b>, decode( c.send_lca, 'YES', 'XXX', (SELECT SYSDATE FROM DUAL) )</b>
         , decode( c.send_lca, 'YES', 'XX', SUBSTR(C.ZLOC,5,2) )
         , CUR_PERIOD
         , TO_CHAR(SYSDATE)
         FROM
           rpt_ds1_cnt_cat c
         , cogs_resource cr
         , cogs_t1activity ct1
         , rpt_ds1_aloc_zloc_reverse_vw az
         where (C.CVBI_KEY = CR.CVBI_KEY (+)
         and  CR.PERIOD = CUR_PERIOD)
         AND  (C.CVBI_KEY = CT1.CVBI_KEY (+)
         and CT1.PERIOD = CUR_PERIOD)
         and (az.master_route_name=c.aloc||'-'||c.zloc OR az.reversed=c.aloc||'-'||c.zloc)
         END; -- INS_RATE_ROUTE_RECORDS_PROC

    have read about certain things not working in 8i and I think this is one of them,Yes as I said scalar sub-queries were also not recognized within PL/SQL in 8i.
    Re: PLS-00103: Encountered the symbol "SELECT" when expecting one of the fo
    I was wondering if anyone had a work around.Write a function that returns the value. You may incur a performance penalty from a context switch to PL/SQL, but it may be balanced by the decode optimization you are attempting.

  • Sql server agent not work

    hi every one ,
    i use sql server agent to make a job which delete some rows from my table at 12:00 AM
    this job works on (Mydatabase1) but when i make another job to another database(Mydatabase2)
    i get this error from ViewJob HIstory :
    Myjob2,Error,1,FATMA\MSSQLSERVER2008,Myjob2,step2,,Executed as user: NT AUTHORITY\SYSTEM. DELETE
    failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are
    correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query
    notifications and/or XML data type methods and/or spatial index operations. [SQLSTATE 42000] (Error 1934).  The step
    failed
    please inform me what is that error means?and how can i fix it?and why this job work to database and not work for another!!!
    best wishes
    fatma
    fatma mohamed

    Hi Miloslav Peterka,
    i set Quoted Identifiers to true it was false,it woorked in first time after that i get this error(but in my worked job on myDatabase1 the Quoted Identifiers was false.)
    Date  24-05-2010 10:44:28 ص
    Log  Job History (AttendanceJob)
    Step ID  0
    Server  FATMA\MSSQLSERVER2008
    Job Name  AttendanceJob
    Step Name  (Job outcome)
    Duration  00:00:01
    Sql Severity  0
    Sql Message ID  0
    Operator Emailed  
    Operator Net sent  
    Operator Paged  
    Retries Attempted  0
    Message
    The job failed.  The Job was invoked by User sa.  The last step to run was step 1 (attStep).
    wat is the reason of that error?
    best wishes
    fatma mohamed

  • Oracle to SQL server connection - not working

    Hi Friends,
    OS version : R Linux EL5
    Oracle version : 10.2.0.4
    i had followed http://www.databasejournal.com/features/oracle/article.php/10893_3442661_2/Making-a-Connection-from-Oracle-to-SQL-Server.htm document and modified tnsnames.ora, listener.ora files in HS directory.
    when i tried to start new listener, its throwing following error
    *+[oracle@viadbscph802v admin]$ lsnrctl start LISTENERMSCRM_CONFIGDSN+*
    LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 30-MAR-2010 08:35:08*
    Copyright (c) 1991, 2007, Oracle.  All rights reserved.*
    Starting /opt/oracle/protas/product/10.2.0/db/bin/tnslsnr: please wait...*
    TNSLSNR for Linux: Version 10.2.0.4.0 - Production*
    System parameter file is /opt/oracle/protas/product/10.2.0/db/network/admin/listener.ora*
    Log messages written to /opt/oracle/protas/product/10.2.0/db/network/log/listenermscrm_configdsn.log*
    TNS-01151: Missing listener name, LISTENERMSCRM_CONFIGDSN, in LISTENER.ORA*
    Listener failed to start. See the error message(s) above...*
    my listener.ora entry is as below
    *+[oracle@viadbscph802v admin]$ more listener.ora+*
    +# This is a sample listener.ora that contains the NET8 parameters that are+
    +# needed to connect to an HS Agent+
    LISTENERMSCRM_CONFIGDSN =*
    +(ADDRESS_LIST=+
    +(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))+
    +(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))+
    SID_LIST_LISTENER=*
    +(SID_LIST=+
    +(SID_DESC=+
    +(SID_NAME=MSCRM_CONFIGDSN)+
    +(ORACLE_HOME=/opt/oracle/protas/product/10.2.0/db)+
    +(PROGRAM=hsodbc)+
    +)+
    +)+
    +#CONNECT_TIMEOUT_LISTENER = 0+
    when i do tnsping, it is showing following error
    *+[oracle@viadbscph802v admin]$ tnsping mscrm_configdsn+*
    TNS Ping Utility for Linux: Version 10.2.0.4.0 - Production on 30-MAR-2010 08:49:32*
    Copyright (c) 1997,  2007, Oracle.  All rights reserved.*
    Used parameter files:*
    TNS-03505: Failed to resolve name*
    my tnsnames.ora entry is as below
    *+[oracle@viadbscph802v admin]$ more tnsnames.ora+*
    +# This is a sample tnsnames.ora that contains the NET8 parameters that are+
    +# needed to connect to an HS Agent+
    +#hsagent  =+
    +#  (DESCRIPTION=+
    +#    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))+
    +#    (CONNECT_DATA=(SID=hsagent))+
    +#    (HS=)+
    +#  )+
    MSCRM_CONFIGDSN  =*
    +(DESCRIPTION=+
    +(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))+
    +(CONNECT_DATA=(SID=MSCRM_CONFIGDSN))+
    +(HS=OK)+
    +)+
    my GLOBAL_NAMES is set to flase
    Please help me in resolving this problem.
    i have a doubt, should we have oracle client software to be installed on machine which is running sql server?
    thanks in advance

    [oracle@viadbscph802v admin]$ lsnrctl status LISTENERMSCRM_CONFIGDSN
    LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 30-MAR-2010 14:38:32
    Copyright (c) 1991, 2007, Oracle. All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=viadbscph802v)(PORT=1522))
    STATUS of the LISTENER
    Alias LISTENERMSCRM_CONFIGDSN
    Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
    Start Date 30-MAR-2010 12:41:17
    Uptime 0 days 1 hr. 57 min. 15 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /opt/oracle/protas/product/10.2.0/db/network/admin/listener.ora
    Listener Log File /opt/oracle/protas/product/10.2.0/db/network/log/listenermscrm_configdsn.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=viadbscph802v.no.via.as)(PORT=1522)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
    Services Summary...
    Service "MSCRM_CONFIGDSN" has 1 instance(s).
    Instance "MSCRM_CONFIGDSN", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    [oracle@viadbscph802v admin]$ tnsping MSCRM_CONFIGDSN
    TNS Ping Utility for Linux: Version 10.2.0.4.0 - Production on 30-MAR-2010 14:38:40
    Copyright (c) 1997, 2007, Oracle. All rights reserved.
    Used parameter files:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)) (CONNECT_DATA=(SID=MSCRM_CONFIGDSN)) (HS=OK))
    OK (0 msec)
    below are listener.ora and tnsnames.ora entries
    LISTENERMSCRM_CONFIGDSN =
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=tcp)(HOST=viadbscph802v)(PORT=1522))
    (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
    SID_LIST_LISTENERMSCRM_CONFIGDSN =
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=MSCRM_CONFIGDSN)
    (ORACLE_HOME = /opt/oracle/protas/product/10.2.0/db/)
    (PROGRAM=hsodbc)
    MSCRM_CONFIGDSN =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))
    (CONNECT_DATA=(SID=MSCRM_CONFIGDSN))
    (HS=OK)
    )

  • SQL Update Query not Working...

      This was working until we had to encrypt the main key.  This has been replaced with an existing autonum field.  When I test the T-SQL query alone on SQL Server,  it works.   But through the ColdFusion progam, nothing happens.  Its as if the submit button reference to this is not working or is ignored.
    Any ideas?
    Here is the code clip were the issue may be occuring.
    <cfparam name="URL.SEQNO" default="1">
    <cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
    <cfif IsDefined("FORM.MM_UpdateRecord") AND FORM.MM_UpdateRecord EQ "formUpdateRecord">
      <cfquery name="Section301MI" datasource="301dsn">
      DECLARE @str NVARCHAR(128)
      SET @str = #FORM.SSN#;
      OPEN SYMMETRIC KEY SSN_Key_01
       DECRYPTION BY CERTIFICATE anjalitest
      UPDATE dbo.TableDataRecords SET SSN=
      <cfif IsDefined("FORM.SSN") AND #FORM.SSN# NEQ "">
        EncryptByKey(Key_GUID('SSN_Key_01'),@str)
          <cfelse>
          NULL
      </cfif>
      , verifySSN =
      <cfif IsDefined("FORM.SSN") AND #FORM.SSN# NEQ "">
        EncryptByKey(Key_GUID('SSN_Key_01'),@str)
          <cfelse>
          NULL
      </cfif>
      , LastName=
      <cfif IsDefined("FORM.LastName") AND #FORM.LastName# NEQ "">
        '#FORM.LastName#'
          <cfelse>
          NULL
      </cfif>
      , FirstName=
      <cfif IsDefined("FORM.FirstName") AND #FORM.FirstName# NEQ "">
        '#FORM.FirstName#'
          <cfelse>
          NULL
      </cfif>
      , MiddleInitial=
      <cfif IsDefined("FORM.MiddleInitial") AND #FORM.MiddleInitial# NEQ "">
        '#FORM.MiddleInitial#'
          <cfelse>
          NULL
      </cfif>
      , DOB=
      <cfif IsDefined("FORM.DOB") AND #FORM.DOB# NEQ "">
        '#FORM.DOB#'
          <cfelse>
          NULL
      </cfif>
      , BenefitProgram=
      <cfif IsDefined("FORM.BenefitProgram") AND #FORM.BenefitProgram# NEQ "">
        #FORM.BenefitProgram#
          <cfelse>
          NULL
      </cfif>
      , MedCessDate=
      <cfif IsDefined("FORM.MedCessDate") AND #FORM.MedCessDate# NEQ "">
        '#FORM.MedCessDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgramDecision=
      <cfif IsDefined("FORM.ProgramDecision") AND #FORM.ProgramDecision# NEQ "">
        #FORM.ProgramDecision#
          <cfelse>
          NULL
      </cfif>
      , ProgramDecisionDate=
      <cfif IsDefined("FORM.ProgramDecisionDate") AND #FORM.ProgramDecisionDate# NEQ "">
        '#FORM.ProgramDecisionDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgramType=
      <cfif IsDefined("FORM.ProgramType") AND #FORM.ProgramType# NEQ "">
        #FORM.ProgramType#
          <cfelse>
          NULL
      </cfif>
      , ProgAllowStartDate=
      <cfif IsDefined("FORM.ProgAllowStartDate") AND #FORM.ProgAllowStartDate# NEQ "">
        '#FORM.ProgAllowStartDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgAllowCompDate=
      <cfif IsDefined("FORM.ProgAllowCompDate") AND #FORM.ProgAllowCompDate# NEQ "">
        '#FORM.ProgAllowCompDate#'
          <cfelse>
          NULL
      </cfif>
      , DiaryDate=
      <cfif IsDefined("FORM.DiaryDate") AND #FORM.DiaryDate# NEQ "">
        '#FORM.DiaryDate#'
          <cfelse>
          NULL
      </cfif>
      , DenialReason=
      <cfif IsDefined("FORM.DenialReason") AND #FORM.DenialReason# NEQ "">
        #FORM.DenialReason#
          <cfelse>
          NULL
      </cfif>
      , TermDecisionDate=
      <cfif IsDefined("FORM.TermDecisionDate") AND #FORM.TermDecisionDate# NEQ "">
        '#FORM.TermDecisionDate#'
          <cfelse>
          NULL
      </cfif>
      , TermReason=
      <cfif IsDefined("FORM.TermReason") AND #FORM.TermReason# NEQ "">
        #FORM.TermReason#
          <cfelse>
          NULL
      </cfif>
      , Remarks=
      <cfif IsDefined("FORM.Remarks") AND #FORM.Remarks# NEQ "">
        '#FORM.Remarks#'
          <cfelse>
          NULL
      </cfif>
      , EncryptNatIDNum1 = NULL
      , EncryptNatIDNum2 = NULL
      WHERE SEQNO=#URL.SEQNO#
       CLOSE SYMMETRIC KEY SSN_Key_01;
      </cfquery>
      <cflocation url="modifysuccess.cfm">
    </cfif>

    1) This is almost a clone to the Insert form that works.  The main differences are It selects the matching record for editing and then Updates.
    2) The CFDUMP gives me results when I put it in the logic section that responds to the Form Submit button.  But not at the top of the code.
      I added the CFABORT so I could see a result.
    <cfif (IsDefined("FORM.MM_UpdateRecord") AND FORM.MM_UpdateRecord EQ "formUpdateRecord") OR (IsDefined("FORM.UpdateRecord") AND FORM.UpdateRecord EQ "Update Record")>
       <cfdump var="#form#">
      <cfquery name="Section301MI" datasource="301dsn" username="section301db" password="testdb">
      DECLARE @str NVARCHAR(128)
      <cfif IsDefined("FORM.SSN")>
       SET @str = #FORM.SSN#;
      </cfif>
      OPEN SYMMETRIC KEY SSN_Key_01
       DECRYPTION BY CERTIFICATE anjalitest
      UPDATE dbo.TableDataRecords SET verifySSN=                     <<This is only displayed, but not modified.  Should this even be in the update?
      <cfif IsDefined("FORM.SSN") AND #FORM.SSN# NEQ "">
        EncryptByKey(Key_GUID('SSN_Key_01'),@str)
          <cfelse>
          NULL
      </cfif>
      , [LastName]=
      <cfif IsDefined("FORM.LastName") AND #FORM.LastName# NEQ "">
        '#FORM.LastName#'
          <cfelse>
          NULL
      </cfif>
      , [FirstName]=
      <cfif IsDefined("FORM.FirstName") AND #FORM.FirstName# NEQ "">
        '#FORM.FirstName#'
          <cfelse>
          NULL
      </cfif>
      , MiddleInitial=
      <cfif IsDefined("FORM.MiddleInitial") AND #FORM.MiddleInitial# NEQ "">
        '#FORM.MiddleInitial#'
          <cfelse>
          NULL
      </cfif>
      , DOB=
      <cfif IsDefined("FORM.DOB") AND #FORM.DOB# NEQ "">
        '#FORM.DOB#'
          <cfelse>
          NULL
      </cfif>
      , BenefitProgram=
      <cfif IsDefined("FORM.BenefitProgram") AND #FORM.BenefitProgram# NEQ "">
        #FORM.BenefitProgram#
          <cfelse>
          NULL
      </cfif>
      , MedCessDate=
      <cfif IsDefined("FORM.MedCessDate") AND #FORM.MedCessDate# NEQ "">
        '#FORM.MedCessDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgramDecision=
      <cfif IsDefined("FORM.ProgramDecision") AND #FORM.ProgramDecision# NEQ "">
        #FORM.ProgramDecision#
          <cfelse>
          NULL
      </cfif>
      , ProgramDecisionDate=
      <cfif IsDefined("FORM.ProgramDecisionDate") AND #FORM.ProgramDecisionDate# NEQ "">
        '#FORM.ProgramDecisionDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgramType=
      <cfif IsDefined("FORM.ProgramType") AND #FORM.ProgramType# NEQ "">
        #FORM.ProgramType#
          <cfelse>
          NULL
      </cfif>
      , ProgAllowStartDate=
      <cfif IsDefined("FORM.ProgAllowStartDate") AND #FORM.ProgAllowStartDate# NEQ "">
        '#FORM.ProgAllowStartDate#'
          <cfelse>
          NULL
      </cfif>
      , ProgAllowCompDate=
      <cfif IsDefined("FORM.ProgAllowCompDate") AND #FORM.ProgAllowCompDate# NEQ "">
        '#FORM.ProgAllowCompDate#'
          <cfelse>
          NULL
      </cfif>
      , DiaryDate=
      <cfif IsDefined("FORM.DiaryDate") AND #FORM.DiaryDate# NEQ "">
        '#FORM.DiaryDate#'
          <cfelse>
          NULL
      </cfif>
      , DenialReason=
      <cfif IsDefined("FORM.DenialReason") AND #FORM.DenialReason# NEQ "">
        #FORM.DenialReason#
          <cfelse>
          NULL
      </cfif>
      , TermDecisionDate=
      <cfif IsDefined("FORM.TermDecisionDate") AND #FORM.TermDecisionDate# NEQ "">
        '#FORM.TermDecisionDate#'
          <cfelse>
          NULL
      </cfif>
      , TermReason=
      <cfif IsDefined("FORM.TermReason") AND #FORM.TermReason# NEQ "">
        #FORM.TermReason#
          <cfelse>
          NULL
      </cfif>
      , Remarks=
      <cfif IsDefined("FORM.Remarks") AND #FORM.Remarks# NEQ "">
        '#FORM.Remarks#'
          <cfelse>
          NULL
      </cfif>
      , EncryptNatIDNum1 = NULL
      , EncryptNatIDNum2 = NULL
      WHERE SEQNO=#URL.SEQNO#
       CLOSE SYMMETRIC KEY SSN_Key_01;
      </cfquery>
    <cfabort>
      <cflocation url="modifysuccess.cfm">
    </cfif>

  • How do i download the new software onto my computer so then i can install the new itunes? i dont have the mac app thing either and it wont let me do it from the itunes because my server is not working. how do i fix it?

    Hey so i have a version of a mac i think it is kinda old, it is the all white one i got it like 4 years ago maybe. I got a new ipod recently and i cannot downloade any music onto it. this is because i tried to download the new itunes which it said i needed and now when i try to install it. It says i need a new software so i try to download that and is says i need the mac app or something. but it says i need the new software to get that. so i went onto itunes and clicked the apple and pressed new software and it goes onto this little thing that says my internet is alright but my server has not been connecting. My computer is connected to my school and they updated the server thing and now it wont connect, so i can't win. how do i fix this and download everything i neew?

    First things first: Pull down the Apple Menu and select "about this Mac" and tell us what version of OS X is currently on your computer.

  • Sql Developer Launcher Not Working In Linux

    Hello,
    System Details:
    Fedora 19
    Sql Developer Version: Version 4.0.0.12
    Java Version:  OpenJDK 1.7.0-40
    I can launch Sql Developer from the command line successfully.
    /opt/sqldeveloper/sqldeveloper.sh
    But when I attempt to use the launcher icon, I receive a SIGSEGV error.  Here is the top of the hs_error.log file.
    # A fatal error has been detected by the Java Runtime Environment:
    #  SIGSEGV (0xb) at pc=0x000000317a062e00, pid=7680, tid=140636646749952
    # JRE version: OpenJDK Runtime Environment (7.0_40-b60) (build 1.7.0_40-mockbuild_2013_10_02_16_56-b00)
    # Java VM: OpenJDK 64-Bit Server VM (24.0-b56 mixed mode linux-amd64 compressed oops)
    # Problematic frame:
    # C  0x000000317a062e00
    The ~/.sqldeveloper/jdk file contains the following:
    /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.2.7.fc19.x86_64
    And my /usr/share/applications/sqldeveloper.desktop file contains the following:
    [Desktop Entry]
    Encoding=UTF-8
    Name=SQL Developer
    Comment=Oracle SQL Developer
    Icon=/opt/sqldeveloper/icon.png
    Exec=/opt/sqldeveloper/sqldeveloper.sh
    Terminal=true
    Type=Application
    Categories=GNOME;Oracle;
    I'm just switching from Ubuntu to Fedora so this has not worked in the past.
    Thank you for any help,
    Ann

    The solution in https://forums.oracle.com/thread/2594033 worked.  I added the 2nd line below to /opt/sqldeveloper/sqldeveloper.sh.
    #!/bin/bash
    unset -v GNOME_DESKTOP_SESSION_ID
    cd "`dirname $0`"/sqldeveloper/bin && bash sqldeveloper $*
    Previously, I incorrectly updated ~/.bashrc to unset GNOME_DESKTOP_SESSION_ID.  That's why running Sql Developer from the command line worked, but not from the launcher.
    Thanks su.

  • In Oracle this SQL update tatement not working but in MS SQL it works

    Dear Friends,
    The following sql update statement work fine in MS sql server but not working in Oracle. Can you kindly suggest, What is wrong with this statement ? and is their any other way of achieving the same in Oracle.
    UPDATE INPUTSTREET SET EDIT_FLAGS=S.EDIT_FLAGS From INPUTSTREET G, INPUT_SEGBASE S Where G.GEOKEY=S.GEOKEY
    This statement give error in Oralce saying - Statement not ended properly
    Cheers,
    Vinay

    You would normally write
    UPDATE inputStreet g
       SET edit_flags = (SELECT s.edit_flags
                           FROM input_segbase s
                          WHERE s.geokey = g.geokey)If you don't want to update all the rows in inputStreet, you can add a WHERE EXISTS clause.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • From SharePoint Content Database, Using SQL-Server Query how to fetch the 'Document GUID' based on 'Content Type'

    I want to get all the documents based on content type using SQL Server Query. I know that, querying the content database without using API is not advisable, but still i want to perform this action through SQL Server Query. Can someone assist ?

    You're right, it's not advisable, may result in corruption of your databases and might impact performance and stability. But assuming you're happy to do that then it is possible.
    Before you go down that route, have you considered using something more safe like PowerShell? I've seen a script exactly like the one you describe and it would take far less time to do it through PS than it would through SQL.

  • Is there any way of importing stuffs from Microsoft Access to SQL Server?

    I have quite a big store of information Microsoft Access DB, but now i am required to switch to SQL Server?
    Is there any way of importing to SQL Server, either by Java programming or manually?
    Thank you in advance.

    I like to give some tips on how to fulfil the requirement.. I haven't tried this. If you succeeded, it is well and good.
    1) Using Java:
    If you like to Java to import the data from MS Access to SQL Server, you have to write a JDBC Program in such a way that it has to retrieve the data from each MSAccess tables and store it in temperory java varaible.After writng into the temp. varaibles, the same thing will be written into SQL Server. The whole process is repeated for all the tables in MS Access.
    2) Manual Process:
    Try to get the data scripts from MS-Access for all the tables and Load the same into SQL Server
    I hope that Manual Process consumes less time compared in writing the codes for transformation..
    I hope that you got some idea on reading this. If you have any doubts, try to get back to me..

  • Official documents on escaping characters in SQL Server query statements

    Hi,
    Are there any official documents on how to escaping special characters in SQL Server query statements? I find a lot of online resources discussing about this, but there are no definitive conclusions on:
    Which characters should be escaped? (Some only said single-quote needs to be escaped, double-quote does not need. While others said both need to be escaped)
    How to escape characters? (Some said using two single-quote to escape a single-quote. Others said using a backslash, etc.)
    So I just wonder if there is an official document from Microsoft regarding this?
    Thanks
    Alan

    Depends on where you're using them
    If its string values then single quotes(') should be escaped by putting one more single quote before it.
    If its LIKE operator you can use ESCAPE keyword or use [] to escapre special characters 
    see
    http://visakhm.blogspot.in/2013/01/wildcard-character-based-pattern-search.html
    If inside SSIS expression you can escape characters like \ " etc by adding an extra \ before the characters
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Support for mysql or ms sql server ?

    Does sunone support mysql or ms sql server, I keep getting the following when I try to deploy an entity bean using either database.
    Deployment Error -- Error while running ejbc -- Fatal Error from EJB Compiler -- -- java.lang.RuntimeException: The schema file sequence, does not contain a table named SEQUENCE
    I'm using the dbschema generated by Forte, is there some hand editing I need to do to get it to work? I'm still confused why this schema is necessary, never had to go through such an annoying process with IAS or weblogic.
    Here's my schema:
    <?xml version="1.0" encoding="UTF-8" ?>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.SchemaElement" ID="com.sun.forte4j.modules.dbmodel.SchemaElement113759">
    <versionNo>2</versionNo>
    <impl>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.SchemaElementImpl" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.SchemaElementImpl14130741">
    <element>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.SchemaElement113759"/>
    </element>
    <_catalog>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.DBIdentifier" ID="com.sun.forte4j.modules.dbmodel.DBIdentifier13872011">
    <name>jbush</name>
    </OBJECT>
    </_catalog>
    <_username>dbo</_username>
    <_driverName>i-net SPRINTA 2000</_driverName>
    <_driverVersion>3.04</_driverVersion>
    <_url>jdbc:inetdae7:149.24.18.160:1433?jbush</_url>
    <_name>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.DBIdentifier" ID="com.sun.forte4j.modules.dbmodel.DBIdentifier10703853">
    <name>seq</name>
    </OBJECT>
    </_name>
    <_driver>com.inet.tds.TdsDriver</_driver>
    <tables>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection1698697">
    <_elms>
    <ARRAY SIZE="1" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.TableElement">
    <ROW ROW="0">
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.TableElement" ID="com.sun.forte4j.modules.dbmodel.TableElement-64018320">
    <impl>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.TableElementImpl" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.TableElementImpl14348553">
    <table>sequence</table>
    <columns>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection7791938">
    <_elms>
    <ARRAY SIZE="2" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.ColumnElement">
    <ROW ROW="0">
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.ColumnElement" ID="com.sun.forte4j.modules.dbmodel.ColumnElement1290031433">
    <declaringTable>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.TableElement-64018320"/>
    </declaringTable>
    <impl>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.ColumnElementImpl" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.ColumnElementImpl431013">
    <_precision>
    <OBJECT CLASS="java.lang.Integer" ID="java.lang.Integer255">
    <value>255</value>
    </OBJECT>
    </_precision>
    <element>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.ColumnElement1290031433"/>
    </element>
    <_scale>
    <OBJECT/>
    </_scale>
    <_name>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.DBIdentifier" ID="com.sun.forte4j.modules.dbmodel.DBIdentifier13059074">
    <name>name</name>
    </OBJECT>
    </_name>
    <_isNullable>false</_isNullable>
    <_type>12</_type>
    <_length>
    <OBJECT REFERENCE="java.lang.Integer255"/>
    </_length>
    </OBJECT>
    </impl>
    </OBJECT>
    </ROW>
    <ROW ROW="1">
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.ColumnElement" ID="com.sun.forte4j.modules.dbmodel.ColumnElement-1947358447">
    <declaringTable>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.TableElement-64018320"/>
    </declaringTable>
    <impl>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.ColumnElementImpl" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.ColumnElementImpl4332208">
    <_precision>
    <OBJECT CLASS="java.lang.Integer" ID="java.lang.Integer10">
    <value>10</value>
    </OBJECT>
    </_precision>
    <element>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.ColumnElement-1947358447"/>
    </element>
    <_scale>
    <OBJECT CLASS="java.lang.Integer" ID="java.lang.Integer0">
    <value>0</value>
    </OBJECT>
    </_scale>
    <_name>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.DBIdentifier" ID="com.sun.forte4j.modules.dbmodel.DBIdentifier15083736">
    <name>_index</name>
    </OBJECT>
    </_name>
    <_isNullable>false</_isNullable>
    <_type>4</_type>
    <_length>
    <OBJECT REFERENCE="java.lang.Integer10"/>
    </_length>
    </OBJECT>
    </impl>
    </OBJECT>
    </ROW>
    </ARRAY>
    </_elms>
    <_template>
    <ARRAY SIZE="0" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.ColumnElement">
    </ARRAY>
    </_template>
    <owner>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.jdbcimpl.TableElementImpl14348553"/>
    </owner>
    </OBJECT>
    </columns>
    <element>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.TableElement-64018320"/>
    </element>
    <_name>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.DBIdentifier" ID="com.sun.forte4j.modules.dbmodel.DBIdentifier8623087">
    <name>sequence</name>
    </OBJECT>
    </_name>
    <isTable>true</isTable>
    <keys>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection6518090">
    <_elms>
    <ARRAY SIZE="1" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.KeyElement">
    <ROW ROW="0">
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.UniqueKeyElement" ID="com.sun.forte4j.modules.dbmodel.UniqueKeyElement-1935265242">
    <_associatedIndex>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.IndexElement" ID="com.sun.forte4j.modules.dbmodel.IndexElement-1935265242">
    <declaringTable>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.TableElement-64018320"/>
    </declaringTable>
    <impl>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.IndexElementImpl" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.IndexElementImpl6639084">
    <columns>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection15936586">
    <_elms>
    <ARRAY SIZE="1" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.ColumnElement">
    <ROW ROW="0">
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.ColumnElement1290031433"/>
    </ROW>
    </ARRAY>
    </_elms>
    <_template>
    <ARRAY SIZE="0" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.ColumnElement">
    </ARRAY>
    </_template>
    <owner>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.jdbcimpl.TableElementImpl14348553"/>
    </owner>
    </OBJECT>
    </columns>
    <element>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.IndexElement-1935265242"/>
    </element>
    <_name>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.DBIdentifier" ID="com.sun.forte4j.modules.dbmodel.DBIdentifier14601066">
    <name>PK__sequence__65370702</name>
    </OBJECT>
    </_name>
    <tei>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.jdbcimpl.TableElementImpl14348553"/>
    </tei>
    <_unique>true</_unique>
    </OBJECT>
    </impl>
    </OBJECT>
    </_associatedIndex>
    <declaringTable>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.TableElement-64018320"/>
    </declaringTable>
    <impl>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.UniqueKeyElementImpl" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.UniqueKeyElementImpl16555948">
    <columns>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection15874598">
    <_elms>
    <ARRAY SIZE="1" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.ColumnElement">
    <ROW ROW="0">
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.ColumnElement1290031433"/>
    </ROW>
    </ARRAY>
    </_elms>
    <_template>
    <ARRAY SIZE="0" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.ColumnElement">
    </ARRAY>
    </_template>
    <owner>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.jdbcimpl.UniqueKeyElementImpl16555948"/>
    </owner>
    </OBJECT>
    </columns>
    <element>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.UniqueKeyElement-1935265242"/>
    </element>
    <_name>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.DBIdentifier" ID="com.sun.forte4j.modules.dbmodel.DBIdentifier5692381">
    <name>PK__sequence__65370702</name>
    </OBJECT>
    </_name>
    <_primary>true</_primary>
    </OBJECT>
    </impl>
    </OBJECT>
    </ROW>
    </ARRAY>
    </_elms>
    <_template>
    <ARRAY SIZE="0" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.KeyElement">
    </ARRAY>
    </_template>
    <owner>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.jdbcimpl.TableElementImpl14348553"/>
    </owner>
    </OBJECT>
    </keys>
    <indexes>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection" ID="com.sun.forte4j.modules.dbmodel.jdbcimpl.DBElementsCollection12944408">
    <_elms>
    <ARRAY SIZE="1" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.IndexElement">
    <ROW ROW="0">
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.IndexElement-1935265242"/>
    </ROW>
    </ARRAY>
    </_elms>
    <_template>
    <ARRAY SIZE="0" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.IndexElement">
    </ARRAY>
    </_template>
    <owner>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.jdbcimpl.TableElementImpl14348553"/>
    </owner>
    </OBJECT>
    </indexes>
    </OBJECT>
    </impl>
    </OBJECT>
    </ROW>
    </ARRAY>
    </_elms>
    <_template>
    <ARRAY SIZE="0" CLASS="PRIMITIVE" ROWCLASS="com.sun.forte4j.modules.dbmodel.TableElement">
    </ARRAY>
    </_template>
    <owner>
    <OBJECT REFERENCE="com.sun.forte4j.modules.dbmodel.jdbcimpl.SchemaElementImpl14130741"/>
    </owner>
    </OBJECT>
    </tables>
    <_databaseProductVersion>8.0.194</_databaseProductVersion>
    <_schema>
    <OBJECT CLASS="com.sun.forte4j.modules.dbmodel.DBIdentifier" ID="com.sun.forte4j.modules.dbmodel.DBIdentifier8165687">
    <name></name>
    </OBJECT>
    </_schema>
    <_databaseProductName>Microsoft SQL Server</_databaseProductName>
    </OBJECT>
    </impl>
    </OBJECT>

    Thanks for the help, the migration tool translated all my table names and columns names into caps, lowercasing these babies in the sun-cmp-mappings.xml fixed the problem.
    Just for the record, for anyone else who is trying to use mysql, here is what my connection pool looks like in server.xml:
    <jdbc-connection-pool steady-pool-size="8" max-pool-size="32" max-wait-time-in-millis="60000" pool-resize-quantity="2" idle-timeout-in-seconds="300" is-isolation-level-guaranteed="false" is-connection-validation-required="false" connection-validation-method="auto-commit" fail-all-connections="false" datasource-classname="org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource" name="jdbcPool">
    <property value="jbush" name="DatabaseName"/>
    <property value="localhost" name="serverName"/>
    <property value="3306" name="port"/>
    <property value="root" name="User"/>
    <property value="root" name="Password"/>
    </jdbc-connection-pool>

  • Converting SQL Server Query to Oracle

    Hello TechFriends,
    Can any one of u please tell me equivalent of following SQL Server Query?
    The same query runs in Oracle but givesa same reocrds in different order!! I want such an equivalent oracle query that gives records in same order as Sql Server does.
    select
    ProfValue_ProfScaleFK ProfScale,
    ProfValue_Value ProfValue,
    isnull(ProfValueDesc.name, ProfValue_name) ProfName
    from
    ProfValueDesc inner join TBL_LMS_Lang
    on lang_fk = lang_pk and langid = 'en'
    right outer join ProfValue
    on ProfValue_ProfScaleFK = ProfScale_fk and ProfValue_Value = ProfValue_FK ;
    Regards & TIA.
    Anand.

    If you want a specific ordering why don't you add an ORDER BY clause?
    Donal

  • Comments not imported from Data Dictionary of SQL Server. SDDM 3.3.0.747

    Hi,
    SDDM 3.3.0.747 32-bit on Windows 7 64-bit.
    Comments are not imported from Data Dictionary of SQL Server 2008. Connection through Microsoft JDBC Driver 4.0 for SQL Server or jTDS 1.2.7
    What I have tried? In SDDM DDL generation, Comments in DBRMS for SQL Server are generated with "EXEC sp_addextendedproperty 'MS_Description' , 'Test Comment' ..." so I added extended property named "MS_Description" into SQL Server database, both on table and column. None of them were imported from Data Dictionary into SSDM. I have tried both drivers stated above. Is it a bug or am I missing something?
    I've found similar question thread Re: Data dictionary import doesn't import column comments for SDDM 3.0.0.665, so I guess it is a bug when importing with JDBC drivers.
    MiGli
    Edited by: MiGli_1006342 on May 25, 2013 8:32 AM
    Edited by: MiGli_1006342 on May 25, 2013 9:02 AM

    Extended properties were not imported correctly from SQLServer databases at DM 3.3.0.747.
    Calls to sp_addextendedproperty and fn_listextendedproperty have been modified.
    I don't think it is a problem with JDBC drivers.
    A bug fix should be available in the next release of DM.

  • Remote Connection from SAP to MS-SQL server

    Hello Experts,
    We have been following 2 options so far and we have come across some issues
    The first Option is to call a stored procedure (this is our preferred method) which does the data transfer for us
    We have been able to test this scenario successfully from SQL Server side
    However, while calling the stored proc via native SQL from ABAP we have come across an issue which is due to SQL 2005 changes (Schema implementation and difference in the security context)
    While calling the stored procedure from the ABAP Code we have an error
                The program short dumps with runtime error DBIF_DSQL2_SQL_ERROR, exception CX_SY_NATIVE_SQL_ERROR. The database error code is 15274, and the error text is
                 "Access to the remote server     is denied because the current security context is not trusted."
    This issue is new after the SQL Server 2005.
    We are trying to resolve that.
    Secondly we have been trying the DBCON option as well as per OSS Note 323151
    We have a few things thatu2019s impacting our scenario:
    The remote servers are in a different domain
    The remote servers are located  in DIZ
    Remote server is a named instance
    Remote server has been configured with a different port than standard (1565) u2013 All Connection strings will need port in there
    The Database name starts with a numeric value
    Due a combination of factors as mentioned above the standard approach does not work
    Have any of you used this approach while connecting from SAP to MS-SQL server? Do you know of any successful methods to connect to SQL using ABAP (or not) from SAP.
    Thanks in advance,

    Yes,
    DBConnect & UDConnect.
    Works like a charm.
    We write data into a MS-SQL database via DBConnect & an ABAP program (using open sql).

Maybe you are looking for

  • When selecting a row from a view with a nested table I want just ONE entry returned

    Does a nested table in a view "EXPLODE" all values ALWAYS no matter the where clause for the nested table? I want to select ONE row from a view that has columns defined as TYPE which are PL/SQL TABLES OF other tables. when I specify a WHERE clause fo

  • Isight good but useless

    Isight is a good product but useless since you can't communicate with most people because most people use MSN from their PC. I have a beautiful iMacG5 with a pretty integrated Isight, but I haven't found one personn I know to make video communication

  • How can in configure mail in tomcat 4.1

    sir , i want to configure tomcat 4.1 server for sending mail from my jsp pages.i got some codes for sending mail using jsp.it needed an smtp server address and default port no. i have theses too.but my problem is my smtp server needed user name and p

  • Connecting a J2SE Application to the Bluetooth Emulation Environment

    I would like to connect a J2SE application to a MIDlet running in the Wireless Toolkit's Emulation Environment using the WTK's bluetooth emulation environment. Does anybody know how to access the bluetooth emulation environment of the WTK? This would

  • PA - Transaction Data Conversion

    Dear Experts, Any one could help me what logic we have to follow when we do Data Conversion for PA for PA Transactional Data Thanks Bharath