Select the query gives error

Hello

I executed the query below

SELECT CUREPRESS, PRODUCTIONCODE, ENDDATE YYYYMMDD.

CASE

WHEN annex 1 > 0 AND SCHEDULE2 > 0 AND THEN schedule3 > 0 AND ROUND(22+SCHEDULE3/CURECAPACITY*24,0) > 24
Round (22 +(SCHEDULE3/CURECAPACITY*24) - 24, 0)-(DATE of the INCREASE OF 1)
WHEN annex 1 = 0 AND SCHEDULE2 = 0 AND schedule3 > 0 AND ROUND(22+SCHEDULE3/CURECAPACITY*24,0) < = 24 THEN
Round(22+SCHEDULE3/CURECAPACITY*24,0)
WHEN annex 1 > 0 AND SCHEDULE2 > 0 AND schedule3 = 0 THEN
Round(14+SCHEDULE2/CURECAPACITY*24,0)
WHEN annex 1 > 0 AND SCHEDULE2 = 0 AND = 0 THEN schedule3
ROUND (6 +(SCHEDULE1/CURECAPACITY*24), 0)
END ENDDATE1
CEN
SELECT PRODUCTIONCODE, curepress, YYYYMMDD
OF ORGCURESCHEDULEDAY HAS
WHERE YYYYMMDD = (SELECT MAX (YYYYMMDD)
OF ORGCURESCHEDULEDAY B
WHERE A.PRODUCTIONCODE = B.PRODUCTIONCODE
AND A.CUREPRESS = B.CUREPRESS)
) PRODUCTIONCODE, CUREPRESS, YYYYMMDD GROUP
ORDER OF CUREPRESS, PRODUCTIONCODE

But... I get the error message like

ORA-00904: "CURECAPACITY": invalid identifier
00904, 00000 - '% s: invalid identifier '.
* Cause:
* Action:
Error on line: column 103: 40


Pls help me... !!
SELECT
CUREPRESS,
  PRODUCTIONCODE,
  STARTDATE,

  TO_DATE(TO_CHAR(STARTDATE,'YYYYMMDD') || TO_CHAR(STARTDATE1,'HH24')||':00','YYYYMMDD HH24:MI') STARTDATE1

  FROM 

(SELECT CUREPRESS,
  PRODUCTIONCODE,
  YYYYMMDD STARTDATE,
  CASE
    WHEN SCHEDULE1                           = 0
    AND SCHEDULE2                            = 0
    AND SCHEDULE3                            >0
    AND ROUND(30 -SCHEDULE3/CURECAPACITY*24,0)>24
    THEN ROUND(30-(SCHEDULE3/CURECAPACITY*24),0)-24
    WHEN SCHEDULE1                            = 0
    AND SCHEDULE2                             = 0
    AND SCHEDULE3                             >0
    AND ROUND(30 -SCHEDULE3/CURECAPACITY*24,0)<=24
    THEN ROUND(30-SCHEDULE3/CURECAPACITY*24,0)
    WHEN SCHEDULE1 = 0
    AND SCHEDULE2  >0
    AND SCHEDULE3  >0
    THEN ROUND(22-SCHEDULE2/CURECAPACITY*24,0)
    WHEN SCHEDULE1 > 0
    AND SCHEDULE2  >0
    AND SCHEDULE3  >0
    THEN ROUND(14-SCHEDULE1/CURECAPACITY*24,0)
  END STARTDATE1
FROM
  (SELECT curepress,
    PRODUCTIONCODE,
    YYYYMMDD,
    schedule1,
    schedule2,
    schedule3,
    curecapacity
  FROM ORGCURESCHEDULEDAY A
  WHERE YYYYMMDD =
    (SELECT MIN(YYYYMMDD)
    FROM ORGCURESCHEDULEDAY B
    WHERE A.PRODUCTIONCODE=B.PRODUCTIONCODE
    AND A.CUREPRESS       =B.CUREPRESS
    )
  )
GROUP BY PRODUCTIONCODE,
  CUREPRESS,
  YYYYMMDD,
  SCHEDULE1,
  SCHEDULE2,
  SCHEDULE3,
  CURECAPACITY)
ORDER BY CUREPRESS,
  PRODUCTIONCODE

Try please, (not tested)

Tags: Database

Similar Questions

  • Select the query within the PL/SQL block.

    Hello Experts,

    I'm just a beginner with PL/SQL.
    If I write a select query of client like fire against a database and SQL dev, it gives me result.
    For example: select * from employee;

    Now suppose that when I use the same query within a PL/SQL block:
    Declare
    Start
    Select * from employee;
    end;
    /
    It gives error during execution, by mentioning that an INTO should etc...
    I have my doubts here:
    1. is it impossible to use a simple select statement within a PL/SQL block (If yes why?)

    I know it's a very basic question, I tried to search it on the forum but could not find the thread, please redirect me to the link if it is already the answer.

    Please read this first. may ask why?

    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/TOC.htm

  • Select the query in the sqlite database

    Hello friends,

    I used this application in my application... It worked fine...

    Select fld_name in the limit of 0.10 tbl_placelist

    But when I used the query below, he showed me error...

    «Select fld_name in the limit of tbl_placelist «+ s1, 10»»

    I do not have how to pass two values (i.e) a global variable and an integer in the limit

    Can someone help me...

    Maybe I'm missing something but you want to say something like this:

    S1 int = 0;

    int s2 = 10;

    String q = 'select fld_name from tbl_placelist limit' + s1 + ', ' + 's2;


  • Impossible to activate the rewrite of the query, no error

    Hello

    I created a simple MV with activated query rewrite, and it works well. The MV is very simple:

    Mv_sales CREATE MATERIALIZED VIEW

    NOLOGGING

    REFRESH THE STRENGTH TO DEMAND

    ACTIVATE THE QUERY REWRITING

    AS

    SELECT

    s.cust_id,

    Sum (s.QUANTITY_SOLD) sold_qty,

    Sum (s.AMOUNT_SOLD) sold_amt

    S SALES

    GROUP BY s.cust_id

    ;

    I tested the mechanism of query rewriting, and everything works as expected.

    Now, I created an another MV with a motion very similar to the one above, but with several tables.

    An excerpt from the new query:

    SELECT...

    Of

    FACT_SALES_AND_MARKDOWNS FSM

    DIM_PRODUCT DP

    DIM_LOCATION DL

    DIM_DATE DD

    WHERE WSF. DIM_PRODUCT_KEY = DP. DIM_PRODUCT_KEY

    AND WSF. DIM_LOCATION_KEY = DL. DIM_LOCATION_KEY

    AND WSF. DIM_SALE_DATE_KEY = DD. DIM_DATE_KEY

    GROUP BY

    DD MERCH_YEAR_ID.

    DD. MERCH_YEAR_START_DATE...

    I can create the MV, but the query rewriting will not activate!

    If I execute ALTER materialized view mv_test ALLOW to REWRITE the QUERY. It runs without giving me an error, but the MV is not always activate the rewrite of the query.

    Am I missing something? Can we not have Query Rewrite on a MV with several tables in the query?

    Thank you

    Joao Moreira

    Hello

    Please provide the results of these queries:

    Select MVIEW_NAME, REWRITE_ENABLED

    of DBA_MVIEWS

    where MVIEW_NAME = '';

    Kind regards.

  • Select the query with the level line list where the clause

    Hi all

    I am creating a tabular presentation based on a SQL query that has a list of selection based on a query with a where clause clause that refers to a column in the original SQL query.

    The situation is, I have a table that stores the client_id, source_id, and build_id, lets call it client_source. I have a second table, build_source, containing source_id and build_id, one to many relations between the two (1 source_id could have build_id 1-7).

    Using a tabular presentation, I want to select the correspondent build_id to use in client_source, but the selection list should contain only the build_id for this particular source_id of lines.

    Here is an example of the SQL source of tabular presentation;

    Select
    s.ROWID,
    s.CLIENT_ID,
    s.SOURCE_ID,
    APEX_ITEM. SELECT_LIST_FROM_QUERY (1, s.BUILD_ID,)
    "Select display b.build_id, b.build_id return.
    b build_source where b.source_id = s.SOURCE_ID ') lst
    of s client_source

    what I want to achieve, it's as source_id "BOLD" match fields. When the query is built this way, I get an error of "invalid identifier" Oracle on s.SOURCE_ID during execution.

    Is there some special tags to be used to refer to the external column? I must be missing something because this looks like a pretty mundane problem.

    I am running on 4.1.0.00.32, on an Oracle 10 g release 10.2.0.4.0 Server Express request.


    I look forward to useful responses!


    See you soon,.
    Jason

    Published by: 1005131 on May 9, 2013 19:02

    Your selection by query list receives a static SQL. That SQL can't "see" the value of your s.source_id.
    But it would work like this:
    where b.source_id = ' | s.SOURCE_ID)

    You would be the value for the SQL concatenation. It is not ideal, but it will work.

    Jorge

  • Select the query to select the month range based on the current date.

    It's the database 10 g oracel.

    I want to choose two months of data in the table. But these two months should be based on the current date.

    For example.

    If I run the select query on July 7, 2013, then the query must ignore the current month being July 2013 and last month, which is June 2013 and it shoud select only may 2013 and April 2013.

    Can someone help me how to make this request.

    SELECT *.

    FROM my_table

    WHERE my_date > = TRUNC (ADD_MONTHS (sysdate,-3), 'MY') - first day of the month 3 months ago

    AND my_date< trunc(add_months(sysdate,-1),'mon')="" --="" first="" day="" of="" last="">

  • Using allPageItems to find a textFrame using the label gives error

    Hello all the

    Using allPageItems to find un textFrame using label gives error.

    Example of :
    J’ai un text framework with label " "myTest""
    The problem only le textFrame peut be in un Group of objects or not . So Je have to Search using allPageItems .

    1. I write, but gives the error:

    var myDocument = app.activeDocument;
    var myTextFrame = myDocument.allPageItems.item("myTest");
    myTextFrame.contents = "Test OK!";
    alert("OK!");
    
    

    2 in writing in this way I can succeed, but can take more time because they may not know how the items in the document:

    var myDocument = app.activeDocument;
    var myTextFrame;
    for(var i = 0; i < myDocument.allPageItems.length; i++){
        if (myDocument.allPageItems[i].constructor.name == "TextFrame"){
            if (myDocument.allPageItems[i].label == "myTest"){
                var myTextFrame = myDocument.allPageItems[i];
                myTextFrame.contents = "Test OK!";
                alert("OK!");
                break;
                }
            }
        }
    

    There is another way that a more direct and faster to find the TextFrame?

    I'm on CS4, but I can work with CS5, CS5.5 or if it's better.

    Thank you

    Elvis

    Hi Elvis,.

    You can try this js code:

    Because if you want to remove the empty textframe I use this way.

    myDoc var = app.activeDocument;
    var myPg = myDoc.allPageItems;

    for (i = 0; i
    var myFrame = myPg [i];
    If (instanceof TextFrame myFrame) {}
    If (myFrame.label == "myTest") {}
    myFrame.contents = 'Test OK!';
    }
    }
    }
    Alert ("Done!");

    THX

    csm_phil

  • SELECT the query to get the values as case-insensitive

    Hello

    This is hari,

    I want to choose the user name in a table eg: username = 'HELLO' or username = 'Hello' or username = 'HaRi' like this

    If I wrote the request as

    Select username userdb where username = "Hello";

    It shows the records that does that "Hari" only.

    can someone help me on this query as soon as possible please...


    the query must return all results

    which corresponds to one of the following strings as inputs 'HARI' or 'HaRi' or 'hAri' or similar.

    Waiting for the answer.

    Thanks and greetings

    Hari

    The regular expression have been introduced in 10g. Use more or DOWN as suggested earlier.

    Nicolas.

  • Lightroom cc 2015 the trial gives error messages when opening

    Hey, I just installed the cc of Lightroom 2015 of the trial, but it does not open. It gives two error messages: 1) an internal error has occurred. (2) an error occurred when attempting to change modules. I went on various forums and support pages. Many of them say to rename the files or something like that, but I can't find these files on my mac. And there are so many suggestions that I don't know that one to listen to.

    Hi danwildmind,

    This problem normally occurs when the files of Adobe to launch Lightroom do not have read/write permissions.

    Please follow this article changing the error modules and grant permissions to required files

    Here's a double thread Lightroom: "an error occurred when attempting to change modules."

    Now that you have gone though the resolution of the problems already

    You must make sure that Adobe files have read/write khakis.

    Follow the steps below to: -.

    • Go to ~/library/Application Support/Adobe = User Library directory [ not to be missed ~ symbol ]
    • Also, go to the folder /library/ Application Support / Adobe = system library
    • When you open GetInfo option for Adobe folder.
    • Make sure you click on '+' symbol, it will open the list of user accounts. Add currently logged in user account and Director of user account, if it is not added.

    Both must have read and write access to prevent these issues in the future.

    Important:

    • Once you added as currently logged on user account and administrator user accounts and provided access for reading and writing.
    • Make sure you click on the gear icon and select apply to closed.
    • Lock dialog box and close the Get Info .
    • So that all files present in the Adobe folder will have read and write access.

    Let us know if this helps

    ~ Assani

  • Select the query takes a long time to run the second time

    Hi all

    I have Oracle 11 GR 1 material in windows server 2008 R2.
    I have a few tables with 10 million documents. When I run the select query to the tables of first time, it gives me a result in 15 seconds, but if I run the script even twice in the same session, I get the result in 15 minutes to complete...

    Why it's happening? What can be the solution for this?

    Thank you and best regards,
    Vikash jain (DBA Junior)

    What I know is that this feedback from cardinality generates more problems than improving the performance is, in fact, its main objective. But first look at which is was written in the link I posted above

    "Return of cardinality was introduced in the Oracle 11 g database 2. The purpose of this function is to automatically improve plans for queries that are executed repeatedly, _For that the optimizer does not estimate the cardinalities in the properly_ plan"

    If the cardinality feedback kiks in your case it is certainly because you do not have an exact statistics. Get the command the explain plans that I have shown you with the E-lines and A-lines (lines estimates and actual lines) and see where things are poorly estimated.

    If you want to disable the cardinality feedback then add the indicator according to your request

    /*+ opt_param('_optimizer_use_feedback','false') */
    

    Best regards

    Mohamed Houri
    www.hourim.WordPress.com

    Published by: Mohamed Houri on November 22, 2012 02:11
    Published by: I was looking for the exact indication of how do I deactivate the cardinality feedback and I foud in an ot the Dominic post in otn :-)

    Published by: Mohamed Houri on November 22, 2012 02:15

  • the upgrade gives error aborted: 0x80004004__

    upgrade direct Windows gives me an error after upgrade I abandoned: 0 x 80004004

    Hello
    Welcome to the Microsoft answers site.
     
    I suggest to contact Windows live and would be better suited to Windows groups live Discuission.
     
    I also suggest contact you:
    https://windowslivehelp.com

    Please visit the link below and find a community that will offer you a better support.
     
    http://answers.Microsoft.com/en-us/windowslive/default.aspx

    Thank you and best regards,
    Azam - Microsoft technical support.

  • Windows 7 not connecting to the VPN - gives error 930

    I'm one of my boxes, upgrade to Windows 7 (x 64) and everything seems to work - until I try to connect to my VPN - it gives me an Error 930.  On the same home network are a (x 64) Vista and XP (x 86) - both can make the VPN connection without problem to the same location.  When this box is Vista, it has good work as well.

    There is nothing fancy here - simple Windows work stations at a location behind a Linksys WRT54GS connection to a Windows Server 2003 server behind an ISA firewall.

    I deleted the connection and recreated, and it worked.  What is interesting is that the first connector name was identical to the location I tried to connect to (internal & external).  When I change the name of the connector, everything worked.

    To test, I deleted this connection and created another one as the first - named the same as the network tried to connect to and it wrong on.  When I renamed the connection, everything worked perfectly.  It seems that Windows 7 is lost when you name the connector, the same as the destination network FULL domain name.

  • Apex 5.0 install the script gives error: ORA-02291 constraint (APEX_050000.SYS_C0013507)

    We used a script to install our applications in Apex 4.02. When you use this script with Apex 5.0, we get an error:

    [6399] ORA-02091: transaction cancelled

    [6400] ORA-02291: integrity constraint violation (APEX_050000.SYS_C0013507) - parent

    ALTER SESSION SET CURRENT_SCHEMA = &2;
    
    declare
       l_schema       varchar2(30) := upper('&1');
       l_workspace_id number;
       l_app_id       number;
    
    begin
       -- Get workspace ID for schema
       begin
          select workspace_id
            into l_workspace_id
            from apex_workspaces
           where workspace = l_schema;
       exception
          when no_data_found then
      
             -- Create workspace for schema
             apex_instance_admin.add_workspace(p_workspace_id => null, p_workspace => l_schema, p_primary_schema => l_schema, p_additional_schemas => null);
      
             -- Get ID for created workspace
             select workspace_id
               into l_workspace_id
               from apex_workspaces
              where workspace = l_schema;
       end;
    
       -- Put ID in install package
       apex_application_install.set_workspace_id(l_workspace_id);
    
       -- Get application ID.
       begin
          select application_id
            into l_app_id
            from apex_applications
           where workspace = l_schema;
    
          -- Set application ID in package
          apex_application_install.set_application_id(l_app_id);
    
       exception
          when no_data_found then
             -- No applicication create a new one
             apex_application_install.generate_application_id;
       end;
    
       -- Generate offset
       apex_application_install.generate_offset;
    
       -- Set schema and alias.
       apex_application_install.set_schema(l_schema);
       apex_application_install.set_application_alias(l_schema);
    
       l_app_id := apex_application_install.get_application_id;
       dbms_output.put_line('Applicatie installed with ID :' || l_app_id);
    end;
    /
    
    @..\apex\f127.sql
    
    

    The script starts promising:

    Applicatie installed with ID :100                                
    APPLICATION 127 - NedGraphics NedBrowser
    Set Credentials...
    Check Compatibility...
    API Last Extended:20130101
    Your Current Version:20130101 This import is compatible with version: 20100513
    COMPATIBLE (You should be able to run this import without issues.) Set Application ID...
    ...authorization schemes
    
    

    But in the end:

    .....scheme 39275367140332431
    ......scheme 47816685350333762
    ...plugins
    commit
    *
    ERROR at line 1:
    ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (APEX_050000.SYS_C0013507) violated - parent
    key not found
    
    

    F127. SQL is exported from 4.02 Apex.
    Can manually import this application in the Apex 5.0 using the Apex development interface...

    Hi René,.

    the bug is not public. I already fixed it for 5.0.2.

    Kind regards

    Christian

  • Select the query - Oracle

    HI Experts,

    I know that the question I ask is a simple. But wait a few contributions of the experts who are all present here.

    (Q) I have a table called account INFORMATION size 97 GB (with partitions) and my DBBC (Database Buffer Cache) is 2 GB in size. No set MEMORY_TARGET (or) No. SGA_TARGET. I pulled a simple query

    select * from account information; Once I pulled this select statement oracle must show records almost 80 million than those which are existed in the table. I'm just amazed to see a point with the help of 2 GB DBBC, 97GB of data?

    Oracle displays data piece by piece, I mean 2 GB of 2 GB? I can't watch everything stops for the display of data. Please provide some light here

    Database: Oracle 10.2.0.5

    Operating system: Solaris Spark

    Thank you

    The client application specifies the number of rows to return to each request.  If your client application is SQL * Plus, which is controlled by the parameter ARRAYSIZE.  Let's say for the purposes you use SQL * Plus and the ARRAYSIZE is 50.

    SQL * Plus sends a SQL statement (SELECT * from account information) and request to return 50 lines

    Oracle reads 50 lines of the table and hands

    SQL * Plus displays these lines and then asks the database for 50 more

    Oracle reads the next 50 lines and delivers them

    This continues until the last line is read

    Realistically, it takes more time to display 50 lines on the customer it does seek in this case so you won't see not usually all visible delay.  In queries that require greater treatment, it is reasonably likely that you will see more obvious delays between extractions.

    Justin

  • Birth of the nation gives error that E:\IML32.dll is eithernot designed to run on windows or it contains an error

    Place of issue of the nation

    I just rise from the pack or nation. When I try to install the game, or run the autorun, I get an error message that says E:\IML32.dll if the other is not designed to run on windows or it contains an error. I have window vista and accorss problems with older games running on this system. I installed Rise of nations Rise of legends fine without any problem. If you can please help solve me this problem. Thank you

    Make sure that your Windows is fully updated.

    Also try running it in compatibility mode:

    http://Windows.Microsoft.com/en-us/Windows-Vista/make-older-programs-run-in-this-version-of-Windows

    If possible, try to install in the other PC and see if you get the same error or not? If it has the same error in different PC, that could be the problem with the CD/DVD.

Maybe you are looking for