Way to create SQL statements via sqldeveloper

Is it possible that one can use sqldeveloper to create sql statements?
Is the statement that I'm having a problem with: -.
SELECT EGMGAMEVARIATIONPK FROM EGMGAMEVARIATION WHERE EGMPK=$row[0] AND STARTDATE >= TRUNC(current_date) AND (NVL(ENDATE, current_date+1) >= TRUNC(current_date))
and even if EGMGAMEVARIATION contains a column called ENDDATE I mean: -.
'ENDATE': identifier not valid when I run my PHP script, so I thought that if I could get the system to help me build the command I could do better.

First, you say the name of the column is ENDDATE, yet in your query, you wrote ENDATE, then Yes, it is an invalid identifier :)
But yes, if you like there is a Query Builder: right-click inside the SQL worksheet to invoke it.

Have fun
K.

Tags: Database

Similar Questions

  • The ultimate way to optimize SQL statements?

    Hi all

    I hope that this discovery you in a good mood

    I have a few SQL I need to optimize.

    In your experience what is the best way to find all the bottlenecks 'True' in the SQL itself.

    It's my workflow:

    Step 1:

    Explain the plain: find all the analyses of full Table right at the front.

    Step 2:

    Run the SQL through Grid control at the place where you can just "run" SQL here.

    Step 3:

    Create a SQL Tuning with the SQL Code that has just been executed.

    Step 4:

    Run SQL Access Advisor and use the SQL code that has just been run.

    Step 5:

    To run the SQL SQL Tuning Advisor.

    I know there are several way to do it, but what is your "workflow."

    Thanks for any help...

    Thank you

    Lady Allora.

    I was approached by one of the Dev and he asked me to run faster than 5 minutes.

    OK - but it is an ARTIFICIAL target and is NOT necessarily realistic or feasible.

    This makes it a RESEARCH project. You are looking for, you analyze, you try to determine if this goal is realistic or even possible.

    There is only one table that has rows 3 million inside and they do a "union all" join on tables that have a few hundred thousand lines in them.

    This means that EACH of the queries in this "union all" can be considered as a separate entity. You can take each of the queries ONE AT A TIME and determine:

    1. how many lines it can return

    2. what execution plan used

    3. what indexes and statistics are available. Are there stats? They are up to date? How they were collected?

    4. that if whatever, in execution plans seems out of the ordinary - perhaps an index is used when it shouldn't, perhaps an index is NOT used when it is possible, perhaps a clue is needed

    All this is LOOKING. As others have said if you know how many rows in the table, how many need to be returned and indexes are available, you can estimate the time MINIMUM it would take to get them. No matter what you do you will not get any faster than that.

    And for a UNION ALL of four motions operation, you can add these 4 'planned' to get the time MINIMUM it might take. That becomes your time back as LOW as POSSIBLE.

    If it is greater than the target, your goal is NOT possible.

    Ok, so many people say over and over again and more than a presence FULL ACCESS TABLE in the plan to explain is not bad.

    NO! This is NOT what they say. You wrong interpret what they tell you.

    Full scans are NOT NECESSARILY bad. Same 14 of them are NOT NECESSARILY bad. One or more of them COULD BE bad or even all of them could be bad.

    They tell you not to make the assumption that a FTS in the plan is bad. Are not these analyses and make the research/control over them, but what you do NOT assume that you must try to eliminate one or all of them.

  • The analysis of a sql statement without executing it

    Hello everyone,

    I would like to know a way of parsing sql statements to validate them, so I would get the error messages in advance without executing them.

    Here we have the difficult task to analyze several sql scripts and send corrections to the development team and thirty third companies before applying them in our production databases. I am ready to create a program web/pl sql, making this difficult task, at least one program to identify errors such as lack of owner of the table, nonexistent tables, syntax errors and so on...

    Any information will be a great help!

    Thanks in advance.

    Hi and welcome to the forum.

    Tip1:
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:3648254441315

    Tip2:
    to bookmark this forum (SQL and PL/SQL)
    Bookmark http://tahiti.oracle.com (The Oracle Documentation)
    Bookmark http://asktom.oracle.com

    Tip3:
    On all the sites mentioned, you can do a quick search on key words of your interest and you will get the examples and explanations returned.

  • Create 3D comments via Javascript

    Comments 3D can be interactively created within a 3D scene. Is there a way to create a 3D via Javascript comment? Something similar to the doc.addAnnot method, but for a 3D comment?

    I also posted this on the Javascript forum.

    Thank you.

    Replied here

  • Best way to accept credit cards via a mobile-to-Web site created by muse? Thank you

    Best way to accept credit cards via a mobile-to-Web site created by muse? Thank you

    Muse has Paypal Widgets included.

    There is also eCommerce additional widgets available at www.musewidgets.com

    Additional information can been read on a recent Muse Jam Session recording: Muse Jam: integration of your online store - YouTube

  • the SQL statements used to create views

    Hello
    How can I see the full text (with table) to create a sql view:
    SQL> select text from dba_views where rownum=1;
    
    TEXT
    --------------------------------------------------------------------------------
    select "LIB_IDX","LIB_NAME","VENDOR_NAME","PROTOCOL_NUM","VERSION_NUM","PATH_NAM
    Thank you.

    Try the following in the SQL * faster before executing the SQL statement:

    SET LONG 1000
    

    If this does not work, increase it if necessary.

  • problem when creating a trigger: SQL statement ignored

    Hello people,

    I am trying to create a trigger, but it is not created. Instead, I get the error message that a SQL statement at line 22 was ignored. It's the line indicating IF num2 = 1 THEN. I'd be happy if someone could point me in the right direction or solve my problem.

    CREATE OR REPLACE TRIGGER TriggerLogement BEFORE INSERT OR update ON tenants
    FOR EACH LINE
    DECLARE
    NUM INTEGER;
    num2 INTEGER;
    NUM3 INTEGER;
    paysLocataire VARCHAR2 (255);
    categorieLocataire VARCHAR2 (1);
    BEGIN
    SELECT COUNT (ns) IN the number OF tenants WHERE nomBat =: new.nomBat;

    IF num > 0 THEN
    SELECT paid IN the country OF sports WHERE ns =: new.ns;
    SELECT COUNT (country) IN number OF athletes sp, tenants lo WHERE sp.ns = lo.ns AND paysLocataire AND lo.nomBat = pays =: new.nomBat;
    IF num = 0 THEN
    raise_application_error (-20000, "building already in use for another nationality");
    ON THE OTHER
    SELECT COUNT (ns) IN num2 OF tenants WHERE nLogement =: new. NLogement AND nomBat =: new.nomBat;
    IF num2 = 2 THEN
    raise_application_error (-20000, 'full accommodation');
    ON THE OTHER
    IF num2 = 1 THEN
    CateogrieLocataire INTO SELECT category OF athletes WHERE ns = new.ns;
    SELECT COUNT (ns) IN num3 FROM tenant lo, sportsmen sp WHERE lo.ns = sp.ns
    AND lo.nLogement =: new. NLogement AND lo.nomBat =: new.nomBat AND sp.categorie = categorieLocataire;
    IF num3 = 0 THEN
    raise_application_error ("-20000, ' already in use for the other sex");
    END IF;
    END IF;
    END IF;
    END IF;
    END IF;
    END;

    If you need more information or if you have any questions about my posts please leave your questions or comments. I hope this isn't how completely wrong to enforce some constraints that I can't do with CONSTRAINT and CHECK in the schema definition.

    Thanks for your help and your attention.

    Sebastian

    Hello

    Whenever you have a problem that raises an error, display the full error message; do not paraphrase just part of it.

    In the triggers line numbers from the first statement DECLARE or BEGIN, so line 22 of your trigger is:

    SELECT categorie INTO cateogrieLocataire FROM Sportifs WHERE ns = new.ns;
    

    You are missing a colon before 'new': it should be:

    SELECT categorie INTO cateogrieLocataire FROM Sportifs WHERE ns = :new.ns;
    

    A FOR EACH ROW trigger on tenants cannot ask tenants. It's a shame: there are many useful things, you could do if that were allowed, but it's not.
    I'm not sure of what all queries. At least one of them:

    SELECT  COUNT (ns)
    INTO    num2
    FROM    Locataires
    WHERE   nLogement = :new.NLogement
    AND     nomBat    = :new.nomBat;
    
    IF num2 = 2 THEN
        raise_application_error(-20000,'accomodation full');
    

    can be replaced by a UNIQUE constraint. (Constraints are better than triggers, in any case.)

    If you can't do what you want with constraints, you can leave anyone directly INSERT or update the table: force them to use a procedure stored instead. You can have an INSTEAD OF trigger on a view, which is essentially the same, but allows you to use DML commands.

    If you need help, post some sample data and some examples of DML operations that must be allowed, given the data and some examples of DML operations that should not be allowed.

  • create a dynamic help based on a sql statement

    Hello

    A few years ago, I asked the same question, but I had no adequate answer to my problem:

    I have to build a text of dynamic help for items diaplayed (bubble help or better pop-up window). When I go to a header element there is a? Displays and when I click on the left mouse button it will be a constant display text. Now, I have a table with explanation (build on documentation in the table) for each column on each page. If I want to start an SQL statement when I click the button and the text should be displayed in the pop-up window.

    An example everywhere or can someone help me otherways?

    Concerning

    Siegwin

    fixed for you, the changes are:

    1. added onclick = "getItemHelpText('#CURRENT_ITEM_NAME#'); call to your model of 'Optional with Help' for all items using this model will have the same call in.
    2. adding the global page, page 0,
    3. moved JavaScript "getItemHelpText" on page 0 to become a global function, so you can use it anywhere in the application
    4. added item globle P0_DYNAMIC_HELP_TEXT page 0
    5. update your application process to set the value of P0_DYNAMIC_HELP_TEXT on the convening of AJAX, you must fix the help text.
    6. help text changed to P41_ENAME in & P0_DYNAMIC_HELP_TEXT.

    That's all I think, tested worked.

    good luck with the rest...

  • How to get the create view sql statement

    I have a technical problem

    There is a view in the database, for example "topstudentsview" and sql statement is ' select * student where scores > 90;

    My question is how to get the sql statement of the view. I want to get the sql statement in the topstudentsview

    Is the equivalent in MS Sql

    sp_helptext 'topstudentsview '.

    How in Oracle?

    Thank you

    user10182401 wrote:
    My question is how to get the sql statement of the view.

    Simple answer: use a tool. Almost every development tool will give you an option for this requirement.

    In Oracle SQL Developer (free), it's as simple as:

    Connect to the database with the user and click on "views".
    Select the appropriate view, and then click the SQL tab.

  • Creating SQL tables

    Hi, first time user of the sql developer and I don't understand why some have been created only to other tables and some were not. I made sure to follow the rules of coding of sql. but I get the error message from the table or view does not exist. and the error from line: 103 at the controls.

    Here is my sql script

    / * CREATE TABLE STATEMENTS * /.

    CREATE TABLE SHOP

    (

    SHOPID CHAR (4) NOT NULL,

    ADDRESS VARCHAR2 (40),

    CITY VARCHAR2 (15).

    STATE VARCHAR2 (3),

    CONTACTNO CHAR (10)

    CONSTRAINT SHOP_PK PRIMARY KEY (SHOPID)

    );

    CREATE TABLE DEVICE

    (

    APPLIANCEID TANK (4) NOT NULL,

    MODELID CHAR (4) NOT NULL,

    APPLIANCENAME VARCHAR2 (25).

    NUMBER OF MANUFACTUREYEAR (4),

    NUMBER OF AWARDS (6.2),

    CONSTRAINT pk_APPLIANCEID PRIMARY KEY (APPLIANCEID, MODELID)

    );

    CREATE TABLE WHOLESALER)

    WHOLESALERID TANK (4) NOT NULL,

    BUSINESSNAME VARCHAR2 (25).

    ADDRESS VARCHAR2 (40),

    CITY VARCHAR2 (15).

    STATE VARCHAR2 (3),

    CONTACTNO CHAR(10),

    CONSTRAINT WHOLESALER_PK KEY (WHOLESALERID)) PRIMARY;

    CREATE A DELIVERY TABLE

    (

    DELIVERYID CHAR(5) NOT NULL,.

    SHOPID CHAR (4) NOT NULL,

    APPLIANCEID TANK (4) NOT NULL,

    MODELID CHAR (4) NOT NULL,

    WHOLESALERID TANK (4) NOT NULL,

    DELIVERYDATE DATE,

    QUANTITY NUMBER (2),

    PRICEPERUNIT NUMBER (6.2),

    CONSTRAINT DELIVERY_PK PRIMARY KEY (DELIVERYID).

    CONSTRAINT DELIVERY_FK1 FOREIGN KEY (SHOPID) REFERS TO SHOP (SHOPID),

    CONSTRAINT DELIVERY_FK2 FOREIGN KEY (WHOLESALERID) REFERS TO WHOLESALER (WHOLESALERID),

    CONSTRAINT DELIVERY_FK3 FOREIGN KEY (MODELID, APPLIANCEID) REFERS TO UNIT MODELID (APPLIANCEID)

    CONSTRAINT DELIVERY_FK4 FOREGIN KEY (APPLIANCEID) REFERS TO APPLIANCES (APPLIANCEID));

    -------------------------------------------------------------------------------------------

    INSERT INTO VALUES SHOP ('S001' ', ' BROADWAY 23 ', 'SYDNEY', 'NSW', ' 0298762234');

    INSERT INTO VALUES SHOP ('S002' ', ' AUBURN 39 ', 'SYDNEY', 'NSW', ' 0290224533');

    INSERT INTO VALUES SHOP ('S003' ', ' 486 PHILLIP ', 'CANBERRA', 'LAW', '0278923455');

    INSERT INTO STORE VALUES ('S004' ', ' 56 TORQUAY ', 'GEELONG', 'VIC', ' 0357788990');

    INSERT INTO VALUES SHOP ('S005' ', ' 99 ST KILDA ', 'MELBOURNE', 'VIC', ' 0356331121');

    INSERT INTO VALUES SHOP ("S006" ', ' RIVERSIDE 30 ","LAUNCESTON", '' HEAP, ' 0344556611');

    INSERT VALUES OF SHOP INTP ('S007' ', ' ST CAIRNS 7 ', 'CAIRNS ', 'QUEENSLAND', ' 0756112098');

    INSERT INTO VALUES SHOP ('S008' ', ' CLARE 19 ', 'ADELAIDE', 'HIS', '0834553555');

    INSERT INTO VALUES SHOP ("S009" ', ' HERBERT 903 ', 'DARWIN', 'NT', ' 0855667788');

    INSERT INTO VALUES SHOP ('S010' ', ' YOKINE 19 ', 'PERTH', 'WA', ' 0823451122');

    INSERT INTO VALUES OF THE DEVICE ("F001", 'M001' ", ' 2 DOORS FRIDGE ', ' 2015", "2344.67" ');

    INSERT INTO VALUES OF THE DEVICE ("F001," "M034', 'SMART REFRIGERATOR', '2014', ' 8899.09'");

    INSERT INTO VALUES OF THE DEVICE ("F001", 'M099' ', ' 1 DOOR REFRIGERATOR ', '2013', ' 777.99' ");

    INSERT INTO UNIT VALUES ('TV01', "M001", 'SMART LED TV', '2015', ' 6778.93' ");

    INSERT INTO UNIT VALUES ('TV01', 'M003', 'LCD TV', '2012', ' 2211.12' ");

    INSERT INTO UNIT VALUES ('TV01', 'M015', 'SMART LCD 3D TV', '2014', ' 3446.78' ");

    INSERT INTO UNIT VALUES ('W001', 'M001', 'WASHING MACHINE TL', '2014', ' 904.83' ");

    INSERT INTO VALUES OF THE DEVICE ("W001', 'M099', 'WASHING MACHINE FL', '2015', ' 1988.29'");

    INSERT INTO VALUES OF THE DEVICE ("W001', 'M321', 'MACHINE WASHING NODRYER', '2010', ' 655.21'");

    INSERT INTO UNIT VALUES ('K001', 'M001', 'KETTLE 1-L', "2013", "88,50 ');

    INSERT INTO UNIT VALUES ('K001', 'M089', 'KETTLE 5-L', ' 2015 ", '121,90 ');

    INSERT INTO UNIT VALUES ('MI01', 'M034', ' MICROWAVE - 20L ', '2012', ' 200.00' ");

    INSERT INTO VALUES OF THE DEVICE ('MI01', 'M009', ' MICROWAVE - 34L ', '2013', ' 300.00' ");

    INSERT INTO WHOLESALER VALUES ('W001', ' GOT WHOLESALERS', ' RD LANECOVE 24 ', 'SYDNEY', 'NSW', ' 0298999099');

    INSERT INTO WHOLESALER VALUES ('W002', ' SUITS WHOLESALERS', ' 562 PRINCESS ST ', 'CANBERRA', 'LAW', '0290009000');

    INSERT INTO WHOLESALER VALUES ('W003', ' RING WHOLESALERS', ' REASON 435 RD ', 'PERTH', 'WA', ' 0844445555');

    INSERT INTO WHOLESALER VALUES ('W004', ' BARRY WHOLESALERS', ' SYMPHONY 11 DRIVE ', 'DARWIN', 'NT', ' 0811112222');

    INSERT INTO WHOLESALER VALUES ('W005', ' MURPHY WHOLESALERS', ' ST PILOT 77 ', 'HOBART', 'HEAP', '0355567778');

    INSERT INTO WHOLESALER VALUES ("W006", "PABLO WHOLESALERS', ' 49 COGNO RD ', 'ADELAIDE', 'HIS', '0899990000');

    INSERT INTO WHOLESALER VALUES ("W007", "ELLIS WHOLESALERS', ' 133 PARTNER DRIVE ', 'MELBOURNE', 'VIC', ' 0344556622');

    INSERT INTO DELIVERY VALUES ("D001', 'S001", "F001", 'M001', 'W001", AUGUST 1, 15 ', 45', ' 2000.9'");

    INSERT INTO DELIVERY VALUES ("D002', 'S001', 'TV01', 'M015', 'W003", AUGUST 3, 15 ', 23', ' 3000.7' ");

    INSERT INTO DELIVERY VALUES ('D003', 'S003', 'TV01', "M001", "W005", AUGUST 11, 15 ', 21', ' 6000.4' ");

    INSERT INTO DELIVERY VALUES ('D004', 'S004","F001", 'M034', 'W002", AUGUST 19, 15 ', 18', ' 8000.9' ");

    INSERT INTO DELIVERY VALUES ('D005', 'S004', 'W001', "M099", "W003", 16 AUGUST 15 ', 10', '1500');

    INSERT INTO DELIVERY VALUES ('D006', 'S005', 'TV01', 'M001', "W002", 10 AUGUST 15 ', 21', '6000');

    INSERT INTO DELIVERY VALUES ('D007', 'S007', 'W001', "M099", "W002", 21 AUGUST 15 ', 34', '1500');

    INSERT INTO DELIVERY VALUES ('D008', 'S002","F001","M001","W007", AUGUST 21, 15 ', 45', ' 2000.9'");

    INSERT INTO DELIVERY VALUES ('D009', 'S006', 'W001', 'M001', 'W006", AUGUST 11, 15 ', 41', ' 800.55'");

    INSERT INTO DELIVERY VALUES ('D010', 'S010', 'W001', 'M001', 'W003", AUGUST 10, 15 ', 26', ' 800.55'");

    INSERT INTO DELIVERY VALUES ('D011', "S008", "F001", 'M034', "W001", 29 AUGUST 15 ', 50', '8000');

    INSERT INTO DELIVERY VALUES ('D012', 'S009', 'TV01', 'M015', 'W003", AUGUST 22, 15 ', 10', ' 3000.7'");

    INSERT INTO DELIVERY VALUES ('D013', "S009", 'MI01', 'M034', "W004", 29 AUGUST 15 ', 70', '150');

    INSERT INTO DELIVERY VALUES ('D014', 'S007', 'K001', "M001" AND "W005", 20 AUGUST 15 ', 23', '50.3 ');

    INSERT INTO DELIVERY VALUES ('D015', 'S002', 'MI01', "M009", "W002", 7 AUGUST 15 ', 40', '200');

    Hi, first time user of the sql developer and I don't understand why some have been created only to other tables and some were not. I made sure to follow the rules of coding of sql. but I get the error message from the table or view does not exist. and the error from line: 103 at the controls.

    You try to RUN before learning how MARKET. By that, I mean you want to write a script that contains many individual parts until you have tested EACH piece to make sure it works.

    It is considered BEST PRACTICE to write a MODULAR code/scripts.

    1. create simple parts where each piece work done ONE and ONE ALONE.

    2. every piece of test running by itself - which will identify the problems of syntax and determine if it will produce a correct result.

    3. combine the parts ALREADY WORK to make modules more complex.

    Start over and do it this way.

    1. open another window

    2 copy and test each piece of your script, one at a time to this second window and test.

    If you do, you can IMMEDIATELY see what is wrong.

    And because you are only testing one piece at a time it will be OBVIOUS what piece, or pieces, the origin of the problem.

    When you are NOT using this process, you end up with a script that contains dozens or hundreds of markets. There could be dozens or hundreds of problems in the script, but the script can explode and terminate after finding the premiera., then you fix the first problem to have the script to the top when it comes to the second problem.

    Learn how to do things right the first time.

    Then, if you need help post a question in the forums. But when you post ALL necessary information to help you.

    but I get the error message from the table or view does not exist. and the error from line: 103 at the controls.

    Do not tell us - show us!

    We have NO IDEA what #103 is, but you know - so why not SHOW US? And SHOW US real result you get - the error message and the ACTUAL exception code.

  • Cannot display the results to the database during "Update": SQL statement

    Hello

    I get this error trying to update a VO via the UI or BCBrowser.

    Cannot display the results to the database during "Update": SQL statement

    This is a default single front & right THAT VO creates on the object of the entity (Database Table)

    On the same table and with the same credentials of DB, I could update the record.

    Any guess on what went wrong?

    Thanks in advance for any help.

    p.s Jdev 11.1.1.6

    Journal:

    oracle.jbo.DMLException: Houston-26041: could not publish data from database in "Update": SQL statement "START the CAR UPDATED CarEO SET SEL_ITEM =: 1 WHERE TXN_NO =: 2 AND LOGID =: AND SEQNO = 3: 4 POLL DELIVERY_MODE, CERTIFICATION_REQ, SOFT_COPY_IND, SELITEM IN: 5,: 6,: 7,: 8; END; ».

    at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:583)

    at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:8575)

    at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6816)

    at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3290)

    at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3093)

    at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2097)

    at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2378)

    at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1615)

    at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1417)

    at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1437)

    at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2150)

    at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:740)

    at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)

    at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)

    at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:111)

    to oracle.jbo.uicli.controls.JUNavigationBar$ NavButton.actionPerformed (JUNavigationBar.java:118)

    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)

    in javax.swing.AbstractButton$ Handler.actionPerformed (AbstractButton.java:2318)

    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)

    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)

    at java.awt.Component.processMouseEvent(Component.java:6289)

    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)

    at java.awt.Component.processEvent(Component.java:6054)

    at java.awt.Container.processEvent(Container.java:2041)

    at java.awt.Component.dispatchEventImpl(Component.java:4652)

    at java.awt.Container.dispatchEventImpl(Container.java:2099)

    at java.awt.Component.dispatchEvent(Component.java:4482)

    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)

    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)

    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)

    at java.awt.Container.dispatchEventImpl(Container.java:2085)

    at java.awt.Window.dispatchEventImpl(Window.java:2478)

    at java.awt.Component.dispatchEvent(Component.java:4482)

    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)

    to java.awt.EventQueue.access$ 000 (EventQueue.java:85)

    in java.awt.EventQueue$ 1.run(EventQueue.java:603)

    in java.awt.EventQueue$ 1.run(EventQueue.java:601)

    at java.security.AccessController.doPrivileged (Native Method)

    in java.security.AccessControlContext$ 1.doIntersectionPrivilege(AccessControlContext.java:87)

    in java.security.AccessControlContext$ 1.doIntersectionPrivilege(AccessControlContext.java:98)

    in java.awt.EventQueue$ 2.run(EventQueue.java:617)

    in java.awt.EventQueue$ 2.run(EventQueue.java:615)

    at java.security.AccessController.doPrivileged (Native Method)

    in java.security.AccessControlContext$ 1.doIntersectionPrivilege(AccessControlContext.java:87)

    at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)

    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

    Caused by: java.sql.SQLException: invalid column type

    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:150)

    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:399)

    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:581)

    at oracle.jdbc.driver.OracleCallableStatementWrapper.registerOutParameter(OracleCallableStatementWrapper.java:1765)

    at oracle.jbo.server.OracleSQLBuilderImpl.bindUpdateStatement(OracleSQLBuilderImpl.java:2243)

    at oracle.jbo.server.EntityImpl.bindDMLStatement(EntityImpl.java:10524)

    at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:412)

    ... 52 more

    The problem is solved now.

    new columns added to the database table, after the creation of the entity object. Those changes were not picked up in the entity object.

    I found this difference after object entity with the DB Table comparison.

    And when I added these new columns to EO & VO, I don't get this error more.

    Thanks to all who tried to help

  • How to analysis of the XML in the sql statement?

    Hi friends, I have a table that contains a column of type CLOB, stores in xml format. For example, the data are like that

    <Employees xmlns="http://TargetNamespace.com/read_emp">
       <C1>106</C1>
       <C2>Harish</C2>
       <C3>1998-05-12</C3>
       <C4>HR</C4>
       <C5>1600</C5>
       <C6>10</C6>
    </Employees>
    
    

    So how can I write the sql statement for the analysis of the data at the top

    create or replace procedure parsing_xml

    (

    clob trans_payload

    trans_dir varchar2

    )

    as

    Start

    if(trans_dir='inbound/emp')

    then

    insert into emp_proj

    (

    employee_id

    last_name

    hire_date

    job_id

    salary

    department_id

    )

    Select t1.c1

    t1.c2

    t1.c3

    t1.c4

    t1.c5

    t1.c6

    from xmltable

    (

    XmlNamespaces ('http://TargetNamespace.com/read_emp' as 'emp').

    ' / ' emp:Employees by the way of xmltype (trans_payload)

    columns

    whole path of C1 'emp:C1. "

    path of varchar2 (10) C2 'emp:C2. "

    C3 varchar2 (10) path "emp:C3."

    C4 varchar2 (10) path "emp:C4."

    whole path of C5 "emp:C5."

    C6 varchar2 (10) path 'emp:C6 '.

    ) t1;

    end if;

    commit;

    end;

  • Can I write merge SQL statement having count (*)?

    Hi, this is a follow-up to my previous post question. I tried to use a SQL statement of merger to solve my problem, but now I come across another problem.
    Now, I have a table where the field updated necessary is a partial PK
    When you use a SQL statement of merger, I put a where clause clause that check if count (*) = 1 because of the constraint of PK
    Where I put the count ()) = 1 clause?

    Here are the details:
    I have two tables TA and TB, where TA contains the fields IDS, FULLNAME, TYPE and tuberculosis contains the fields ID, NAME
    I want to update the names in TB for TA names where TB.ID = TA.ID and TA. TYPE = 'ABC '.
    {ID, first NAME} are PKs but for the same ID, there may be more than 1 firstname.
    for example
    TA
    -------------------------------
    ID | FULLNAME | TYPE
    1 Caroline T ABC
    2 Mary C DEF
    3 Peter J ABC

    TB
    ----------------------
    ID | FIRSTNAME
    1 Caroline
    1 Carol
    1 C,
    3 Peter

    I need to update TB with the new names of TA where type is 'ABC', but only for those areas that have count (TB.ID) = 1
    When I try to run this SQL statement

    merge into TB B using TA A
    on (A.ID = B.ID and A.TYPE = 'ABC')
    when matched, then update the value B.FIRSTNAME = substr (A.FULLNAME, 1, instr (A.FULLNAME, ',') - 1)

    I got this error SQL error: ORA-00001: unique constraint (TEST.) PK_TB) violated
    which I believe is because I've updated these fields say ID = 1, with 'Caroline '.
    This means that I'll have to add a clause with count (TB.ID) = 1
    How would you do it?

    Server Oracle 11 g is
    Thank you!

    Hello

    One way is to join your and tb in the USING clause and eliminate duplicates it.

    MERGE INTO     tb     dst
    USING   (
             SELECT    ta.id
             ,           REGEXP_SUBSTR ( MIN (ta.fullname)
                                    , '^[^,]*'
                            )     AS firstname
             FROM      ta
             JOIN      tb  ON  ta.id     = tb.id
             WHERE     ta.type      = 'ABC'
             GROUP BY  ta.id
             HAVING    COUNT (*)     = 1
         )                   src
    ON     (scr.id      = dst.id)
    WHEN MATCHED THEN UPDATE
    SET     dst.firstname     = src.firstname
    ;
    

    If you would care to post CREATE TABLE and INSERT statements for your sample data, and then I could test this.

    I used REGEXP_SUBST instead of SUBSTR and INSTR to search for the first name, because I find it a little cleaner, and because it returns something even when there is none "," fullname, which I assume is what you really want. (None of the fullnames in your sample data have ','s.) You can use SUBSTR and INSTR instead.

  • run in parallel sql statement block

    Hello
    I'm looking for a way to run 2 blocks from the sql statement at the same time in sqlplus

    Block1
    drop table CTSGLOB_TABLE;
    create the table CTSGLOB_TABLE select * from CTSGLOB_VIEW;
    create index TEMPS_CTSGLOB_IDX ON CTSGLOB_TABLE("TEMPS");
    create index ORGA_CTSGLOB_IDX ON CTSGLOB_TABLE("ORGA");
    create index RUBSRH_CTSGLOB_IDX ON CTSGLOB_TABLE("RUBSRH");

    Block2
    drop table CTSGLOB_TABLE_2;
    create the table CTSGLOB_TABLE_2 select * from CTSGLOB_VIEW_2;
    create index TEMPS_CTSGLOB_IDX_2 ON CTSGLOB_TABLE_2("TEMPS");
    create index ORGA_CTSGLOB_IDX_2 ON CTSGLOB_TABLE_2("ORGA");
    create index RUBSRH_CTSGLOB_IDX_2 ON CTSGLOB_TABLE_2("RUBSRH");

    I know that I can open 2 client session to run, but I would like to know another way.

    Best regards
    Jean-Marc

    Well, that depends on what you mean exactly when you say "run 2 blocks from the sql statement at the same time in sqlplus '...
    You can also copy all statements in a sql script and run that, just.
    If this isn't what you want, then please explain why.

  • Help with a SQL statement...

    Hello...

    I have tried to find a way to write a SQL statement and may not seem to produce something that works. What I need is a set of results that returns each month that a given task is in an open State. The only columns that I have in my work table with are TASK_NM, OPEN_DT and CLOSED_DT.

    So if I have a line containing the following: TASK_NM = 'task one', OPEN_DT = April 18, 10 ' and CLOSED_DT = 14 October 10 '... I would like to see as a result set that looks like:

    TASK_NM YEAR JAN FEB MAR APR MAY JUNE JULY AUG SEP OCT NOV DEC
    the task of a 2010 0 0 0 1 1 1 1 1 1 1 0 0

    Is it still possible?

    Thanks in advance,
    David.

    Published by: user13027968 on March 10, 2011 14:19

    Published by: user13027968 on March 10, 2011 15:13

    Hello

    Welcome to the Forum!

    Whenever you have a question. Please post a small example of data (CREATE TABLE and INSERT statements) and the results desired from these data.
    For example, the sample data may be:

    CREATE TABLE     table_x
    (       task_nm          VARCHAR2 (10)
    ,     open_dt          DATE
    ,     closed_dt     DATE
    );
    
    INSERT INTO table_x (task_nm, open_dt, closed_dt) VALUES ('task a', DATE '2010-04-18', DATE '2010-10-14');
    INSERT INTO table_x (task_nm, open_dt, closed_dt) VALUES ('foo',    DATE '2010-10-31', DATE '2011-01-01');
    INSERT INTO table_x (task_nm, open_dt, closed_dt) VALUES ('foo',    DATE '2010-12-01', DATE '2011-02-21');
    INSERT INTO table_x (task_nm, open_dt, closed_dt) VALUES ('foo',    DATE '2011-04-01', DATE '2011-04-30');
    INSERT INTO table_x (task_nm, open_dt, closed_dt) VALUES ('bar',    DATE '2010-01-01', DATE '2010-01-01');
    

    From this data, you may want these results:

    TASK_NM     YEAR JAN FEB MAR APR MAY JUN JUL AUG SEP OVT NOV DEC
    ---------- ----- --- --- --- --- --- --- --- --- --- --- --- ---
    bar         2010   1   0   0   0   0   0   0   0   0   0   0   0
    foo         2010   0   0   0   0   0   0   0   0   0   1   1   1
    foo         2011   1   1   0   1   0   0   0   0   0   0   0   0
    task a      2010   0   0   0   1   1   1   1   1   1   1   0   0
    

    I'm not sure eactly how you plan to use it. Are there lines that overlap for the name of the task? You always want the same number of columns? What version of Oracle are you using?
    I think you want something like this:

    WITH     got_month_cnt          AS
    (
         SELECT  task_nm
         ,     TRUNC (open_dt, 'MONTH')     AS first_month
         ,     1 + MONTHS_BETWEEN ( TRUNC (closed_dt, 'MONTH')
                             , TRUNC (open_dt,   'MONTH')
                           )          AS month_cnt
         FROM    table_x
    --     WHERE     ...     -- If you want any filtering, put it here
    )
    ,     cntr     AS
    (
         SELECT     LEVEL     AS n
         FROM     (
                   SELECT  MAX (month_cnt)     AS max_month_cnt
                   FROM     got_month_cnt
              )
         CONNECT BY     LEVEL     <= max_month_cnt
    )
    ,     all_months     AS
    (
         SELECT     m.task_nm
         ,     ADD_MONTHS ( m.first_month
                      , c.n - 1
                      )          AS open_month
         FROM     got_month_cnt     m
         JOIN     cntr          c  ON     c.n     <= m.month_cnt
    )
    SELECT       task_nm
    ,       EXTRACT (YEAR FROM open_month)                         AS year
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'Jan' THEN 1 ELSE 0 END)     AS jan
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'Feb' THEN 1 ELSE 0 END)     AS feb
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'Mar' THEN 1 ELSE 0 END)     AS mar
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'Apr' THEN 1 ELSE 0 END)     AS apr
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'May' THEN 1 ELSE 0 END)     AS may
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'Jun' THEN 1 ELSE 0 END)     AS jun
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'Jul' THEN 1 ELSE 0 END)     AS jul
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'Aug' THEN 1 ELSE 0 END)     AS aug
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'Sep' THEN 1 ELSE 0 END)     AS sep
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'Oct' THEN 1 ELSE 0 END)     AS ovt
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'Nov' THEN 1 ELSE 0 END)     AS nov
    ,       MAX (CASE WHEN TO_CHAR (open_month, 'Mon') = 'Dec' THEN 1 ELSE 0 END)     AS dec
    FROM       all_months
    GROUP BY  task_nm
    ,       EXTRACT (YEAR FROM open_month)
    ORDER BY  task_nm
    ,            year
    ;
    

    This will work in Orfacle 9 (and), but from Oracle 11, you could simplify it a little bit by using SELECT... Function PIVOT.

    Published by: Frank Kulash, March 10, 2011 16:51

Maybe you are looking for

  • HP Z600, Z800: no HP Z600 or Z800 support PCIe SSD

    Hi guys I am a engineering student and a graphic designer, so I need a job to do my job. in fact, I'm a big fan of Apple Mac but Mac Pro purchase will cost me more so I decided to go with the HP solution I gan get used HP Z600 or Z800 and customize t

  • I don't know how private are my synchronization information. Who can access?

    I can find no mention of private how information is that sync lets you save on computers of Mozilla. These data seem to be a data miner gold. You should post a privacy statement data in sync off-site, and under what conditions he would be released to

  • UK: problems with the software: learning year 6 scale

    UK: Anyone else running of learning year 6 scale? mine does not open and constantly crashes (Mac Mini 2010 4 GB memory Intel running fully updated in Yosemite.

  • Reinstall Vista after the installation of 10.

    Separated from this thread. I now have an HP computer running Windows 10. I had previously updated to windows 7 Vista, its Windows operating system to the original address. It runs very slowly and I want to either bring it back to Vista or windows 7

  • NMIndexStoreSvr.exe error stealing focus from other applications

    I had problems with the above-named service.  The error (WerFault.exe) guard report generator generates errors in the application log: ===================================================== Name of the failing application: NMIndexStoreSvr.exe, version