oracle-sqldeveloper

Check Constraint Calling a Function Oracle SQL developer

核能气质少年 提交于 2019-12-20 01:45:11
问题 Is it possible in Oracle SQL developer to do something like this CREATE FUNCTION fnCheckValid(accountidd IN NUMBER) RETURN NUMBER IS retval NUMBER(4,0); BEGIN SELECT COUNT(accountid_fk) INTO retval FROM tbl_AccountAuthentications WHERE accountid_fk = accountidd; RETURN(retval); END; / ALTER TABLE tbl_AccountAuthentications ADD CONSTRAINT chkCheckvalid CHECK(fnCheckValid(accountid_fk) <= 1); The error i keep getting is Error starting at line 999 in command: ALTER TABLE tbl

Oracle : Export select statement result set as INSERT SQL Statements similar to SQL developer export

流过昼夜 提交于 2019-12-19 08:54:41
问题 I am looking for a solution to create the SQL INSERT statements using PL/SQL script for the select statement result set. Looking for similar feature available in the SQL Developer tool (export --> format insert) but I want the solution as script rather than using any tool(s). I have referred the below solution. However, I would like to know whether any better way to do it as the solution is old and not very simple. EXPORT AS INSERT STATEMENTS: But in SQL Plus the line overrides 2500

SQLDeveloper jump between Package body and Package spec

佐手、 提交于 2019-12-19 06:25:07
问题 I'm currently using Oracle SQLDeveloper a lot more that I have ever used and I'm starting to like the tool. I use Shift+F4 a lot to jump into a package/function/procedure. But one thing that I don't really get is how to jump directly to the package body or as an alternative some kind of shortcut that toggles between the spec and the body of a package. Toad has something like this and I'm unable to find this feature in SQLDeveloper. I'm also aware that you have the object tree on the left side

What is the maximum statement length in Oracle

跟風遠走 提交于 2019-12-19 05:46:36
问题 I'm building a SQL statement that contains data and I'm wondering if I would break some maximum statement length in Oracle 10g. The statement would be about 3 200 000 bytes, cannot be split and has to be parsable in its entirety. Before I'm investing too much time this way, I was wondering if I would be limited by the size of this statement. I am using SQL developer but I think that if the server can do it, so can SQL developer. 回答1: There is no fixed number. See "Logical Database Limits":

SQL Developer “disconnected from the rest of the join graph”

北战南征 提交于 2019-12-19 05:15:07
问题 I have the following SQL: select <misc things> from pluspbillline left outer join workorder on workorder.siteid=pluspbillline.siteid and workorder.wonum = pluspbillline.refwo and workorder.orgid = pluspbillline.orgid left outer join ticket on ticket.ticketid = pluspbillline.ticketid and ticket.class=pluspbillline.ticketclass left outer join pluspsalesorder on pluspsalesorder.salesordernum=pluspbillline.salesordernum and pluspsalesorder.siteid=pluspbillline.siteid In Oracle SQL Developer 4.0.0

PL/SQL How to get X day ago from a Date as Date?

二次信任 提交于 2019-12-19 05:13:28
问题 I want to get 100 days ago from 08-APR-13, as date. How to do it with pl/sql? 回答1: Assumption was made that the 08-APR-13 is a string in your situation. So you need convert it to date using to_date function, and then simply subtract 100 literal. SQL SQL> select (to_date('08-APR-13', 'DD-MON-RR') - 100) res 2 from dual 3 / RES ----------- 29-12-2012 PL/SQL SQL> declare 2 l_res_date date; 3 l_in_date varchar2(11) := '08-APR-13'; 4 begin 5 select (to_date(l_in_date, 'DD-MON-RR') - 100) 6 into l

Execute Statement or Run Script?

血红的双手。 提交于 2019-12-19 05:03:19
问题 While entering a SQL statement in Oracle SQL Developer, I noticed that I have two choices. I can either "Run Statement" or "Run Script". A similar choice seems to be available in SQL Maestro as well, although named "Execute query" and "Execute as script". What exactly is the difference between the two? 回答1: Run Statement will give you a list of all the results in a sortable table. It will also only run the statement under the cursor (or highlighted). You will be prompted for bind variables

How to use SQLDeveloper to connect to embedded Derby database

我与影子孤独终老i 提交于 2019-12-19 04:16:05
问题 I have a project using derby and JPA. I can connect to the database fine within my application. I would like to connect to the embedded database with SQL Developer so I can easily browse/query the data in the database. Here is the derby dependency I'm using: <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <version>10.7.1.1</version> </dependency> Here is the the connection info I'm using for JPA: <property name="javax.persistence.jdbc.driver" value="org.apache

How do I declare and use variables in PL/SQL like I do in T-SQL?

岁酱吖の 提交于 2019-12-18 12:47:33
问题 In Sql Server, often times when I'm testing the body of a stored procedure, I copy the body into SSMS, DECLARE the variables at the top of the page, set them to some sample values, and execute the body as-is. For Example, if my proc is CREATE PROC MySampleProc @Name VARCHAR(20) AS SELECT @Name Then my test sql would be DECLARE @Name VARCHAR(20) SET @Name = 'Tom' SELECT @Name What is the Oracle PL/SQL equivalent to this? This is the closest that I've come up with, but I'm getting "PLS-00428:

Why oracle stored procedure execution time is greatly increased depending on how it is executed?

人走茶凉 提交于 2019-12-18 12:33:05
问题 This is my problem: we have a stored procedure called HEAVY_SP and depending on how it is executed, execution time is greatly increased: (1) Call execution Direct execution in Oracle SQL Developer IDE CALL HEAVY_SP(0, 'F', 5, ...) takes 15 seconds (our current solution) (2) Using play button Opening the procedure using Oracle SQL Developer and executing the "play" button: takes 15 seconds (3) dbms_job : scheduled mode takes 15 seconds (4) dbms_job : instant execution mode takes more than 1