Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 32815

Procedural Language/Structured Query Language is Oracle Corporation's procedural language extension for SQL. IBM supports PL/SQL for DB2 since version 9.7. Questions about PL/SQL should probably be tagged "oracle" or "db2" as well.

1
vote
Your code has a few syntax issues, it should be like this: DECLARE Cursor C is select * from Employee ORDER BY salary DESC; Edet C%ROWTYPE; BEGIN Open C; Loop fetch C into Edet; EX …
answered May 21 by Wernfried Domscheit
5
votes
In case of a Nested-Table (i.e. without INDEX BY BINARY_INTEGER) you can also use CARDINALITY V_COUNT := CARDINALITY(MY_ARRAY); Important difference: In case of Nested-Table which is NULL, COUNT r …
answered Feb 24 '15 by Wernfried Domscheit
1
vote
One ad hoc improvement: poor: for root in all_fitting_roots LOOP FITTING := FITTING + 1; END LOOP; better: SELECT COUNT(DISTINCT ROOT_ID) into FITTING FROM ( SELECT UNIQUE_ID, ROOT_ID, FIR …
answered Jul 1 '15 by Wernfried Domscheit
1
vote
'23-OCT-1994' is a string, not a DATE, so TO_CHAR on a character is pointless. First you have to convert your string into a DATE value. You should specify the date format plus the language which is u …
answered Oct 29 '18 by Wernfried Domscheit
0
votes
As already given in the other answers using a trigger for such task is not the preferred way of doing it. For the sake of completeness here a trigger based solution (not tested): create or replace tr …
answered Apr 24 by Wernfried Domscheit
0
votes
It would be something like this: DECLARE cur SYS_FERCURSOR; curid NUMBER; desctab DBMS_SQL.DESC_TAB; colcnt NUMBER; -- total number of columns res NUMBER; namevar VARCHAR2(40 …
answered Apr 11 '18 by Wernfried Domscheit
1
vote
Simply like this: CREATE OR REPLACE TRIGGER orders_changes after drop or alter or create on schema BEGIN insert into table1 values (USER, ora_dict_obj_name); END; See Event Attribute Functions …
answered Dec 18 '18 by Wernfried Domscheit
2
votes
My proposal would be this one: CREATE TABLE UNIQUE_PHYSICIAN ( PARENT_PHYS_ID NUMBER, PHYS_ID NUMBER CONSTRAINT PHYSICIAN_PK PRIMARY KEY); ALTER TABLE DPISYS.UNIQUE_PHYSICIAN ADD CONS …
answered Jun 23 '15 by Wernfried Domscheit