IF (SELECT....) END IF; syntax issues

I have that quite staight forward piece of sql here:
IF
(SELECT COUNT(DISTINCT FLOOR(CAST(x1 as float))) FROM SOURCEArchive) > 20 THEN
     DELETE SOURCEArchive
END IF
now the error is:
PLS-00103: Encountered the symbol ")" when expecting one of the following: . , @ ; for <an identifier> <a double-quoted delimited-identifier> group having intersect minus order partition start subpartition union where connect SAMPLE_
What am I doing wrong here. Is it invalid to have a select after the IF...?
when I do
IF
222 > 20 THEN
SELECT AData FROM SOURCEEArchive      
END IF;
I get PL/SQL: ORA-00933: SQL command not properly ended
Edited by: metalray on 08-May-2009 07:25

metalray wrote:
I have that quite staight forward piece of sql here:Straight forward but wrong.
IF
(SELECT COUNT(DISTINCT FLOOR(CAST(x1 as float))) FROM SOURCEArchive) > 20 THEN
     DELETE SOURCEArchive
END IF
------------------------------------------------------------Try:
declare
  v_cnt NUMBER;
begin
  SELECT COUNT(DISTINCT FLOOR(CAST(x1 as float))) INTO v_cnt FROM SOURCEArchive;
  IF v_cnt > 20 THEN
    DELETE FROM SourceArchive;
  END IF;
end;

Similar Messages

  • Dynamic SQL from within DML - merging syntax issue #2

    Further to my previous thread on a SQL - DML merging syntax issue, I have another problem with multiple conditions in the WHERE-clause:
    vrb _retval decimal
    vrb _val1 text
    vrb _val2 text
    _val1 = 'value1'
    _val2 = 'value2'
    SQL SELECT DIM1_ATTR1 FROM MYSCHEMA.DIM1_DIM WHERE COL1 = :_val1, AND COL2 = :_val2, INTO :_retval
    The above SQL will return NA. If I use the text literals instead of the OLAP variables, the query just runs fine. Also, with a single condition (on COL1 only) the query returns the expected value.
    A note in the help states that OLAP DML objects should clearly be sperated from the rest of the SQL but does not say how. I am using a colon before and a comma after as without them the line would not compile. I could not find any example that would use multiple conditions in the WHERE-clause however the help text indicates that it is possible.
    Please help me, how.
    Regards,
    Csaba
    Windows, Oracle10gRel2 Ver. 10.2.0.1.0 eversion: 84090

    It does work, although I applied the finishing touch by removing the commas as well!
    Thanks a lot! Good job!
    Could you please have a look at issue #1 too? :-)
    Regards,
    Csaba

  • No data available,data selection ended

    Hi Experts,
    In BI 7.4 quality system when I did the infopackage load for 0HR_PA_PD_1 (FULL) it is showing nodata available selection ended  in detail tab.
    But I have data in RSA3.
    when I saw the job in SM 37 in ECC Quality it is showing result of customer enhancement 0 records.
    pfa for the same.
    Thanks,
    Sathish

    Hi Sathish,
    Please verify of there is any filter or routine in the infopackage.
    Regards,
    Ashvin

  • Documaker 12.1 XPath Syntax Issue

    We are moving to Documaker Studio 12.1 from Docucreate 11.0. So, I am importing few forms into 12.1 and doing test runs. I ran into a XPath syntax issue. We use XPath manual triggers to trigger forms and sections.
    In 11.0, the following trigger (use as Search Mask (True/False) in Manual Triggers) works perfectly fine. But it doesn't work in 12.1
    *!/Acord/Bills/Form/[FormNumber='U61']FormNumber*
    In 12.1, I have to remove the "/" present before "[" to make it work - as shown below.
    *!/Acord/Bills/Form[FormNumber='U61']FormNumber*
    Is there a way we can make the old syntax work with 12.1 as well? It would save us from changing thousands of Form and Section Triggers?
    Thank you,
    SGov.

    I suspect the short answer is No. The initial xPath syntax appears invalid as you would not define a slash between the node and the attribute that belongs to the node. The fact that it somehow succeeded was an anomaly that must have been corrected.

  • Connect Selected End Point Question

    Hi everyone:
    I am trying to connect selected end points. I have drawn my open path and Illustrator is not letting me select my two anchor points. I keep getting selections of the entire path. So, of course, the connect selected end points icon is greyed out. I have tried selecting the two endpoints with the lasso and variations of the direct select and select and they all select parts of or the entire path. Does anyone know how to isolate the selection to just the two end points? Thanks so much for your help!

    ALWAYS state WHAT VERSION you are using. No fewer than six different versions of Illustrator are discussed here, and functionality changes between versions.
    function(){return A.apply(null,[this].concat($A(arguments)))}
    I am trying to connect selected end points. I have drawn my open path and Illustrator is not letting me select my two anchor points. I keep getting selections of the entire path.
    (Emphasis mine.)
    The way you stated this suggests you are trying to close a single open path, not join two open paths. If so, selecting the entire path is what you want. With the whole path selected, key Ctrl-J. The Join command also closes an open path.
    JET

  • Help with the error message that ADE is not allowed to copy a book onto my Nook. I have tried authorizing and unauthorizing many times--at wits end with this issue.

    Help with the error message that ADE is not allowed to copy a book onto my Nook. I have tried authorizing and unauthorizing many times--at wits end with this issue.

    I too am having the same problem. I have a new hard drive that was imaged from the old one and I'm trying to side load a book to my Nook Simple Touch.. I first installed ADE 4 then borrowed and downloaded a book from Overdrive. I tried a few times to delete and reauthorize both the computer and the Nook and each time I get an authorization error when I try to side load the book. I then found on the Nook forum that the Simple Touch and ADE 4 don't get along. So I uninstalled ADE 4 and installed ADE 3.
    I then followed this recommended procedure found on the forum: I deleted the Digital Editions folder from my Nook, launched ADE 3 and authorized the computer, then connected the Nook. For a few seconds, hovering the mouse over the setting icon for the Nook displayed everything on the context menu grayed out. But then it showed the context menu and I was able to display the Nook's authorization, which was the same as the computer's. Still get the same error side loading the book. Deleting and reauthorizing doesn't help.  And the Digital Editions folder is still missing from the Nook.

  • End Routine Implementation Issue

    Hi Colleagues,
    I want to implemente an end routine in order to populate the material type from the material master data.
    The source structure of my transformation contain the material.
    The target structure of my transformation contain the material and material type infoobject.
    I have implemented the following source code in the end routine based on the sdn doc below :
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e73bfc19-0e01-0010-23bc-ef0ad53f2fab
    My source code is :
    Global data declaration
    List of all Employees and corresponding sales organisation
        DATA: BEGIN OF I_S_MATERIAL_TYPE,
          MATERIAL TYPE /BI0/PMATERIAL-MATERIAL,
          MATERIAL_TYPE TYPE /BI0/PMATERIAL-MATL_TYPE,
        END OF I_S_MATERIAL_TYPE.
        DATA: i_t_material_type like table of I_S_material_type.
      METHOD end_routine.
    *=== Segments ===
        FIELD-SYMBOLS:
          <RESULT_FIELDS>    TYPE tys_TG_1.
        DATA:
          MONITOR_REC     TYPE rstmonitor.
    $$ begin of routine - insert your code only below this line        -
    local data declaration
        data: e_s_result type tys_TG_1.
        data: e_t_result type tyt_TG_1.
        data: material_type like e_s_result-matl_type.
    read master data in local table once
          SELECT MATERIAL MATL_TYPE FROM /BI0/PMATERIAL
            into corresponding fields of table i_t_material_type
            WHERE  MATERIAL  = <RESULT_FIELDS>-material
            AND    objvers  = 'A'.
    Do the calculation and add the new rows
    *>>
    loop over the input result data package
        loop at RESULT_PACKAGE into e_s_result.
    get Counter
          read table i_t_material_type into e_t_result with key
          material = e_s_result-material.
             move material_type to e_s_result-matl_type.
             append e_s_result to e_t_result.
        endloop.
    add the lines to the output package
        refresh RESULT_PACKAGE.
        move e_t_result[] to RESULT_PACKAGE[].
    $$ end of routine - insert your code only before this line -
      ENDMETHOD. "end_routine
    $$ end of routine - insert your code only before this line         -
    ENDMETHOD.                    "end_routine
    I have the following error message :
    E:"E_T_RESULT" cannot e converted to the line type of
    "ME->I_T_MATERIAL_TYPE"
    Question :
    Can someone explain me what is the issue in my source code ?
    Cheers,

    Hi Vijay,
    Thanks for your precious answer !
    I have modified the matl_type - but I still have the same error message on the read table coding part.
    Error message: E:"E_T_RESULT" cannot be converted to the line type of
                                  "ME->I_T_MATL_TYPE".
    Global data declaration
    List of all Employees and corresponding sales organisation
        DATA:
        BEGIN OF I_S_MATL_TYPE,
            MATERIAL  TYPE /BI0/PMATERIAL-MATERIAL,
            MATL_TYPE TYPE /BI0/PMATERIAL-MATL_TYPE,
        END OF I_S_MATL_TYPE.
        DATA: i_t_matl_type like table of I_S_matl_type.
    local data declaration
        data: e_s_result type tys_TG_1.
        data: e_t_result type tyt_TG_1.
        data: matl_type like e_s_result-matl_type.
    read master data in local table once
        SELECT MATERIAL MATL_TYPE FROM /BI0/PMATERIAL
        into corresponding fields of table i_t_matl_type
        WHERE MATERIAL = <RESULT_FIELDS>-material
        AND objvers = 'A'.
    Do the calculation and add the new rows
    loop over the input result data package
        loop at RESULT_PACKAGE assigning <result_fields>.
    Error message: E:"E_T_RESULT" cannot be converted to the line type of*
                                 "ME->I_T_MATL_TYPE".*
          read table i_t_matl_type into e_t_result with key
          material = e_s_result-material.
          <RESULT_FIELDS>-matl_type = i_t_matl_type-matl_type
          Modify result_pacakage from <result_fields>
        endloop.

  • 'How to..use reporting variables in BPS'  syntax issue

    Hi,
    I am implementing the white paper 'How to...use reporting variables in BW-BPS' and I am getting a syntax error in the include YBW_BPS_VAR_READ. The error indicates 'Statement is not accessible' for my line:
    SELECT SINGLE * FROM ybw_bps_var_map
    ybw_bps_var_map being my transparent table as described in the white paper.
    I have never seen such a syntax error, has anyone had the same issue? My code is the one in the white paper.
    Thanks for any help.
    David

    Hi David,
    I have the coding up and running. I have not seen this error before and don't know how to resolve it. If you cut&paste it from the PDF, then maybe some special characters got pasted into the ABAP editor. Try to delete the line and type it in manually.
    Regards
    Marc
    SAP NetWeaver RIG

  • Select end (Shift+End) in Dreamweaver (MAC) not working anymore

    Hi all,
    all of a sudden it seems that my DreamWeaver shortcut Shift+End is not working anymore to select text till the end of the line. Shift+Home is still working. I'm pretty sure I've been using it till the day before yesterday. I noticed the shortcut not working on my macbook yesterday, but since that was a clean install I thought that might have been the issue. But today I noticed the same on my working station which has been installed for a couple of days now.
    Is anyone else facing this problem? I tried re-adding the shortcut, but that doesn't work at all..
    Joshua

    Seemed to have fixed itself.. all of a sudden it is working again..    

  • Syntax issue when having more than 20 warnings

    Hello,
    when having more than 20 warnings in a compilation unit (package, procedure ...),
    SQL Developer ( version 1.5.0.53)
    doesn't always flag an error (like, for example, a misspelled local variable),
    so instead of a compile-time error a runtime error is generated.
    I tried to reproduce the situation and here is a simplified case where i've
    encountered the same error.
    Best regards
    Alexander Andris, Prague
    [email protected]
    CREATE OR REPLACE
    PROCEDURE PROC AS
    l_arg1 pls_integer;
    l_arg2 pls_integer;
    -- declarations which issue PLW-07204 warnings ...( 20 or more ...)
    cursor c1 is
    select sysdate from dual
    where trunc (sysdate) = trunc(sysdate);
    cursor c2 is
    select sysdate from dual
    where trunc (sysdate) = trunc(sysdate);
    cursor c3 is
    select sysdate from dual
    where trunc (sysdate) = trunc(sysdate);
    cursor c4 is
    select sysdate from dual
    where trunc (sysdate) = trunc(sysdate);
    cursor c5 is
    select sysdate from dual
    where trunc (sysdate) = trunc(sysdate);
    cursor c6 is
    select sysdate from dual
    where trunc (sysdate) = trunc(sysdate);
    procedure proc1 is
    begin
    null;
    end;
    BEGIN
    l_arg_notdef := 42;
    -- next line would not be displayed.
    dbms_output.put_line (
    'Error in SQLDev 1.5.0 - error on the assignment line not flagged '
    || ' by the compiler when preceded by > 20 warnings ...' ||
    ' (Error not shown in navigator.Same behavior also in SQLDev 1.21 ...).');
    -- So, when lines 5 - 23 are commented out then line 31 is flagged as an
    -- error (PLS-00201), otherwise not (runtime error only).
    -- When working on a large package with more than 20 warnings and a lot of
    -- code, to find an error like a misspelled local variable one would need to
    -- a different IDE.Hope it is not difficult to fix this quickly ...
    -- Details:
    -- client platform: Windows XP
    -- SQLDev: Version 1.5.0.53 Build MAIN-53.38
    -- db.: Oracle 10.2 on Windows
    END PROC;

    Unfortunately, that's the intended behaviour.
    After complaining about errors not being reported in previous versions, they did add the "Only first 20 issues are reported" warning, but unless you know that can happen, almost nobody will notice.
    I keep advocating for reporting errors on top, next any warnings, until having used up the 20 spaces. If necessary, they could compile first with warnings turned off, then again with warnings turned on.
    I don't think I ever put a request for this on the SQL Developer Exchange, so take a look there if you're up for it.
    Also mind you can turn the warnings off yourself inside the preferences, so they won't bother (nor help) you again.
    Regards,
    K.

  • Select list with submit issue when they are referred in report region query

    I have a page with a reporting region. Same region also has 3 different list items and depending on the value selected in each item, the report is refreshed. All the 3 list items are "Select list submit with submit"
    Out of 3 items, 2 (say item2 and item3) are populated through dynamic LOV using the value in item1.
    Additionally, when I select a default "ALL" value in in item1, I ignore values in item2 and item3.
    With this background, I am a following issue:
    1. I select a value other than Default value in item1 which filters the report.
    2. Then I select some value in item2 which further shrinks the reports.
    3. Now if I go back to item1 and select the default "All" value, the report is not refreshed with the new values of item1, item2 and item3. But it still shows the report based on value of item2 that I selected in step2.
    How do I set the value of item2/item3 to null if value of item1 is default which is "All"
    Any word of advise will be a great help!
    Thanks,
    Girish

    Hi,
    Make two computations each with the computation text NULL; or
    Make one process with code like:
    BEGIN
    :P1_ITEM2 := NULL;
    :P1_ITEM3 := NULL;
    END;With the condition "Value of Item in Expression 1 = Expression 2"
    Expression 1: P1_ITEM1
    Expression 2: ALL
    (or whatever the return value of ALL is...remember that this is case sensitive)
    Mike

  • Systinet UDDI - SOA SUITE 11G (Dynamic SOAP end point lookup Issues)

    Hi,
    We are using Systinet as our UDDI product and trying to use UDDI lookup in our BPEL process as well. I have completed the below tasks
    1) Configured the Systinet UDDI Inquiry URL and the development soap endpoint in the SOA Infrastructure Common properties in soa server 11g. Did not provide the user-id and
    password.
    2) Restarted the servers so that the changes are effective.
    3) In Jdeveloper 11g, Created a connection with UDDI Registry.
    4) Created a sample BPEL process using Jdeveloper 11g that calls an already registered webservice in UDDI. This lookup web service has 3 different end
    points (Dev, QA and Prod) and a binding of wsdlDeployment use type. The binding points to the actual wsdl Physical location.
    1)     http://wasd.psc.com/SBDO.AD/services/Authez
    2)     http://wasq.psc.com/SBDO.AD/services/Authez
    3)     http://wasp.psc.com/SBDO.AD/services/Authez
    4)     http://wasd.psc.com/SBDO.AD/services/Authez/wsdl/Authez.wsdl
    5) In the BPEL created the partner link for this webservice using UDDI Registry and selected “Dynamically resolve the SOAP endpoint location at runtime”
    option.
    6) Generated the Configuration plan by right clicking the Composite.xml
    7) Modified the configuration plan and added a new property name “endpointURL” that points to the development endpoint (referred in Point # 4). Pasting the
    required portion of config plan for easy reference.
    </component>-->
    <reference name="PartnerLink_1_2">
         <!--Add search and replace rules for the binding properties-->
         <binding type="ws">
         <attribute name="port">
    <replace>http://ws.ad.sbdo.com#wsdl.endpoint(AuthezService/Authez)</replace>
    </attribute>
    <property name="oracle.soa.uddi.serviceKey">
    <replace>uddi:8ada66e0-d12f-11dd-a8e2-e302c871a8e2</replace>
    </property>
    <property name="endpointURI">
    <replace>http://wasd.psc.com/SBDO.AD/services/Authez</replace>
    </property>
    </binding>
    </reference>
    </composite>
    8) Deployed the service by including the modified configuration plan.
    9) The service was able to get back the result. But in the log, it is showing that the WSDL is being searched in all the end points available for that service and does
    not take it to consideration the end point provided in the configuration plan.
    Log details below
    Connecting to http://wsop.psc.com:9082/registry/uddi/inquiry
    INFO: SystinetWSDLSRResolverImpl.loginfo Searching for uddi:8ada66e0-d12f-11dd-a8e2-e302c871a8e2. INFO: SystinetWSDLSRResolverImpl.loginfo AccessPoint found
    http://wasp.psc.com/SBDO.AD/services/Authez Type null. INFO: SystinetWSDLSRResolverImpl.loginfo AccessPoint foundhttp://wasd.psc.com/SBDO.AD/services/Authez Type null
    INFO: SystinetWSDLSRResolverImpl.loginfo AccessPoint found.
    http://wasq.psc.com/SBDO.AD/services/Authez Type null
    INFO: SystinetWSDLSRResolverImpl.loginfo AccessPoint found.
    http://wasd.psc.com/SBDO.AD/services/Authez/wsdl/Authez.wsdl Type wsdlDeployment
    INFO: SystinetWSDLSRResolverImpl.loginfo Got wsdlUrl from wsdlDeployment - http://wasd.psc.com/SBDO.AD/services/Authez/wsdl/Authez.wsdl
    INFO: SystinetWSDLSRResolverImpl.loginfo oracle.fabric.common.uddiurl.resolver.exception.SRHttpAccessPointNotFoundException: Could not find HTTP Accessport for service uddi:8ada66e0-d12f-11dd-a8e2-e302c871a8e2
    WARNING: WebServiceExternalBindingComponent.getEndpointBySRKey Exception: getEndpointBySRKey oracle.fabric.common.uddiurl.resolver.exception.SRHttpAccessPointNotFoundException: Could not find HTTP Accessport for service uddi:8ada66e0-d12f-11dd-a8e2-e302c871a8e2
    Questions / Issues
    1) Why the registry search is being done in all the endpoints and is not searching only on the development end point provided in the configuration plan. I
    added the SOAP endpoint in the service reference properties on the server as well, but still is searching on all the end points
    2)     Not able to determine the root cause for the SRHttpAccessPointNotFoundException error observed. Please refer the above log for details.
    Please advice and let me know if there is more information required.
    Thanks
    Raj
    Edited by: user11122398 on Jul 27, 2010 11:00 AM
    Edited by: user11122398 on Jul 27, 2010 12:00 PM

    I supposed to make my previous question more concrete, the first answer I need before moving on to the rest of the bigger questions is this ...
    What is Oracle’s recommendation for a services invocation framework between BPEL, JEE and ESB containers? From a quick read of Oracle Technet website, WSIF seem to be the preferred framework for this purpose. However, from an equally quick survey of such frameworks in use today outside of Oracle, WSIF does not seem to enjoy any widespread developer community support anymore and all talk in public forum seem to point to newer Apache Frameworks such as CXF which support emerging standards such as JAX-WS 2.0 What is the current stand of Oracle with respect to this matter?

  • UDV Syntax Issue

    Hello Experts,
    The following UDV code works until I add the WHERE clause, at which time I get a syntax error near keyword WHERE:
    DECLARE @x INTEGER
    SET @x = $[$3.2.NUMBER] WHERE $[$3.1.0] = 'Mileage'
    SELECT CASE
    WHEN @x BETWEEN 1 AND 19 THEN 10
    WHEN @x BETWEEN 20 AND 39 THEN 20
    WHEN @x > 39 THEN 30
    END
    (This is basically retrieving a value from column 2 of a matrix where column 1 has a value of 'Mileage'.)
    SELECT $[$3.2.NUMBER] WHERE $[$3.1.0] = 'Mileage' works as a separate query, but I cannot get that functionality into my above code.
    Regards

    Solved, just needed to bracket it into a subquery.. could have sworn I tried that...
    SET @x = (SELECT $[$3.2.NUMBER] WHERE $[$3.1.0] = 'Mileage')

  • End of File issue with Photoshop CS5

    Running Mac OS 10.6.5 and Photoshop CS5
    Steps to reproduce the Problem:
    1. Open .psd file from the server
    2. Make changes
    3. Save
    4. Receive error message: "Could not save as "<filename>" because an unexpected end-of-file was encountered"
    5. Click OK
    6. File disappears from the server
    7. Save again
    8.  Save As prompt appears
    9. Same location is selected with same file name. The file saves correctly.
    Work around:
    1. Click Photoshop->Preferences->File Handling
    2. Under File Saving Options->Image Previews
    3. Change to "Never Save"
    This option does not seem to have any affect on viewing the list of files in Windows Explorer, but does affect how the files can be viewed in the Mac Finder.
    It appears that disabling the option to save “ImagePreview/Icon” results the file no longer being able to Previewed from within Finder.  It also results in the File having a generic ICON.
    Hope that this helps others who may be experiencing the same issue.
    Will take suggestions for other work arounds or fixes.
    Adobe basically says "We don't support working with files directly from a server".
    I don't have this problem using Photoshop CS4.

    Just to make sure: You are aware that this is not a Photoshop-issue per se even if it may be the only application that produces the problem for you?
    http://forums.adobe.com/message/3321185#3321185

  • Start Date,End Date prompt issue

    Hi
    I have a problem for prompts related to start Date and End Date selection i.e
    Start Date                   End Date
    01-Jan-2007                 31-Jan-2007
    01-Jul-2008                  31-Jul-2008
    The issue is if the user select the Start Date from a list of values(prompt) the End Date LOV's should appear only from its related Start Date i.e
    If Start Date is selected as 01-Apr-2007 then End Date LOV's should start only from 30-Apr-2007
    and the End Date LOV's should be seen only for the next 12 months i.e only till 31-Mar-2008
    Please suggest me how I can resolve this prompt issue

    hi there,,
    you can not do that at the prompt form
    coz every prompt is independent from the other.
    good luck
    Amr

Maybe you are looking for

  • Help with Dynamic Calc

    Hello, could someone help me why after creating the dynamic calc member below, our calc script somehow get stuck/ ran very very slow... Below is currently our Hierararchy for Division dimension: Division Dimension Division Rollup ( Never Share) Divis

  • Change the name of report painter report

    HI, I have created an operating exp report by cost center and named it as "Op exp by CC". Now I want to change the name of the report to "Op exp by CC dtl". How can I do this? Please help me out with this. Regards, Nitish

  • How do I Obliterate my Hard Drive?

    Hi, I want to "zero data" my hard drive before I give my computer away to a friend. I'm using Disk Utility which has an "erase" option. But isn't there a more thorough way to erase my hard drive. I thought it used to be called "zero data". Any though

  • Read data from IDOC

    Hello Expert do you know where i can find (tables) data contained in wrong idoc? I have 2000 MATMAS idoc in wrong status and i need to create for all these materials new idoc , therefore i need a list of all materials memorized in these idocs. Do you

  • Control and Dial from the pc with Nokia E71

    Hi I am looking for a software like "Nokia PC Suite" That i can select a contact from the list and select "Dial" It would be grate if i can open the speaker from the PC also . Any ideas for that kind of application ? Thanks