Total Pageviews

Showing posts with label SQLDeveloper. Show all posts
Showing posts with label SQLDeveloper. Show all posts

2015/06/24

SQL Developer 常用 hotkeys

  1. ctrl-enter : executes the current statement(s)
  2. F5 : executes the current code as a script (think SQL*Plus)
  3. ctrl-space : invokes code insight on demand 
  4. ctrl-Up/Dn : replaces worksheet with previous/next SQL from SQL History
  5. ctrl-shift+Up/Dn : same as above but appends instead of replaces
  6. shift+F4 : opens a Describe window for current object at cursor
  7. ctrl+F7 : format SQL
  8. ctrl+/ : toggles line commenting
  9. ctrl+e : incremental search


Reference
[1] http://www.thatjeffsmith.com/archive/2012/11/keyboard-shortcuts-in-oracle-sql-developer/

2014/12/17

How to Run Stored Procedure in Oracle SQL Developer

Problem
Assume I created a stored procedure which named PROC_FMS406R_TAB5_RPT1_STEP1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
create or replace PROCEDURE PROC_FMS406R_TAB5_RPT1_STEP1 
(
  INPUT_YYY_MM IN VARCHAR2 
, INPUT_LAST_YEAR IN VARCHAR2 
, INPUT_USER_ID IN VARCHAR2 
) AS 
BEGIN
  
  --1.5.2 計算『歲入估測分析表(含特別預算)』上一年度的一月到12月的實際數
 -- ignore execution detail

  
  
 --1.5.3 計算『歲入估測分析表(含特別預算)』上一年度的合計數
 -- ignore execution detail
  
END PROC_FMS406R_TAB5_RPT1_STEP1;


I tried to execute PROC_FMS406R_TAB5_RPT1_STEP1 in SQL worksheet


It will fail to execute and show this error message:

1
2
3
4
命令的第 2 行開始發生錯誤 -
PROC_FMS406R_TAB5_RPT1_STEP1(:INPUT_YYY_MM, :INPUT_LAST_YEAR, :INPUT_USER_ID)
錯誤報告 -
不明的命令

How to Fix This Problem
Add BEGIN before the stored procedure and add END; after the stored procedure.

1
2
3
BEGIN
PROC_FMS406R_TAB5_RPT1_STEP1(:INPUT_YYY_MM, :INPUT_LAST_YEAR, :INPUT_USER_ID);
END;


Reference
[1] http://dba.stackexchange.com/questions/57163/how-to-run-procedure-in-oracle-sql-developer