ORA-01891 - Query works in SQL+ but not in JDev

JDev 9.0.4 / DB 8i...
I run a query in SQL+ and it returns results, I run it in JDev Worksheet and I get "ORA-01891: Datetime/Interval internal error".
The query is a select from a view based on a synonym that links to a table in another DB (database link). I have boiled it down to it's "simplest" form for testing and it looks like:
select * from some_table;
I can also run this query in 9.0.5.2 worksheet.

Funny you should mention that. The reason I found this error is because one of my VOs wasn't working, so I tried running the query in the worksheet. Didn't work there either but I was getting this different error (posted above). Anways, turns out the viewobject had the wrong attribute listed so I fixed that but the worksheet doesn't work.
I don't think it's the attribute because the worksheet isn't directly connected to the VO so it shouldn't be aware of it. Additionally, only the VOs that are based on the view/synonym/link are affected.
Thanks for the suggestion though!

Similar Messages

  • Query working in sql but not if  forrms!!!!

    I transferred my column apprnum from tblrefstaff to paymast using
    SQL>update paymast set paymast.apprnum=(select tblrefstaff.apprnum from tblrefstaff where tblrefstaff.empno=paymast.empno and rownum=1);
    5072 rows updated
    Now i query for the records in paymast
    SQL> select empno from paymast where apprnum='338';
    EMPNO
    2217
    SQL> select apprnum from paymast where empno='2217';
    APPRNUM
    338
    Now in forms when i write this under POST-QUERY
    begin
         select apprnum
         into :paymast.apprnum
         from paymast
         where empno = :paymast.empno;
    exception when no_data_found then null;
         end;
    no data is retrieved in to the item apprum
    its only retrieved when the name of table is that of the previous one like this
    begin
         select apprnum
         into :paymast.apprnum
         from tblrefstaff
         where empno = :paymast.empno;
    exception when no_data_found then null;
         end;
    2nd CASE: after transferring apprnum to paymast all the items are now under paymast so i just removed the code under POST-QERY and the set the datbase item to yes and column name to APPRNUM but still no use
    It only fetches records in apprnum using
    select apprnum
         into :paymast.apprnum
         from tblrefstaff
         where empno = :paymast.empno;
    exception when no_data_found then null;
         end;
    how should solve this.?
    Edited by: Suhail Faraaz on Nov 10, 2009 2:10 AM

    i think you forgot to commit; after executing update stmt..
    It will work in SQL becoz, you wrote the Query immediately after the select stmt.
    But Forms is in another session, it cannot access the data until you commit the SQL session.
    Regards
    Dora
    Edited by: Dora on Nov 10, 2009 2:26 PM

  • Query working in sql but not in forms

    hi this is my query
    insert into sa_prod_temp
    select sa_idno,sa_srno_desc,count(*) qty from sa_master,
              select sa_code,sa_idno,sa_prod_date,sa_srno,sa_srno1 from
                   select sa_code,sa_idno,sa_prod_date,sa_srno,sa_srno1 from bom_sa_prod
                   order by sa_prod_date desc
              where rownum <=50
         ) b
         where sa_type = :dummy.sa_code and sa_type = sa_code
         and sa_master.sa_srno = b.sa_idno
         group by sa_idno,sa_srno_desc     ;

    insert into sa_prod_temp
    select sa_idno,sa_srno_desc,count(*) qty from sa_master,
    select sa_code,sa_idno,sa_prod_date,sa_srno,sa_srno1 from
    select sa_code,sa_idno,sa_prod_date,sa_srno,sa_srno1 from bom_sa_prod
    order by sa_prod_date desc
    where rownum <=50
    ) b
    where sa_type = :dummy.sa_code and sa_type = sa_code
    and sa_master.sa_srno = b.sa_idno
    group by sa_idno,sa_srno_desc ;
    VALUE CLASS IS MISSING
    -----------------

  • DB Link - works via SQL but not via packages

    I have a database link on user ODB on database A, to database B. The DB Link seems fine for SQLs that i do, but doesn't compile in my package code. Please tell me why it works for "regular sqls" but not inside a package.
    Example: while connected as ODB user on database A, if I do this query:
    SELECT "TRAXDOC_DETAIL"."FILE_NAME",
    "TRAXDOC_DETAIL"."FILE_TYPE",
    FROM "TRAXDOC_DETAIL"@TRAXDOC_LINK
    WHERE "TRAXDOC_DETAIL"."TRAXDOC_ROW_ID" = 100031 AND
    "TRAXDOC_DETAIL"."TRAXDOC_LINE"= 2
    It works fine. But the same query inside a package that is owned by user ODB on database A will not compile, stating the table/view does not exist.
    The database link is owned by use ODB on database A, connects directly to the owner of the tables in question on database B.
    Any suggestions welcome... this is an urgent issue, because it also worked fine on my customer's test environment, but not on their Production that they just upgraded. I need to know what to look for as to what could be wrong.

    Thanks so much for your response - Prefixing the call to the table within the package, with the schema owner does indeed solve the problem. Since this is a Production issue, i have implemented this fix in my customer's database.
    However, I would still like this issue permanently resolved. The next time we send out updated package code, this will happen again (unless we then fix it again). I'd still like info from anyone on what exactly must be done to allow the call within the package to work without specifically pre-fixing the table's schema owner. It shouldn't be needed... The DB link is connecting via the same schema on database B that owns the table in question.
    pre-fixing the schema owner is something we don't do in our sql statements, and this has worked fine for many of our cusomer's environments. We're only seeing this issue on one environment.

  • SQL query works for Access but not mySQL

    *I'm using the Database Connectivity VIs* Can anyone give me a clue as to why the following query works with an MS Access File DSN but not a mySQL File DSN:
    SELECT * FROM (SELECT * FROM WP100598 WHERE SerialNum LIKE '311022-05%' OR SerialNum LIKE '311022-07%') WHERE UTCTime > 1090882800 AND UTCTime < 1092870000 ORDER BY SerialNum desc
    Thank you, your help is much appreciated

    Hi,
    I don't think MySQL supports nested queries.
    Regards,
    Wiebe.
    "optobionics" wrote in message
    news:[email protected]..
    > *I'm using the Database Connectivity VIs* Can anyone give me a clue
    > as to why the following query works with an MS Access File DSN but not
    > a mySQL File DSN:
    > SELECT * FROM (SELECT * FROM WP100598 WHERE SerialNum LIKE
    > '311022-05%' OR SerialNum LIKE '311022-07%') WHERE UTCTime >
    > 1090882800 AND UTCTime < 1092870000 ORDER BY SerialNum desc
    > Thank you, your help is much appreciated

  • Query works in Report but not during Edit session

    I have a report based on an SQL query, and it works perfectly from the menu in Development. It's also in Test and Production, and it works there, too. I want to change the template it's on, so I went in through the Navigator to open up and change the report. The Edit session opens up to the query, but I cannot move to any of the other tags, because it says the query is "not valid".
    It won't allow me to save the query 'as is', because it supposedly isn't valid. The report isn't locked, and prior versions (I went back to view five of them) have the same trouble. How can the query work off the menu, but not be 'valid'? We installed a patch recently, but even so, why would the query work in one spot and not another?
    Anyone have any ideas on what I can do?
    Pat Murray

    Hi,
    Please give me the query and the error the error you are getting.
    Thanks,
    Sharmila

  • XPath query works with CLOB but not with object relational

    hi all
    i have the following queries,the XQuery work with all, but XPath queries work with XMLType CLOB and Binary XML, but they do not work with XMLType as Object relational,
    select extract (object_value,'movies/directorfilms/films/film [studios/studio = "Gaumont"]')
    from xorm;
    select extract (object_value,'movies/directorfilms[director/dirname = "L.Cohen"]/films/film[position()=2]/t')
    from xorm;
    they shows this message
    ORA-00932: inconsistent datatypes: expectd SYSTEM.name683_COLL got CHAR
    thanks

    Hi Marco
    fisrt here is my RO
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL=>'http://......../ORMovies.xsd',
    SCHEMADOC=>bfilename('DB','Movies.xsd'),
    LOCAL =>false,
    GENTYPES=>true,
    GENTABLES=>FALSE,
    CSID=>nls_charset_id('AL32UTF8'));
    END;
    create table XORM of xmltype
    xmltype store as object relational
    XMLSCHEMA "http://......../ORMovies.xsd"
    ELEMENT "movies";
    INSERT INTO XORM
    VALUES(XMLType(BFILENAME('DB','ORMovies.xml'),nls_charset_id('AL32UTF8')));
    here the XQuery format that work fine with the OR
    A/D
    select XMLQuery ('for $a in movies/directorfilms/films/film
              where $a/studios/studio = "Gaumont"
              return $a'
         passing object_value
         returning CONTENT)"TitleX"
    from xorm;
    child element query
    select XMLQuery ('for $a in movies/directorfilms/director[dirname = "Feyder"]
              let $b:=$a/../films/film[position()=2]
              return $b/t'
         passing object_value
         returning CONTENT)"TitleX"
    from xorm;
    here is the XPath format which doesn't work
    select extract (object_value,'movies/directorfilms/films/film [studios/studio = "Gaumont"]')
    from xorm;
    select extract (object_value,'movies/directorfilms[director/dirname = "Feyder"]/films/film[position()=2]/t')
    from xorm;
    by the way all queries work fine with the CLOB or Binary XML
    many thanx Marco

  • Query works in preview, but not when added under a Query Group

    Hello Experts-
    I'm trying to use this query as one of the options under the drop down on the Supplier Search under the Supplier Management.
    Error message:
    while trying to invoke the method com.sap.odp.comp.query.QueryParamValue.getPromptParamDef() of a null
    object loaded from local variable 'paramValue' while trying to invoke the method
    com.sap.odp.comp.query.QueryParamValue.getPromptParamDef() of a null object
    loaded from local variable 'paramValue'
    The query itself is complicated, but it works fine when executed under preview.
    Wondering if any one has ever seen this behavior and knows of any typical causes?
    Thanks,
    Mike

    Thanks for the offer, Vignesh.
    Sorry, I'm currently having trouble duplicating it, but next time it happens I'll try to get some screenshots.
    I have narrowed it down to blank values in optional string fields when the query loads. I fixed (kind of) the ones I was having trouble with by rearranging the filter parameters so there would not be blanks.
    Thanks again,
    Mike

  • Query works in Access but not CF

    I wrote this query initially in access to extract the data I
    wanted out of my table. In MS Access, the query works fine, returns
    the desired data. When I run the query from my CF page, i get the
    following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft Access Driver] Too few
    parameters. Expected 2.
    Can anyone tell me why? Below is my query

    As the IIF function is a valid CF function, it may not be
    getting passed as 'plain text' to Access, instead CF
    may be attempting to compile the function and pass the
    result. If you can turn on debugging and for a short time set it to
    include the SQL being passed in error messages, you can see what is
    really going on.
    Another option is to create/save the query in the Access
    database and reference that instead of a table in your CFQUERY
    call. Since you are just running a staright query and not passing
    anything from CF (unless I am mistaken), calling the Access query
    for your results would work fine.
    <CFQUERY ...>
    SELECT * FROM myQueryName
    </CFQUERY>
    HTH,
    CR

  • Query working from sqldeveloper but not from aspx

    Hello,
    Well Im working on an application that has different queries that involve characters such as áéíóú // ÁÉÍÓÚ // ñÑ. Now the problem is that the query works just fine coming from sqldeveloper or toad but when it's called from an aspx file it returns no rows. Any idea why this might be? It only happens when the query has at least one of the above mentioned characters.
    Here you can see an example:
    SELECT DISTINCT N_DOCUMENTO FROM PROCESOS_METODOLOGIAS WHERE "LINEA DE NEGOCIO" = 'PRODUCCIÓN' AND N_DOCUMENTO IS NOT NULL ORDER BY N_DOCUMENTO ASC;I managed to "bypass" it by using LIKE for the time being
    SELECT DISTINCT N_DOCUMENTO FROM PROCESOS_METODOLOGIAS WHERE "LINEA DE NEGOCIO" LIKE '%PRODUCCI%' AND N_DOCUMENTO IS NOT NULL ORDER BY N_DOCUMENTO ASC;But I'm sure there's a solution for that. Any hints would be greatly appreciated.
    PS: Query from aspx is made with reference 10g to version 11g on server.

    Just as I finished osting this, I found out that the problem was ust that, working with the 10g reference on the 11g server version. in case anyone needs that...

  • Connect by prior working in sql but not in forms 10g hierarchical tree

    Hello Friends,
    I have the following connect by prior example which is working in sql command prompt but not in Forms 10g hierarchical tree item type. Can you please let me know why ?
    configuration: Forms 10g patchset 10.1.2.0.2 and oracle 11g database on windows 7
    SQL> SELECT 1 InitialState,
    2 level Depth,
    3 labeller NodeLabel,
    4 NULL NodeIcon,
    5 to_char(reportno) NodeValue
    6 FROM reports where formname = 'billinin.fmx' or reportno > 9999
    7 start with reportno > 9999
    8 CONNECT BY PRIOR reportno = labelno
    9 /
    INITIALSTATE DEPTH NODELABEL N NODEVALUE
    1 1 FIRST 10000
    1 2 report1 UD Label 1
    1 2 report2 UD Label 2
    1 2 report3 UD Label 3
    1 1 SECOND 10001
    1 1 THIRD 10002
    If I write this command in forms hierarchical tree, then it is working, why not the above code ?
    SQL> SELECT 1 InitialState,
    2 level Depth,
    3 labeller NodeLabel,
    4 NULL NodeIcon,
    5 to_char(reportno) NodeValue
    6 FROM reports
    7 start with reportno > 9999
    8 CONNECT BY PRIOR reportno = labelno

    Thanks Room,
    This command worked ! I will put the sample working code here. It will help you to filter the records in a tree in sql command prompt as well as in forms hierarchical tree 10g.
    SELECT 1 InitialState,
    level Depth,
    labeller NodeLabel,
    NULL NodeIcon,
    to_char(reportno) NodeValue
    FROM reports
    start with reportno > 9999
    CONNECT BY PRIOR reportno = labelno
    AND FORMNAME = :reports.testitem

  • DG4ODBC MSSQL query works in sql, but won't compile in PL/SQL.

    I'm using DG4ODBC from 11g to query a SQL Server database. The query I'm using works in a SQL DEveloper SQL worksheet and sqlplus, but won't compile in a PL/SQL procedure.
    The query is
      INSERT
      INTO crm_labels
          accountid,
          label_name,
          cir_labelcode,
          cir_knownasname,
          cir_countryidname,
          parentaccountidname,
          cir_customertypecode1,
          cir_customertypecode2,
          cir_dealstatus
      SELECT "AccountId",
        REPLACE("Name",chr(0)) label_name,
        REPLACE("Cir_labelcode",chr(0)) ,
        REPLACE("Cir_knownasname",chr(0)),
        REPLACE("cir_countryidName",chr(0)),
        REPLACE("ParentAccountIdName",chr(0)),
        "Cir_customertypecode1",
        "Cir_customertypecode2",
        "Cir_dealstatus"
      FROM "dbo"."Account"@crmsvc
      WHERE "Cir_labelcode" IS NOT NULL;The error message is
    Error(1): ORA-04052: error occurred when looking up remote object dbo.Account@CRMSVC ORA-01948: identifier's name length (34) exceeds maximum (30)I'm guessing that it is attempting to describe additional columns in the Account table.
    If I remove the dbo,
      FROM "Account"@crmsvcI get
    Error(1): ORA-04052: error occurred when looking up remote object PUBLIC.Account@CRMSVC ORA-00604: error occurred at recursive SQL level 1 ORA-28500: connection from ORACLE to a non-Oracle system returned this message: [Microsoft][ODBC SQL Server Driver][SQL Serve which is less than helpful. However, if I try to use the same query to create a materialized view, I get.
    SQL Error: ORA-04052: error occurred when looking up remote object PUBLIC.Account@CRMSVC
    ORA-00604: error occurred at recursive SQL level 1
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Address1_TimeZoneRuleVersionNu'. {42S22,NativeErr = 207}[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Address1_UTCConversionTimeZone'. {42S22,NativeErr = 207}[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Address2_TimeZoneRuleVersionNu'. {42S22,NativeErr = 207}[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Address2_UTCConversionTimeZone'. {42S22,NativeErr = 207}[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'Pias_NewLabelInDealNotificatio'. {42S22,NativeErr = 207}
    ORA-02063: preceding 2 lines from CRMSVCwhich seems to confim that in some circumstance, oracle will attempt to parse more than was asked for.
    Any work arounds?
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    DG4ODBC is also 11.2.0.3

    The gateway claims about this column "Address1_TimeZoneRuleVersionNu" which is not listed in your select list.
    When a gateway connection is established it first checks out all columns of the table you want to select to determine the data types and then it fetches the data for the columns you want to select. But there's also an exception - when you use functions the gateway is not able to translate into the syntax of the foreign database. in this case ALL columns will be fetched into the Oracle database and the result is processed locally (post processing).
    You're using replace function which won't be mapped to the foreign database equivalent using DG4ODBC so it will post process the result and fetch from all columns all the data into the Oracle database. Your table contains a column which exceeds the 30 character limitation of Oracle, hence the select will fail.
    The only work around is to create a view on the foreign database side which reduces the column name length to 30 characters or less.

  • DECODE works in SQL but not in a CURSOR

    I have simplified my problem to "DUAL":
    While in a SQL session :
    select decode(
    (select 1 from dual)
    ,(select 1 from dual)
    ,1
    ,0)
    from dual;
    Expected result: 1;
    Actual result: 1;
    Place this code in a PL/SQL block :
    declare
    X number;
    begin
    SELECT decode(
    (select 1 from dual)
    ,(select 1 from dual)
    ,1
    ,0)
    INTO X;
    FROM dual;
    end;
    Expected Result: X=1;
    Actual Result: ORA-06550 & PLS-00103 "Encountered the symbol SELECT".
    My Question:
    Why can't I place a select within a decode while in a PL/SQL block? I have also tried this in an Explicit cursor.

    This is another of those cases when the PL/SQL engine does not support a feature/syntax of the SQL engine. To do this in PL/SQL, execute it as dynamic SQL (which uses the SQL engine):
    declare
    X number;
    begin
      execute immediate
        'SELECT decode((select 1 from dual),' ||
                      '(select 1 from dual),1,0) ' ||
        '  FROM dual' into x;
      dbms_output.put_line( x );
    end;

  • Coldfusion query works in cfm but not cfc

    I have the following query that works just fine in cfm file but cannot seem to get to work in a coldfusion cfc. Any ideas.
    Select distinct include.value from xxxxx.authorprofile,
    table(authorprofile.uidinclude) include where profilename='#selectedProfile#'

    No Oracle version
    No Cold Fusion version
    No explanation of what either CFM or CFC means
    My recommendation would be that you ask the people that sold you the tool. It is, after all, their product that is the issue.

  • Multi Value PS Query Works in v2, but not v3 or 4

    I have been using the query below (and others like it) for a few years, but it didn't work on v3, and now it doesn't work on v4--which is supposed to be backwards compatible.
    Get-ADUser test01 –properties memberof, DisplayName, employeeID | Select-Object SamAccountName, DisplayName, employeeID, @{label="Groups";Expression={[string]::join(";", ($_.memberof))}} | export-csv -notype -force c:\filepath\filename.csv
    I must invoke PS with the -version 2 suffix to run it.  Any ideas?
    Thanks!

    Hi,
    Here's the adjustment I'd make:
    Get-ADUser testac1 -Properties memberOf, DisplayName, employeeID |
    Select-Object SamAccountName, DisplayName, employeeID, @{label="Groups";Expression={ ($_.memberOf | % { Get-ADGroup $_ }).Name -join ';' }} |
    Export-Csv -NoTypeInformation -Force c:\filepath\filename.csv
    EDIT: Another option:
    Get-ADUser testac1 -Properties DisplayName, employeeID |
    Select-Object SamAccountName, DisplayName, employeeID, @{N='Groups';E={(Get-ADPrincipalGroupMembership -Identity $_.SamAccountName).Name -join ';'}} |
    Export-Csv -NoTypeInformation -Force c:\filepath\filename.csv
    http://ss64.com/ps/get-adprincipalgroupmembership.html
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

Maybe you are looking for

  • Using a Variable in HttpService url attribute

    I have a dynamic url defined below public var forecastURL:String = " http://www.weather.gov/forecasts/xml/SOAP_server/ndfdSOAPclientByDay.php?lat=" + latitude + "&lon=" + longitude + "&format=12+hourly&startDate=" + todaysDate + "&numDays=" + numberD

  • Yellow screen on start up

    yellow screen on start up

  • Any custom quotation screen savers out there?

    I'd like to be able to have a random quotation as my screen saver. I've found quote screensavers out there, but none of them let you use your own collection of quotes. Does anyone know of a screen saver I can use to do this?

  • Coloring code in an includes file

    Does anyone know how to change the color of the coding in an includes file. Right now when you open one everything is black.

  • Warning to error message.

    Hi dudes, i want to activate ECM for BOM changes, i have set in OS27 t-code and when i want to create or change BOM i am getting warning message " enter change number- BOM has change history" I want to change it to error message. How to make it. Rega