Problem with SQL

I am a java developer and having problem writing a simple sql query. Any help is highly appreciated.
FILE_TBL
CREATE TABLE FILE_TBL
FILE_ID VARCHAR2(8 BYTE),
PUBLICATION_DATE       DATE,
LOCATION_CODE VARCHAR2(2 BYTE),
Sample Data
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('1', '2011-04-11', 'AF001');
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('2', '2011-04-11', 'SF057');
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('2', '2011-04-14', 'AF081');
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('3', '2011-04-11', 'SF022');
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('3', '2011-04-14', 'AF012');
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('4', '2011-04-11', 'SF057');
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('5', '2011-04-11', 'AF036');
This is the structure of my table, from where data needs to be retrieved.
Now I have a requirement to retrieve the file_ids for all the matching files whose publication date is either or after 04/11/2011. Everything works fine with the below query.
SELECT FILE_ID
FROM FILE_TBL
WHERE PUBLICATION_DATE >= TO_DATE ('2011-04-11', 'yyyy-mm-dd')
AND ( (LOCATION_CODE LIKE 'SF%') OR (LOCATION_CODE LIKE 'AF%'))
Now there is a specific requirement, where in if there are multiple records for a particular file id with dates either or after 04/11/2011, then those records should be filtered.
For eg: in the above data set, for file id 2 and 3, I have two records with publication dates '04/11/2011' and '04/14/2011'. In this case since there are more entries than one record, this shouldn't be displayed and needs to be filtered from the result set.
Any help on correcting the query would be highly appreciated.
Thanks.

Hi,
SirGeneral wrote:
Thanks for the response!
Apologize for not testing the queries before posting them and this will not repeat. It was an error caused while simplifying the case. Thanks. They're working great now.
What are the results you want with this new requirement?
I also have one more requirement, and am not sure if I can do that without looping the data. What does "looping the data" mean?
Basically file data comes in as a batch with publication_dates for various file ids. In each such batch, the publication_date would be the same for all the different file ids. So, when a new batch comes in, all the files from old batch needs to be ignored.
Say with the corrected data set published:
First Batch:
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('1', TO_DATE('4-11-2011', 'MM-dd-YYYY'), 'AF001');
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('2', TO_DATE('4-11-2011', 'MM-dd-YYYY'), 'SF057');
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('3', TO_DATE('4-11-2011', 'MM-dd-YYYY'), 'SF022');
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('4', TO_DATE('4-11-2011', 'MM-dd-YYYY'), 'SF057');
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('5', TO_DATE('4-11-2011', 'MM-dd-YYYY'), 'AF036');
Second Batch:
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('2', TO_DATE('4-14-2011', 'MM-dd-YYYY'), 'AF081');
INSERT INTO FILE_TBL (FILE_ID, PUBLICATION_DATE, LOCATION_CODE) VALUES ('3', TO_DATE('4-14-2011', 'MM-dd-YYYY'), 'AF012');
Corrected create stmt:
CREATE TABLE FILE_TBL
FILE_ID VARCHAR2 (8 BYTE),
PUBLICATION_DATE DATE,
LOCATION_CODE VARCHAR2 (5 BYTE)
Now as per the new requirement I have to retrieve the file_ids for all the matching files whose publication date is either or after todays date (04/11/2011 ~ changes depending on when its being executed) only if a new batch hasn't arrived. If a new batch has arrived, retrieve only the files from new batch.
One solution that I can think about is to retrieve the data in descending order of PUBLICATION_DATE > TODAY and loop through by collecting file ids. If the PUBLICATION_DATE changes, then stop looping and return the collected file ids. You can use ROW_NUMBER, or similar analytic functions, to do that in SQL; no user-defined function or PL/SQL is required.
Is there a way to write this in a single SQL query? Appreciate any help on this.I'm not sure I understand.
It's clear you don't want to hard-code April 11, 2011 in the query, but I'm not sure what you want in its place. The query below uses today's date, whatever that happens to be.
Are you saying that only the most recent publication_date counts for each file_id? That is, file_ids 1, 4 and 5 only have rows dated April 11, so the April 11 rows count for those file_ids, but file_ids 2 and 3 have a later publication_date as well, so only the later date counts for them, so the rows dated April 11 are ignored for file_ids 2 and 3?
If so:
WITH     got_rnk         AS
     SELECT       file_id
     ,       COUNT (*)          AS cnt
     ,       ROW_NUMBER () OVER ( PARTITION BY  file_id
                                  ORDER BY          publication_date     DESC
                         )  AS rnk
        FROM        file_tbl
     WHERE       publication_date          >= TRUNC (SYSDATE)
     AND       SUBSTR (location_code, 1, 2)     IN ('AF', 'SF')
     GROUP BY  file_id
     ,            publication_date
SELECT     file_id
FROM     got_rnk
WHERE     rnk     = 1
AND     cnt     = 1
;With the sample data you posted, all 5 file_ids are selected, assuming this is run on April 11, 2011. (No file_id has more than 1 row on any one date.)
Or are you saying that all rows dated April 11 are to be ignored if there is any row with a later date?
In that case:
SELECT       file_id
FROM        file_tbl
WHERE       publication_date     = (
                         SELECT  MAX (publication_date)
                         FROM     file_tbl
                         WHERE     publication_date >= TRUNC (SYSDATE)
AND       SUBSTR (location_code, 1, 2)     IN ('AF', 'SF')
GROUP BY  file_id
HAVING       COUNT (*)     = 1
;The output from this query will include only file_ids 2 and 3. Here, April 14 is the latest date in the table, so all rows from April 11, from any file_id, are ignored.
It's unclear if you want the condition
SUBSTR (location_code, 1, 2)     IN ('AF', 'SF')to be in the main query (as shown above), the sub-query, or both.
Edited by: Frank Kulash on Apr 11, 2011 8:42 PM

Similar Messages

  • Problem with SQL connection and a Collection

    hi all,
    I have two problems with sql...
    1. how can I assign the values of a resultset to a collection?
    2. how can I close the sql connection, because when I close the statement and connection error shows me in the resultset
    thanks!

    Hello Pablo,
    RetrivingResults In Collection:
    1)   use getObject method, and assign it to collection.
              Collection c_obj=new ArrayList();
             while(rs.next())
                    c_obj.add(rs.getInt(Project_ID), rs.getString(Project_Name));
    Closing ResultSet
    2)               The close() methos of ResultSet closes the ResultSet object, like bellow
                    ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
                    rs.close(); //Closes the result set

  • Problem with SQL Insert

    Hi
    I am using Flex to insert data through remoteobject and using
    SAVE method generated from CFC Wizard.
    My VO contains the following variables where id has a default
    value of 0 :
    public var id:Number = 0 ;
    public var date:String = "";
    public var accountno:String = "";
    public var debit:Number = 0;
    public var credit:Number = 0;
    id is set as the primary key in my database.
    I have previously used MySQL which automatically generates a
    new id if I either omitted the id value in my insert statement or
    use 0 as the default value.
    However, now I am using MS SQL Server and the insert
    generated this error:
    Unable to invoke CFC - Error Executing Database Query.
    Detail:
    [Macromedia][SQLServer JDBC Driver][SQLServer]Cannot insert
    explicit value for identity column in table 'Transactions' when
    IDENTITY_INSERT is set to OFF.
    Strange thing is that I dont see this problem with another
    sample application. I compared with that application (it has the
    same VO with default value of 0 for id) and everything looks
    similar so I can't understand why I have this error in my
    application.
    This is SQL used to create the table:
    USE [Transactions]
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    SET ANSI_PADDING ON
    CREATE TABLE [dbo].[Transactions](
    [id] [int] IDENTITY(1,1) NOT NULL,
    [date] [datetime] NULL,
    [accountno] [varchar](100) NULL,
    [debit] [int] NULL,
    [credit] [int] NULL,
    CONSTRAINT [PK_Transactions] PRIMARY KEY CLUSTERED
    [id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE =
    OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
    ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    Has anyone encountered this problem before with insert
    statements dealing with a unique id (with MS SQL Server)?

    Change "addRecords =
    connection.prepareStatement("
    to "addRecords =
    connection.preparedStatement("
    -BIGD

  • Problem with  Sql Server

    Hi All,
    While i am trying to connect to sql server through an applet it is giving an error in the java console
    Ie SQLException: Connection refused :connect
    i also tried with standlone application it is working fine then would be the problem with applet
    Here is my driver
    Class.forName("com.inet.tds.TdsDriver").newInstance();
    DriverManager.getConnection("jdbc:inetdae7:SERVER:1433?database=abc","gin","gin");
    How can i resolve this issue.
    Thx & Rgds
    Vin

    Check the permissions for your applet. Anuntrusted
    applet(which it is by default) is not allowed toopen
    network connections. That might be the cause. Butthen
    you should get a SecurityException and not a
    Connection Failed exception. Couls you pleasedescribe
    the exception that you are getting.
    Cheers
    JaySome times it is giving access denied i.e.
    java.net.SocketPermission error in java console
    Try giving full permissions to your applet. There is a
    exe file in the bin dir of the jdk installation which
    does that(I forgot the name)
    Here is the exact error msg which is displaying in java console
    SQLException:access denied(Java.net.SocketPermission 127.0.0.1:1433 connect)
    -vin

  • Local Network Connection Problem with SQL Server 2008 R2

    Hi,
    I have CRM application which uses SQL server 2008. Weird thing is that I have no problems connecting from client machines to the server when using a particular router (via LAN) and when I upgrade the firmware of the same router (A common open source firmware
    which is used by many also works perfect apart from mentioned problem) and restart the server, the connection cannot be established. I get Error 40. 
    When i downgrade the firmware and restart the server, the connection works again.
    Please note that I am absolutely not touching any configuration of the server. Also the CRM software allows remote connections from public IPs which this feature works fine with both downgraded and upgraded firmwares. 
    As for my understanding, the routers do not block ports in LAN connections. So how can I diagnose the reason for this connection problem?

    Hi Leony83,
    Please also help to check Windows Event Log information regarding this issue, so that we can do further investigation. In additin, here is the general steps to troubleshoot SQL Server Error 40 issue. Please see:
    SQL SERVER – Fix : Error : 40 – could not open a connection to SQL server – Fix Connection Problems of SQL Server:
    http://blog.sqlauthority.com/2008/08/24/sql-server-fix-error-40-could-not-open-a-connection-to-sql-server-fix-connection-problems-of-sql-server/
    Hope this helps.
    Regards,
    Elvis Long
    TechNet Community Support

  • ODBC Problems with SQL Server 2012 on Virtual Machine

    I am having problem with my application after my IT department upgraded to SQL Server 2012 with error "ConngetDataToModify.vi:1"<ERR>Object 0x2222222 is not valid.  I have 4 servers running the same executable without problem before the upgraded. However, after the upgrade 2 of these Server are having the problem with the ODBC connection. Here are my setup, the application was created using LabView8.5, we have 2 physical server box running Window Server 2003, 2 Virtual Machine on Windows Server 2008, and a Virtual Machine with SQL 2012 Server. The 2 physical server running the executable without a problem after the upgrade, but the 2 Virtual Server were unable to connects to the ODBC connection. Anyone have any idea why this is happening , it is the problem with compatibility between my application with Server 2008 and SQL 2012 Server, or is there a problem with both beings Virtual Servers? As I said, the 2 physical Server seem to be running without any problem with the upgrade.

    My guess is that the problem is not specifically with LV. This should be relatively easy to check if you create a UDL file and double click it. This opens a Microsoft wizard which allows you to configure and test DB connections (the UDL file itself is basically just a text file which holds a connection string). If it doesn't work there, it won't work in LV.
    As for what the actual problem is, a common culprit is the firewall, which is easy enough to check by disabling it. Another option is the surface area configuration of SQL Server, which will not allow network connections unless you tell it to.
    It should probably also be noted that LV 8.5 is not officially supported on Windows Server. I'm assuming that's not the issue, but be aware of it.
    Try to take over the world!

  • URL problems with SQL Server Reporting Services 2012 with wildcard SSL certificate

    Hi,
    I have single server, domain member, with SQL Server 2012 SP1 Reporting Services.
    I am trying to get work with url: https://reports.mydomain.com
    I have valid wildcard certificate (*.mydomain.com) implemented and configured URLs in Configuration Manager.
    https://reports.mydomain.com/ReportServer - works fine
    https://reports.3pro.hr/Reports/ - I got error:
    The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
    In rsreportserver.config I have:
    <Add Key="SecureConnectionLevel" Value="2"/>
    When looking my ReportServerService_date.log file I have something like:
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using report server internal url https://localhost:443/ReportServer.
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using report server external url https://serverhostname:443/ReportServer.
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using url root https://reports.mydomain.com/ReportServer.
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using report server internal url https://localhost:443/ReportServer.
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using report server external url https://serverhostname:443/ReportServer.
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using url root https://reports.mydomain.com/ReportServer.
    Also, error shown in log file:
    appdomainmanager!ReportManager_0-2!4c50!03/10/2013-20:24:53:: e ERROR: Remote certificate error RemoteCertificateNameMismatch encountered for url https://localhost/ReportServer/ReportService2010.asmx.
    ui!ReportManager_0-2!4c50!03/10/2013-20:24:54:: e ERROR: System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException:
    The remote certificate is invalid according to the validation procedure.
    Btw, is there a way to delete/disable access using https://localhost and/or servername (not FQDN) since SSL will not work in this way for me, and I want access only by full url - https://reports.mydomain.com , not localhost ..
    -- Hrvoje Kusulja

    I spent one of my 4 free support incidents with Microsoft (part of MSDN subscription) this year to get this investigated.  The tech support person helped me through several issues but had to leave to attend some training, and I got past the last hurdle
    before she called me back.  Here are the steps that resolved this issue for me.  I know for sure that step 5 was necessary.  Step 1 may not apply to you, and steps 2-4 may or may not have been necessary (they didn't immediately fix the issue,
    but I didn't roll them back either so they may have been necessary.)
    Step 1:
    Ensure you are editing the correct rsreportserver.config file.  I had been making changes to a file that was installed in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\WebServices\Reporting, but that was a rsreportserver.config
    file for some sharepoint integration that I'm not using.  The correct path on my system was E:\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config, but yours may vary. If you can't figure it out, look in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
    SQL Server\MSRS11.MSSQLSERVER\Setup in the key named SQLPath, and then go to the ReportServer subdirectory of that path.
    Step 2: 
    In rsreportserver.config, ensure that SecureConnectionLevel is set to the value 3.  Was set to 0 in my configuration.  Corrected line in your rsreportserver.confiog file should look like:
    <Add Key="SecureConnectionLevel" Value="3"/>
    Step 3:
    In rsreportserver.config, add the correct value to the <URLRoot> element (which already exists in the file.)  In my configuration, this value was blank.  The value should be the fully qualified path to your report server, with a hostname that
    is valid for your certificate.  For example, if my cert matches *.mydomain.local:
    <UrlRoot>
    https://myserver.mydomain.local/ReportServer
    </UrlRoot>
    Step 4:
    Ensure that your certificate exists in Trusted Root Certification Authorities in certmgr for the local machine.  I had the certificate installed as a Personal certificate for the local machine, which I still think was correct (the certificate wasn't actually
    the problem and worked correctly for Report Server, and the failure was caused by SSRS incorrectly making a https request to a localhost URL), but she had me remove the certificate from Personal and add it to Trusted Root Certificate Authorities.  That
    broke things and the cert was no longer listed as a cert I could bind to, so we then copied it so it existed in both Personal and Trusted Root Certificate Authorities.  This is how I left it, not sure if that was necessary.
    Step 5:
    This was the fix that finally got things to work. In rsreportserver.config, add the same value to the <ReportServerUrl> element (which also already exists in the file) that you added in step 3.  In my configuration, this value was also blank.
    The corrected value should be the same as in step 3, for example:
    <ReportServerUrl>
    https://myserver.mydomain.local/ReportServer
    </ReportServerUrl>
    Then restart your report server (stop & then start in Report Server Configuration Manager), and the problem should go away.  At least it did for me.
    Good luck!

  • Problem with SQL*Loader loading long description with carriage return

    I'm trying to load new items into mtl_system_items_interface via a concurrent
    program running the SQL*Loader. The load is erroring due to not finding a
    delimeter - I'm guessing it's having problems with the long_description.
    Here's my ctl file:
    LOAD
    INFILE 'create_prober_items.csv'
    INTO TABLE MTL_SYSTEM_ITEMS_INTERFACE
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    (PROCESS_FLAG "TRIM(:PROCESS_FLAG)",
    SET_PROCESS_ID "TRIM(:SET_PROCESS_ID)",
    TRANSACTION_TYPE "TRIM(:TRANSACTION_TYPE)",
    ORGANIZATION_ID "TRIM(:ORGANIZATION_ID)",
    TEMPLATE_ID "TRIM(:TEMPLATE_ID)",
    SEGMENT1 "TRIM(:SEGMENT1)",
    SEGMENT2 "TRIM(:SEGMENT2)",
    DESCRIPTION "TRIM(:DESCRIPTION)",
    LONG_DESCRIPTION "TRIM(:LONG_DESCRIPTION)")
    Here's a sample record from the csv file:
    1,1,CREATE,0,546,03,B00-100289,PROBEHEAD PH100 COMPLETE/ VACUUM/COAX ,"- Linear
    X axis, Y,Z pivots
    - Movement range: X: 8mm, Y: 6mm, Z: 25mm
    - Probe tip pressure adjustable contact
    - Vacuum adapter
    - With shielded arm
    - Incl. separate miniature female HF plug
    The long_description has to appear as:
    - something
    - something
    It can't appear as:
    -something-something
    Here's the errors:
    Record 1: Rejected - Error on table "INV"."MTL_SYSTEM_ITEMS_INTERFACE", column
    LONG_DESCRIPTION.
    Logical record ended - second enclosure character not present
    Record 2: Rejected - Error on table "INV"."MTL_SYSTEM_ITEMS_INTERFACE", column
    ORGANIZATION_ID.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    I've asked for help on the Metalink forum and was advised to add trailing nullcols to the ctl so the ctl line now looks like:
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
    I don't think this was right because now I'm getting:
    Record 1: Rejected - Error on table "INV"."MTL_SYSTEM_ITEMS_INTERFACE", column LONG_DESCRIPTION.
    Logical record ended - second enclosure character not present
    Thanks for any help that may be offered.
    -Tracy

    LOAD
    INFILE 'create_prober_items.csv'
    CONTINUEIF LAST <> '"'
    INTO TABLE MTL_SYSTEM_ITEMS_INTERFACE
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
    (PROCESS_FLAG "TRIM(:PROCESS_FLAG)",
    SET_PROCESS_ID "TRIM(:SET_PROCESS_ID)",
    TRANSACTION_TYPE "TRIM(:TRANSACTION_TYPE)",
    ORGANIZATION_ID "TRIM(:ORGANIZATION_ID)",
    TEMPLATE_ID "TRIM(:TEMPLATE_ID)",
    SEGMENT1 "TRIM(:SEGMENT1)",
    SEGMENT2 "TRIM(:SEGMENT2)",
    DESCRIPTION "TRIM(:DESCRIPTION)",
    LONG_DESCRIPTION "REPLACE (TRIM(:LONG_DESCRIPTION), '-', CHR(10) || '-')")

  • Problems with sql developer and win 8 64 bit

    Hi there,
    It's my first time in this forum, I am a student programmer and I have many problems to install SQL Developer on Oracle Database 12c. I actually managed to install both, but I could not make them work. My question is SQL Developer works on the Windows 8 platform 64-bit?
    I'm going crazy, help me please .... Thanks for a while!!!

    SqlDeveloper should have no problem working in Win 8, but i do not think it's a supported platform yet.
    The Database could be a little more troublesome, if you only need a working database environment to make experiments you could find the "pre-built" Virtual Machines useful.
    For Win 8 and 12c try using the EA release of SQLDeveloper 4, because if I'm not mistaken the current 3.2.2 could have some problems with 12c.

  • Problem with SQL,udfs & procedures

    I have couple of problems with my database. Please suggest solution.
    We are basically a web product With a Quite large Database
    1. I am using functions both User Defined and Built in Functions in
    SQL Statement. I want to optimize the query how do i do it.
    why the usage of function in sql statements suppresses,the
    usage of indexes internally. How to forceable make use of
    the index even though function is used.
    2. Whenver The Client makes a request to the Database server with a
    Sql Query What are the steps we can take at the
    client side to enhance the performance of the Query.
    (i.e the Data Request ). How to optimize the usage of CPU at
    client site?
    3. what is the increase in the performance ration by having
    separate table spaces for user data,system data and indexes.
    4. Why the procedures are getting invalided
    after some time. The procedure is
    not getting executed at the front end.
    Once the procedure is getting invalidated.
    However even though the status of the
    procedure is invalid the same is getting
    executed at the back end.
    Can anybody help me
    Request for reply ASAP.
    Regards
    Koshal
    null

    1. In Oracle 8i, one can create function-based indexes, where instead of indexing a column, one can index upper() of that column.
    2. Optimizing client performance is trickier. One can tune the queries being
    submitted by the client, but if getting the first row back -- which is how response time is generally perceived -- set the OPTIMIZER_MODE parameter in init.ora to FIRST_ROWS.
    3. There is minimal benefit to having data, index, rollback, and temp tablespaces all separated unless all the datafiles for each tablespace reside on different disks (data on disk 1, index on disk 2, etc). It's recommended regardless, but unless the files are on separate volumes, there won't be a great performance benefit.
    4. A procedure is invalidated whenever DDL is issued against any object that that procedure depends upon. For example, if you add a column to a table, any procedures which reference that table will be invalidated. Any procedures which reference views which reference that table will be invalidated, because the view will be invalidated. It's best to run a compile script which looks for and attempts to recompile any invalid objects on a daily basis.
    Adam

  • Problems with SQL

    I've got a big and terrible problem with a query. I'm trying to query a MS ACCESS db from my Java program, using IDSServer. That means that i need to import j102.sql.* instead of java.sql.*
    The query is:
    String querynumrioff = "SELECT DETTAGLI_OFFERTE.[Cod-nmg], DETT_RISP1.NUM_RISPOSTA, DETT_RISP1.DATA_COMPILAZIONE, DETTAGLI_OFFERTE.[Pos offerta], DETTAGLI_OFFERTE.[Codice NMG], DETTAGLI_OFFERTE.[Disegno NMG], DETTAGLI_OFFERTE.Descrizione, DETTAGLI_OFFERTE.[Rev disegno], DETTAGLI_OFFERTE.Um, DETTAGLI_OFFERTE.[Qt� lotto], DETTAGLI_OFFERTE.[Qt� annua], DETTAGLI_OFFERTE.[Prezzo obiettivo], DETTAGLI_OFFERTE.[Data cons off], DETTAGLI_OFFERTE.[Data cons mat], DETTAGLI_OFFERTE.Note, DETTAGLI_OFFERTE.[ID offerta] FROM DETTAGLI_OFFERTE LEFT JOIN DETT_RISP1 ON DETTAGLI_OFFERTE.[ID dettagli offerta] = DETT_RISP1.ID_DETTAGLI WHERE (((DETTAGLI_OFFERTE.[ID offerta])= '" + numoff + "'))";
    The error message that I get is:
    j102.sql.SQLException: [22018][Microsoft][Driver ODBC Microsoft Access] Tipi di dati non corrispondenti nell'espressione criterio.
    That means something like "Data types not matching in the critera expression".
    Could anybody help me finding a solution to this problem?
    Thank you really much!
    Giorgio

    I used :
    Integer gio=new
    Integer(jTextFieldnumrioff.getText());
    int numoff =gio.intValue() ;
    But it still doesn't work
    Thank you very much for you answer!
    GiorgiLike I said, you don't use quotes around numbers in SQL
    This is what you have:
    WHERE (((DETTAGLI_OFFERTE.[ID offerta])= '" + numoff + "'))";
    Let's say numoff = 10 Then your SQL is equivalent to
    WHERE DETTAGLI_OFFERTE.[ID offerta] = '10';
    '10' is a string 10 is a number. Change your SQL to this:
    WHERE (((DETTAGLI_OFFERTE.[ID offerta])= " + numoff + "))";

  • XL Reporter problem with SQL 2005

    Hi,
    We just migrated our SQL Server from 2000 to 2005. Everything seemed OK, until we tried to run XL Reporter addon. Our SQL 2005 is 64bit edition, and I heard the 64bit version has some problem with transferring data to Excel, for example.
    has anybody had the some problem? How can we solve this?
    Thanks.
    Andre

    Hi Andre,
    Check this thread: Re: XLR - Terminal Server
    It should be a problem if your PL is upgrade to new.
    Thanks,
    Gordon

  • Strange problem with SQL query in toad.

    Guys,
    My colleague is up with a strange problem with an SQL query that if it is run in toad encounters the "ORA-03113: end-of-file on communication channel" problem,but if run in SQL plus executes just fine.
    Do anyone have thoughts about this strange error in toad?
    Thanks!!!!
    Regards,
    Bhagat

    Not sure what version of TOAD you have but it may have shipped with SQLMonitor which montiors SQL sent from Windows apps . Navigation should be similar to;
    Start~Programs~Quest Software~TOAD for Oracle~Tools~SQLMonitor
    or
    C:\Program Files\Quest Software\Toad for Oracle\SQLMonitor.exe
    To use it, start TOAD and connect, start SQLMonitor and click the checkbox for TOAD.exe, then execute the query. SQLMonitor will show you the actual query that TOAD sent to the client. It may be exactly what you sent or it may contain some extras.

  • Problem with SQL Authenticator and SOA EM console.

    Hi,
    In my project, i have a need to authenticate USERS from data base tables. To acheve this i defined SQL Authenticator, inside the weblogic admin console.But, problem is after this, when i login to EM console of SOA, then, in the home page, it is showing all deployments as DOWN sate, including SOA-INFRA. But, i am able to deploy BPEL project and execute it normally. Why EM console is showing all deployments and soa-infra as down?.
    Thanks,
    Naga.
    Edited by: 984573 on Feb 5, 2013 9:56 PM

    Hi Anuj & Nicolas,
    Thanks for your reply.
         Really wonder, i found the solution. This is the problem with order of Authentication provider. If i put the "SQL Authenticator" in the top of the order as the first item in the list, then i am facing the above error in EM console. Now, i re-ordered the "SQL Authenticator" and keep it last in the list. Now, SOA EM console is working fine. I really do not understand, what is the significance of the order of Authentication provider.
    Thanks for your help.
    Regards,
    Naga.

  • Problem with SQL loader - "maximum length"

    using SQL*Loader: Release 8.1.7.0.0
    ===================================
    (full CTL enclosed below)
    I have a problem with several rows, in which I'm getting the "Field in data file exceeds maximum length" error.
    the DB field (referer) is a VARCHAR2(4000), and the field in the error rows never exceeds few hundred characters. According to Oracle docs I should be able to load fields which are no bigger than the DB field, what gives?
    I tried the variation
    referer CHAR "SUBSTR(:referer,1,100)"
    for this field, which causes all the "referer" columns in the "good" rows to load no more than 100 characters, but the same error repeats for the same rows!
    the input file is an IIS log, and the field is the REFERER field. its pure ASCII encoded, is there some character that cause Oracle to behave this way? is this a bug?
    here is one "bad" row: the "bad" field starts with "ht
    tp://web , is enclosed with quotes. I have replaced the client IP and other fields with xxx for privacy reasons.
    after that, I have enclosed my CTL as well.
    any help ?
    Yoram Ayalon
    BTW - I verified in the LOG file that the loader is reading my options for the columns as I described in the CTL. no problem there.
    "2003-06-30 11:11:12" xxx.xxx.xxx.xxx WEBSRVXX 80 GET /xxx.xxx 200 0 778 1359 "ht
    tp://web.ask.com/redir?bpg=http%3a%2f%2fweb.ask.com%2fweb%3fq%3dWhat%2bis%2bsign
    al%2bcommunication%253f%26o%3d0%26page%3d1&q=What+is+signal+communication%3f&u=h
    ttp%3a%2f%2ftm.wc.ask.com%2fr%3ft%3dan%26s%3da%26uid%3d032EBF1A318A100F3%26sid%3
    d3d2bbe4f8d2bbe4f8%26qid%3d4B2346DA8A56C6418CB4DCB9091EEBA7%26io%3d0%26sv%3dza5c
    b0db2%"
    LOAD DATA
    INFILE '/tmp/mod_websrvxx.txt'
    APPEND INTO TABLE tmpLogs
    FIELDS TERMINATED BY WHITESPACE optionally enclosed by '"'
    (LogDate DATE "YYYY-MM-DD HH24:MI:SS", ClientIP, ServerName, ServerPort, ClientM
    ethod,UriStem,Status,BytesSent,BytesReceived,TimeTaken,Referer CHAR "SUBSTR(:Re
    ferer, 1, 100)" )

    Use:
    readsize=3000000
    or some large number to raise this limit.
    Check the below link for detailed explanation
    http://asktom.oracle.com/pls/ask/f?p=4950:8:380010202423963671::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:2167288643374,

  • Problem with SQL object type extend

    Hi,
    i have a severe problem when i try to extend an SQL object type (that derive from an XMLSchema registration) with standard SQL operations. After update when i look the updated record with SQL (XMLDATA.*) then i find the new items. But when i load same XML as file from XML repository via FTP or WebDAV protocol i don't find the new items in that.
    Would anyone please help?
    Thanks in advance
    Gabor

    Hi Syed Emad,
    Could you please try to post a simple reproduce project in here?
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Adding worksets/iview as links to an html file utilised in a KM Doc iview

    Hi, I have developed a home page using the KM Document iview, which utilzes an html page in path to document. Now, On this home page, I want to display the links of worksets. Example: On Clicking the link--> Leave Management(a workset), it should ope

  • What settings to use for avi to play on FCP

    Hi i have a whole batch of jump backs avi clips are about 10 sec long i need to change them over so they can play on timeline with FCP can i use media manger and if so what setting would i use. thanks

  • Rx9800pro-td128 vs rx9800pro-td128sp

    I ordered a "rx9800pro-td128" from newegg. what arrived is a "rx9800pro-td128sp". The "sp" version is listed as "new" on msi's site, but it looks to have a smaller heatsink/fan. why is this the "new" version? is the sp version "newer and better for t

  • WLC 5508 And Third Party SSL for Web Authenticaiton

    Hello, We are using WLC 5508 and currently the authentication process is via Customized WebAuth. As you know that with the WebAuth the authentication process won't work unless you launch Web Browser and you will be redirected to the Authentication Pa

  • Principal Propagation Using Sender SOAP adapter in PI7.1

    Hi, I am trying to configure principal propagation using SOAP sender adapter. In that, I am trying to generate the assertion ticket in SAP only but it is using PIAFUSER as the user that is being passed and not the user which we are using to logon. Pl