CDS-11025 Error: Oracle Designer generation error with PL/SQL package

Hi friends,
We tried to generate a database package from Oracle Designer (10.1.2.6) and getting "syntax errors" but the package has no syntax errors when we copy and paste the code and compile in TOAD (10.6)
Error from Designer:
Server Generator 10.1.2.6 (Build 10.1.2.11.12) , Wed Oct 17 10:58:43 2012
Copyright (c) Oracle Corporation 1995, 2010. All rights reserved.
CDS-11025 Error: The PL/SQL within PACKAGE BODY AVP_WATER_ANALYSIS_V has syntax errors - At token 'END', around:
...te_dist.VLV_INTL_ID;
END LOOP;
Processing Complete: 1 error(s), 0 warning(s)
code snippet from the Error message:
FOR rec_update_dist IN cur_update_dist (i_anlyd_intl_id,
i_iterd_intl_id,
i_phsed_intl_id,
i_wtrc_intl_id)
LOOP
UPDATE AVP_VALVE AvpValve
SET AvpValve.DIST_FROM_EDGE = rec_update_dist.DIST_FROM_EDGE
WHERE AvpValve.ANLYD_INTL_ID = rec_update_dist.ANLYD_INTL_ID
AND AvpValve.ITERD_INTL_ID = rec_update_dist.ITERD_INTL_ID
AND AvpValve.PHSED_INTL_ID = rec_update_dist.PHSED_INTL_ID
AND AvpValve.WTRC_INTL_ID = rec_update_dist.WTRC_INTL_ID
AND AvpValve.VLV_INTL_ID = rec_update_dist.VLV_INTL_ID;
END LOOP;
Thanks for any feedback,
Jim

Found the problem.
It was an issue with the CURSOR with the SELECT ... FROM (SELECT CASE WHEN THEN ELSE END). After swithing to the DECODE statement, Designer is able to generate the package.
CASE
WHEN ISOLATION_IND = 'Y' THEN
'A'
WHEN OPERATED_IND = 'Y' THEN
'B'
ELSE
'C'
END
decode(ISOLATION_IND,'Y','A',decode(OPERATED_IND,'Y','B','C'))
However, still strange to me that Designer doesn't like the CASE as part of SELECT.
Edited by: user476620 on Oct 18, 2012 8:13 PM

Similar Messages

  • Does Oracle Designer 10g work with Oracle 10g Express?

    Guys:
    Does anybody know if Oracle Designer works with Oracle 10g Express?
    Regards,
    Mike Gorman

    Designer will not work on express edition of the Oracle Database. You will need the Standard or the Enterprise Edition of the Database.

  • Oracle Reports with PL/SQL package in before Trigger

    I have an oracle report which is set to run as a concurrent program in Oracle Apps. My before report trigger calls a pl/sql package. I am debating using errbuf and retcode, since I have not defined the pl/sql package as a concurrent program. But if I do add errbuf and retcode to the pl/sql package parameters, how do I call them in the trigger.
    function BeforeReport return boolean is
    begin
    delete from XXDK_SAMS2_MEAN_RATIO;
    delete from XXDK_SALES_RATIO_TOTALS;
    commit;
    XXDK_SAMS2_SALES_RATIO_RPT_PKG.INSERT_SALES*(:errbuf, :retcode*, :neighborhood, :salefrom, :saleto, :verfrom, :verto, :tax,
    :deed1, :deed2, :deed3, :tran1, :tran2, :tran3, :accnttype);
    return (TRUE);
    end;
    And do I add errbuf and ret code as paramters in the registered setup?

    Hi,
    please see if the code in these documents help.
    Note: 73492.1 - Creating a PL/SQL Concurrent Program in Oracle Applications
    Note: 221542.1 - Sample Code for FND_SUBMIT and FND_REQUEST API's
    Regards,
    Hussein

  • Problems with PL/SQL packages

    Hello,
    I face the following problem with PL/SQL stored procedures. The Oracle
    version is 8.0.5 on Windows NT 4. The PL/SQL package has a set of procedures and functions.
    The main procedure of the PL/SQL package is triggered from VC++ executable. If for some reason,
    an exception is caught in the stored procedure (like no_data_found
    exception), then the following problem occurs.
    If we try to trigger the stored procedure again through the VC++ executable,
    the variables in the stored procedures have the values as in the previous
    execution. They are not getting initialised. (The same database connection
    is used in VC++ executable).
    Currently, only if a new connection to the database is used , the problem is
    solved.
    Also, change in the input parameters of the procedure is not reflected, once the procedure fails because of any exception. Only the input which was given during the time of execution when the procedure failed,is considered.
    What could be the reason for this problem and how can this be corrected?
    Please send in your suggestions.
    Thanks and Regards,
    Ramya Priya
    null

    Hi Keith,
    I am connecting to the database as the package owner..
    I have noticed earlier that I have problems when capturing triggers also.. The content of one large trigger contains 36371 characters and when capturing it from DB, the content was truncated to 28020 characters in Designer.
    Our ideas with capturing the DB packages/procedures were to use the Designer as version control system.
    We wanted to have all objects used in a project in Designer.. entities, tables, triggers, packages, procedures, Forms files, etc. in order to make a configuration for a project release.
    Thank you,
    Claudia

  • Help with Java.Sql package download

    I am compiling some java files with the following :
    import java.sql.*
    and getting errors. I realize I need the java.sql package. Can anyone help me by pointing out where I can download the package?
    Thanks.
    Murthy Gandikota

    This package comes with the JDK. what are your specific problems.

  • Problem with pl/sql package

    hi,
    i have requirement where i have to create a PL/SQL package which takes two parameters from procedure where i shd give fromdate and todate as parameter below is the code i am getting two errors
    create or replace PACKAGE AgentTimeReport_XDO_pkg AS
    PROCEDURE AgentTimeReport_Demo_RTF(o_errbuf OUT VARCHAR2
                   ,o_retcode OUT VARCHAR2,p_fromdate IN VARCHAR2,p_todate IN VARCHAR2 );
    END AgentTimeReport_XDO_pkg
    CREATE OR REPLACE
    PACKAGE BODY AGENTTIMEREPORT_XDO_PKG AS
    PROCEDURE AgentTimeReport_Demo_RTF(o_errbuf OUT VARCHAR2
                   ,o_retcode OUT VARCHAR2,p_fromdate IN
    VARCHAR2,p_todate IN VARCHAR2 ) AS
    cursor cs_agenttime
    is
    SELECT
    incident.Incident_Number as ServiceRequestNumber,
    TO_CHAR (incident.incident_date,'DD-MON-YYYY') as ServiceRequestDate,
    incident.Summary as Summary,
    agenttime.agentname as AgentName,
    to_char(agenttime.agentstarttime,'DD-MM-YYYY HH24:MI') as StartTime,
    to_char(to_date('00:00:00','HH24:MI:SS') +
    (agenttime.endtime-agenttime.agentstarttime), 'HH24:MI') as TimeSpent
    FROM cs_incidents_all_b incident,cs_agenttime_agv agenttime
    WHERE agenttime.incident_id=incident.incident_id
    AND incident.incident_date between to_date(:p_fromdate,'DD-MON-YYYY')
    AND to_date(:p_todate,'DD-MON-YYYY');
    BEGIN
    /*First line of XML data should be ‘<?xml version="1.0" encoding='utf-8'?>’*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0" encoding="utf-8"?>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<AGENTTIME>');
    FOR cs_agent IN cs_agenttime
    LOOP
    /*For each record create a group tag <G_AGENT_TIME> at the start*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<G_AGENT_TIME>');
    /*Embed data between XML tags for ex:- <EMP_NAME>Abeesh</EMP_NAME>*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_NUMBER>' ||
    cs_agent.ServiceRequestNumber
    || '</SERVICEREQUEST_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_DATE>' ||
    cs_agent.ServiceRequestDate ||
    '</SERVICEREQUEST_DATE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<START_TIME>' || cs_agent.StartTime
    ||'</START_TIME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<TIME_SPENT>' || cs_agent.TimeSpent
    ||'</TIME_SPENT>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</G_AGENT_TIME>');
    END LOOP;
    /*Finally Close the starting Report tag*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</AGENTTIME>');
    END AgentTimeReport_Demo_RTF;
    END AGENTTIMEREPORT_XDO_PKG;
    Error(20,44): PLS-00049: bad bind variable 'P_FROMDATE'
    Error(21,13): PLS-00049: bad bind variable 'P_TODATE'
    Help me out
    naveen

    create or replace PACKAGE AgentTimeReport_XDO_pkg AS
    PROCEDURE AgentTimeReport_Demo_RTF(o_errbuf OUT VARCHAR2
    ,o_retcode OUT VARCHAR2,p_fromdate IN VARCHAR2,p_todate IN VARCHAR2 );
    END AgentTimeReport_XDO_pkg
    CREATE OR REPLACE
    PACKAGE BODY AGENTTIMEREPORT_XDO_PKG
    AS
    PROCEDURE AgentTimeReport_Demo_RTF
        o_errbuf OUT VARCHAR2 ,
        o_retcode OUT VARCHAR2,
        p_fromdate IN VARCHAR2,
        p_todate   IN VARCHAR2 )
    AS
      CURSOR cs_agenttime(p_fromdate VARCHAR2,p_todate VARCHAR2)
      IS
         SELECT incident.Incident_Number                                                                      AS ServiceRequestNumber,
          TO_CHAR (incident.incident_date,'DD-MON-YYYY')                                                      AS ServiceRequestDate  ,
          incident.Summary                                                                                    AS Summary             ,
          agenttime.agentname                                                                                 AS AgentName           ,
          TO_CHAR(agenttime.agentstarttime,'DD-MM-YYYY HH24:MI')                                              AS StartTime           ,
          TO_CHAR(to_date('00:00:00','HH24:MI:SS') + (agenttime.endtime-agenttime.agentstarttime), 'HH24:MI') AS TimeSpent
           FROM cs_incidents_all_b incident,
          cs_agenttime_agv agenttime
          WHERE agenttime.incident_id=incident.incident_id
        AND incident.incident_date BETWEEN to_date(p_fromdate,'DD-MON-YYYY') AND to_date(p_todate,'DD-MON-YYYY');
    BEGIN
      /*First line of XML data should be ‘<?xml version="1.0" encoding='utf-8'?>’*/
      FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0" encoding="utf-8"?>');
      FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<AGENTTIME>');
      FOR cs_agent IN cs_agenttime(p_fromdate,p_todate)
      LOOP
        /*For each record create a group tag <G_AGENT_TIME> at the start*/
        FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<G_AGENT_TIME>');
        /*Embed data between XML tags for ex:- <EMP_NAME>Abeesh</EMP_NAME>*/
        FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_NUMBER>' || cs_agent.ServiceRequestNumber '</SERVICEREQUEST_NUMBER>');
        FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_DATE>' cs_agent.ServiceRequestDate || '</SERVICEREQUEST_DATE>');
        FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<START_TIME>' || cs_agent.StartTime ||'</START_TIME>');
        FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<TIME_SPENT>' || cs_agent.TimeSpent ||'</TIME_SPENT>');
        FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</G_AGENT_TIME>');
      END LOOP;
      /*Finally Close the starting Report tag*/
      FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</AGENTTIME>');
    END AgentTimeReport_Demo_RTF;
    END AGENTTIMEREPORT_XDO_PKG;Ravi Kumar

  • Working with PL/SQL Packages and Extension SDK

    Hi,
    I'm working on an Extension for SQL Developer. I want this Extension to wrap my PL/SQL Packages.
    The Situation:
    I got an Oracle DB 10g Revision 1 so I can't use the dbms_ddl call to wrap my Packages. I have to use the wrap.exe Utility.
    When I right click on a PL/SQL Package I can choose "Wrap it!" and the Extension does the following: It implements an oracle.ide.controller.ContextMenuListener and when the handleEvent function is called I cast the Context Parameter to a oracle.dbtools.raptor.navigator.plsql.PlSqlNode Object.
    Through the getSource function I get source code, print it into a file wrap it and write it back to the database.
    But I have to call this for both the package body and the package header. How can I got the header if my oracle.dbtools.raptor.navigator.plsql.PlSqlNode Object is the body or the body if my oracle.dbtools.raptor.navigator.plsql.PlSqlNode Object is the header with the Extension SDK? There has to be a Way, cause there is also a standart function called "Save Package Spec and Body".
    Can someone help me, please. :-)
    Thanks
    Andi
    P.S.: I'm sorry for my bad english. :(

    Greetings,
    If you are using the HTP/HTF procedures/functions then the following code does what you are asking:
    htp.formOpen( curl => 'schema.package.procedure_name', cmethod => 'post');
    which would generate the following HTML:
    <FORM ACTION='schema.package.procedure_name' METHOD="post">
    The names of <INPUT> items between the <FORM> tags should match parameter names in your PL/SQL procedure.
    Thanks,
    Dale

  • Invoke oracle report 10g from database pl/sql package

    Hi
    Is there a way that i can invoke an oracle report 10g from the database pl/sql package? I am working on a requirement that needs to generate a report when one of the criteria is not met.
    Please suggest me on this.

    Thanks for the info.
    I have a scenario where i need to fetch members details like name , email address and so on from the mainframes on the oracle database. Then on the oracle database i need to check if they have a email address or not. If yes then i need to generate a notice and mail it to them. If they don't have an email address, i'll have to print that out in a some centralized location.
    By the way, the notice was developed using oracle reports 10g.
    Now i am developing a pl/sql package which will do the address validation but i didn't know how to call a oracle report to generate the notice in pl/sql procedure.
    As suggested i will try with dbms scheduler and see if that works for me.

  • Error with PL/SQL package

    Hi ,
    I have written a package specification given below :
    create or replace PACKAGE BILL_PACKAGE AS
    storeId varchar2(5);
    startDate varchar2(10);
    FUNCTION F_Bill(str_id IN tel_tr_ltm_bl_py.id_str_rt%TYPE,ws_id IN tel_tr_ltm_bl_py.id_ws%TYPE,v_date IN tel_tr_ltm_bl_py.dc_dy_bsn%TYPE) RETURN boolean;
    END BILLPAYPACKAGE;
    I have written the package body also .Now when i am calling the function F_Bill , I am gettin this error :
    PLS-00201: identifier 'BILL_PACKAGE.STARTDATE' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 3, column 1:
    PLS-00201: identifier 'BILL_PACKAGE.STOREID' must be declared
    ORA-06550: line 3, column 1:
    PL/SQL: Statement ignored
    This same package is running fine on another local database.
    What could be the reason for this?
    Is this an acess issue ?In db which we are getting an error , we are using a user 'ConUser' to connect to a schema 'b_owner'.
    How can we check this if this is a privilege issue.
    Thanks!

    >
    This same package is running fine on another local database.
    What could be the reason for this?
    Is this an acess issue ?In db which we are getting an error , we are using a user 'ConUser' to connect to a schema 'b_owner'.
    How can we check this if this is a privilege issue.The user "ConUSer" needs execute privileges for the pacakge.
    Also it depends how he calls the package or the variables in it.
    You can check the privs with
    select * from all_tab_privs where table_name = 'BILL_PACKAGE';this must be run as user ConUser.
    You could also have a problem with name resolution. The name of the package is not BILL_PACKAGE. It is "b_owner.BILL_PACKAGE".
    If you omit the schema name then the current user is tried. So if you call BILL_PACKAGE then this is translated into "ConUSer.BILL_PACKAGE".
    You can change this by creating a synonym like
    create synonym bill_package for b_owner.bill_package;

  • Conversion of code in oracle into code compatible with MS-SQL server-2005

    Hello ,
    i am trying to execute this oracle query in MS -SQL server-2005 and it gives syntax errors. After correcting few i am not able to bug out this error for FOREIGN KEY.
    Here's the code :
    create table saving_deposit
    (ac_no varchar(11)constraint fk_saving_deposit references account_master(ac_no)on delete cascade,
    deposit_amt int,
    deposit_date Date,
    mode_of_deposit varchar(10),
    cheque_no varchar(15),
    draft_no varchar(15 ),
    bank_name varchar(20),
    status_update varchar(15),
    remarks varchar(10));
    And the error Msg 1767, Level 16, State 0, Line 1
    Foreign key 'fk_saving_deposit' references invalid table 'account_master'.
    Msg 1750, Level 16, State 0, Line 1
    Could not create constraint. See previous errors.
    Anyone please help me correct this.
    Thanks in advance .

    >
    i am trying to execute this oracle query in MS -SQL server-2005 and it gives syntax errors.
    After correcting few i am not able to bug out this error for FOREIGN KEY.
    Here's the code :
    create table saving_deposit
    (ac_no varchar(11)constraint fk_saving_deposit references account_master(ac_no)on delete cascade,
    deposit_amt int,
    deposit_date Date,
    mode_of_deposit varchar(10),
    cheque_no varchar(15),
    draft_no varchar(15 ),
    bank_name varchar(20),
    status_update varchar(15),
    remarks varchar(10));Can't test this - don't run Windows - but maybe (it's just a thought really)
    CREATE TABLE Saving_deposit
    ac_no VARCHAR2(11),
    ALTER TABLE ADD CONSTRAINT... <SQL Server syntax>
    I know it shouldn't matter - but who knows?
    Paul...

  • Question about Oracle Database 11g: Program with PL/SQL

    Hello,
    I've read that:
    This course is a combination of Oracle Database 11g: PL/SQL Fundamentals and Oracle Database 11g: Develop PL/SQL Program Units courses.
    In order to preparing for this exam, i should read the student guide, so there are 4 pdf files. One is Oracle Database 11g: PL/SQL Fundamentals, and the other 3 are regarding to Oracle Database 11g: Develop PL/SQL Program Units (volume I, II and III). My question is, regarding to this last one (Oracle Database 11g: Develop PL/SQL Program Units), which volume should i read? I saw that volume I has 400+ pages, and the IIIrd ~80.
    Which document should i read? What's the difference between them?
    Thanks!

    Passing the exam and becoming certified are not a matter of simply reading a book or taking a training class. While books and classroom materials as well as in-class training are all important steps in preparing for an exam, experience and research are just as important. I cannot tell you that there are 53 questions on the exam and every single question maps directly back to page 13, paragraph 3 in XX book. However, If you have the classroom material, and you have the list of exam topics, you should be able to find most of the information you need. In some cases, if you are not completely familiar with a specific topic, or you don't feel like the information in the book gives you all the information you need, you may need to do a little additional research. This is all part of preparing for an exam. This process is what makes you successful as a certified professional.
    Your focus seems to be solely on the course materials that you have and what volumes and chapters you should read. I'm trying to give you a different perspective - preparing for an exam is not necessarily about taking one course or reading one book and being ready. You need to review the exam topics and be sure that you are familiar with each topic.
    Regards,
    Brandye Barrington

  • Oracl concurrent programme or a pl/sql package

    Hello all,
    I have a concurrent programme which is calling a package. How can i debug it? I mean,as the programme takes a day to run, i need to know where exactly in the package is the control...
    Any help is appreciated.
    Thanks

    there are many ways to debug a code. one is to run the code manually to check for any errors that might be thrown. second if there are no oracle error and if you are looking for logic or data error you might want to use [dbms_output.put_line()|http://www.psoug.org/reference/dbms_output.html] package to each line of code to see what might your code is returning a data. hope this helps.

  • Working with PL/SQL packages and portlets

    I have a package which is called from my portlet SHOW procedure. In that package I have a form with checkboxes and text items. Once the form's submit button is clicked I only want to execute the procedure within the package.
    Please let me know how can I do it? I don't need to leave the page just execute the procedure that will update the records in the db tables.

    Greetings,
    If you are using the HTP/HTF procedures/functions then the following code does what you are asking:
    htp.formOpen( curl => 'schema.package.procedure_name', cmethod => 'post');
    which would generate the following HTML:
    <FORM ACTION='schema.package.procedure_name' METHOD="post">
    The names of <INPUT> items between the <FORM> tags should match parameter names in your PL/SQL procedure.
    Thanks,
    Dale

  • VLD-1141: Internal error during mapping generation.

    I am getting the "VLD-1141: Internal error during mapping generation" error when deploying a mapping. This mapping was previously working fine. As part of a re-factoring effort, for all the underlying tables and views, we replace 2 existing columns with a new column. All the objects were successfully re-imported and synchronized in the mapping. The mapping is using Mapping Input Parameter, Lookups, Expression Transformations, Splitter, Set Operator, Source & Target Tables. All these transformation were part of the earlier working version of the mapping.
    On doing validation within the mapping, I get a success message followed by 4 warning for the Lookup Condition on key Lookup does not contain a complete unique key. Before the re-factoring effort, I was getting the same 4 warning messages, however the mapping was executing correctly.
    When I do Generate within the mapping, I get the following message:
    Code cannot be generated.
    Click the message tab for details.
    In the Design Center, when I do a validation on the mapping I get the following error:
    VLD-1141: Internal error during mapping generation.
    java.lang.NullPointerException
    at oracle.wh.service.impl.mapping.component.Sequence.getSequenceExpressions(Sequence.java:138)
    at oracle.wh.service.impl.mapping.component.Sequence.doSequenceValidation(Sequence.java:239)
    at oracle.wh.service.impl.mapping.component.entity.EntitySqlDelegate.prepareOutputContext2(EntitySqlDelegate.java:123)
    at oracle.wh.service.impl.mapping.component.entity.EntitySqlDelegate.prepareOutputContext2(EntitySqlDelegate.java:97)
    at oracle.wh.service.impl.mapping.component.entity.EntitySqlDelegate.prepareOutputContext(EntitySqlDelegate.java:78)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:240)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleSetBasedInternal(PlSqlGenerationMediator.java:2108)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleSetBased(PlSqlGenerationMediator.java:2090)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assemble(PlSqlGenerationMediator.java:541)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:798)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:335)
    at oracle.wh.service.impl.mapping.generation.WBDeployableMappingGenerator.generate(WBDeployableMappingGenerator.java:102)
    at oracle.wh.service.impl.generation.common.WBGenerationService.generateCode(WBGenerationService.java:433)
    at oracle.wh.service.impl.generation.common.WBGenerationService.generateCode(WBGenerationService.java:311)
    at oracle.wh.service.impl.generation.service.WhValidationGenerationTransaction.run(WhValidationGenerationTransaction.java:251)
    Any help in this regards would be appreciated.
    Naval

    Hi,
    I think your mapping is corrupted by converting two columns to one. The owb has always a problem if you change the structure of a table which is bound to a table operator. The way to avoid this is to drop the table operator after changing the table in the table editor and recreate it with the changed table definition.
    Make a test: select the new attribut in the table operator and look left on the configuration window. To which table and attribute it's bound?
    Regards,
    Detlef

  • 'Missing select' error for update statement using WITH clause

    Hi,
    I am getting the below error for update statement using WITH clause
    SQL Error: ORA-00928: missing SELECT keyword
      UPDATE A
      set A.col1 = 'val1'
         where
      A.col2 IN (
      WITH D AS
      SELECT col2 FROM
      (SELECT col2, MIN(datecol) col3 FROM DS
      WHERE <conditions>
        GROUP BY PATIENT) D2
      WHERE
      <conditions on A.col4 and D2.col3>

    Hi,
    The format of a query using WITH is:
    WITH  d  AS
        SELECT  ...  -- sub_query
    SELECT  ...   -- main query
    You don't have a main query.  The keyword FROM has to come immediately after the right ')' that ends the last WITH clause sub-query.
    That explains the problem based on what you posted.  I can't tell if the real problem is in the conditions that you didn't post.
    I hope this answers your question.
    If not, post a complete test script that people can run to re-create the problem and test their ideas.  Include a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

Maybe you are looking for

  • Problem with file upload: File to big...

    Hi, when I try to upload a file of 6MB I get an error that the file is to big. I changed the web.xml but maybe I forgot something? I use Jdeveloper 11.1.1.2.0 This is in my web.xml: <context-param> <param-name>oracle.adf.view.faces.UPLOAD_MAX_MEMORY<

  • Mail sender adress not in SHeaderFrom if length more than 50 characters

    Hi, we 're using the mail sender adapter in PI 7.00 to get attachments as XIPAYLOAD from our mailserver. Also we get the sender address in SHeaderFrom. Now we have the problem, if the sender address is larger then 50 character it is NOT stored in SHe

  • Blind carbon copy in email templates?

    Hello, how can I use blind carbon copy (bcc) in email templates? I added the field to the E-Mail Template und modify the waveset.dtd, but this is not enough. How can I use a BCC to an email template on IDM? Thanks

  • Clarification regarding tnsnames.ora

    Hi all I have following tnsnames.ora and is working fine PROD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 152.144.XXX.XXX)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PROD.haunting.com) now i want to cha

  • How do I download an app purchase onto my iPad?

    I purchased an in-app upgrade that didn't download but I was charged anyway.  When I sent to my account to report a problem, I got a message that I had to download it from iCloud.  When I go to iCloud, I can't find anything that has to do with downlo