PL/SQL procedure does not compile
Hello guys! I worked on a procedure these days, and even if the result looks good to me, I can not compile the proc error ORA-00933.Can you please have a look at - 4 eyes can detect more than two ;-)
Thank you very much! I appreciate your help and your advice!
ARO
SEB
create or replace
PROCEDURE "PR_FANGZAHLEN_TW_SK"
(PR_falle NUMBER, PR_fallennummer NUMBER, PR_schaedling NUMBER)
IS
datum_letzter_datensatz DATE;
diff_datum NUMBER (10);
tagesfang NUMBER (12);
y NUMBER (10);
BEGIN
/*Date of first record*/
select min(f.date_datum)
into datum_letzter_datensatz
from borki.fangzahlen f
where f.lng_falle = PR_falle
and f.int_fallennummer = PR_fallennummer
and f.lng_schaedling = PR_schaedling;
IF EXISTS (select *
FROM borki.fangzahlen f
WHERE f.lng_falle = PR_falle
AND f.int_fallennummer = PR_fallennummer
AND (f.lng_schaedling = PR_schaedling)
AND ((f.date_datum - datum_letzter_datensatz) > 0)
AND ((f.int_anzahl > 0) or (f.int_volumen > 0))
)
THEN
select (case
when f.int_volumen > 0 and f.lng_schaedling = 1 then f.int_volumen * 40
when f.int_volumen > 0 and f.lng_schaedling = 2 then f.int_volumen * 550
when f.int_anzahl > 0 then f.int_anzahl
end)
/ (f.date_datum - datum_letzter_datensatz)
into tagesfang
from fangzahlen f
where (f.lng_falle = pr_falle)
and (f.int_fallennummer = pr_fallennummer)
and (f.lng_schaedling = pr_schaedling)
and ((f.date_datum - datum_letzter_datensatz) > 0)
and ((f.int_anzahl > 0) or (f.int_volumen > 0))
y := 1;
WHILE y < diff_datum + 1
LOOP
/* Insert FANGZAHLEN_TAGESWERTE*/
INSERT INTO fangzahlen_tageswerte
(objectid, lng_falle,
date_datum, int_fallennummer,
lng_schaedling, int_volumen, int_anzahl, lng_fangzahlen
)
SELECT seq_fangzahlen_tageswerte.NEXTVAL, f.lng_falle,
datum_letzter_datensatz + y, f.int_fallennummer,
f.lng_schaedling, f.int_volumen, tagesfang, f.objectid
from fangzahlen f
where f.lng_falle = PR_falle
and f.int_fallennummer = PR_fallennummer
and f.lng_schaedling = PR_schaedling
and (f.date_datum - datum_letzter_datensatz) > 0
and (f.int_anzahl > 0) or (f.int_volumen > 0)
y := y + 1;
END LOOP;
END IF;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
-- Consider logging the error and then re-raise
RAISE;
END "PR_FANGZAHLEN_TW_SK";
Edited by: skahlert the 06.04.2010 07:57
It's your EXISTS, you cannot use this way. You will need to use a different SELECT INTO (you can add AND ROWNUM = 1) or a CASE statement. Looks like you are testing the existence of certain data and depending on whether you want to process the data.
It reminds me of this: http://tkyte.blogspot.com/2008/12/doing-it-wrong.html
You might consider restructuring your code. (Less code is less bugs =)
Tags: Database
Similar Questions
-
Why PL/SQL procedures does not allow users to enter data dynamically at run time?
Dear all,
I tried to do a procedure that will search for a group of approval in our database that matches.
(1) the number of levels
(2) the number of users by each level
(3) the id of users by level
entered by the user.
I tried various methods to receive user input dynamically at run time, but in vain.
Finally finished my procedure allowing the user to enter the parameters and then executes the procedure, to which these parameters are passed as arguments. (1 variable for the number of levels and 2 userdefinedarrays with the number of users by level and level respectively)
Why PL/SQL procedures does not allow users to enter data dynamically at run time?
Thanks in advance,
Séverine Suresh
HEY, Sebastian,
3035408 wrote:
Hello Sir,
My question is that if I'm going to say, the number of levels 5, is there any way by which, at runtime, the procedure prompts me to enter at the start of the number of users per level. Now as soon as I get the number of users per level can I do the procedure ask me to enter the nicknames of the members of each level. I mean, something like a invite.
Thank you
Séverine Suresh
There is no way to do it in SQL or PL/SQL, because not SQL PL/SQL is a way to get user input. User interaction is a job for your front end, like Zlatko tool suggested in response to #5. If your front end tool is SQL * Plus, you can use the substtitution variables, as Jarkko showed in response #6.
-
Hi all
I'm writing a procedure that contains a loop, however its compilation does not. Please take a look.
I'm using Oracle 11 g and SQL Dev 3.0.
Let me explain what I'm trying to do, the procedure is to loop through the layout table for the submission_id where status_code in 1 and 3.
Then, I need to use a case statement to check the status_code. When status_code = 1 do something when status_code = 3 do something else.
Currently, my procedure is not compiled, please take a look at my procedure below.
Errorscreate or replace PROCEDURE RUN_ENQUEUE AS CODE NUMBER(2) := 0; BEGIN FOR I IN (SELECT SUBMISSION_ID FROM USSC_CASES.SUBMISSION WHERE STATUS_CODE IN (1,3)) LOOP SELECT STATUS_CODE INTO CODE FROM USSC_CASES.SUBMISSION WHERE SUBMISSION_ID = I.SUBMISSION_ID; //getting status_code for current submission_id (I.SUBMISSION_ID) CASE -- SUBMIT CASES WHEN CODE = 1 // CHECK CODE THEN EXECUTE ONDEMAND_CASE_QUEUE_PKG.ENQUEUE_SUBMIT(I.SUBMISSION_ID) -- REJECT CASES WHEN CODE = 3 THEN EXECUTE ONDEMAND_CASE_QUEUE_PKG.ENQUEUE_REJECT(I.SUBMISSION_ID) END; END LOOP; END RUN_ENQUEUE;
Thanks for the help.Error(17,18): PLS-00103: Encountered the symbol "ONDEMAND_CASE_QUEUE_PKG" when expecting one of the following: := . ( @ % ; immediate The symbol ":=" was substituted for "ONDEMAND_CASE_QUEUE_PKG" to continue. Error(19,4): PLS-00103: Encountered the symbol "WHEN" when expecting one of the following: . ( * % & = - + ; < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset The symbol ";" was substituted for "WHEN" to continue. Error(20,18): PLS-00103: Encountered the symbol "ONDEMAND_CASE_QUEUE_PKG" when expecting one of the following: := . ( @ % ; immediate The symbol ":=" was substituted for "ONDEMAND_CASE_QUEUE_PKG" to continue. Error(21,3): PLS-00103: Encountered the symbol "END" when expecting one of the following: . ( * % & = - + ; < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between || multiset member submultiset
I just edited, missing the *; * After the ONDEMAND_CASE_QUEUE_PKG call. ENQUEUE_SUBMIT procedures.
Please try to run it again:
create or replace PROCEDURE RUN_ENQUEUE AS CODE NUMBER(2) := 0; BEGIN FOR I IN (SELECT SUBMISSION_ID FROM USSC_CASES.SUBMISSION WHERE STATUS_CODE IN (1,3)) LOOP SELECT STATUS_CODE INTO CODE FROM USSC_CASES.SUBMISSION WHERE SUBMISSION_ID = I.SUBMISSION_ID; IF CODE = 1 THEN ONDEMAND_CASE_QUEUE_PKG.ENQUEUE_SUBMIT(I.SUBMISSION_ID); ELSIF CODE = 3 THEN ONDEMAND_CASE_QUEUE_PKG.ENQUEUE_REJECT(I.SUBMISSION_ID); END IF; END LOOP; END RUN_ENQUEUE;
-
SQL procedure does not work with 'current cursor' Oracle 11 g
Hi all
I've written a procedure that should update all rows for a single column on a given table.
Here is the code:
CREATE OR REPLACE PROCEDURE "xxx". "" loop_update_autowert_x ".
(
number of startwert
column_name VARCHAR2,
table_name varchar2
)
AS
stmt varchar2 (2000);
stmt2 varchar2 (2000);
number of zaehler;
number of sum_gesamt;
TYPE obj_ref_type IS REF CURSOR;
obj_cur obj_ref_type;
Start
stmt2: = ' select rownum, rowid of | table_name | "for update";
Obj_cur OPEN FOR stmt2;
dbms_output. Enable (1000000);
dbms_output.put_line (' ist Startwert: ' | startwert);
dbms_output.put_line (' ist column name: ' | column_name);
dbms_output.put_line (' ist Table name: ' | table_name);
loop
extract the obj_cur in zaehler, my_rowid;
exit WHEN obj_cur % NOTFOUND;
sum_gesamt: = zaehler + startwert;
stmt: = "update". table_name | 'set ' | column_name | ' = ' || sum_gesamt | "WHERE the current of obj_cur";
dbms_output.put_line (stmt);
immediately execute stmt;
end loop;
close obj_cur;
end;
the error I get is:
Anmeldung bei der data base Oracle Test2.
ORA-03001: Funktion nicht solution
ORA-06512: in "xxx.loop_update_autowert_x", line 29
ORA-06512: In line 10
Startwert ist: 5
Column name ist: one
Table Name is: T
Update T set a = 6 WHERE the currents of obj_cur
Process finished.
Abmeldung von der data base Oracle Test2.
have anyone an idea what is wrong or this construction with the clause "cursor open for the statement" is not possible with the current cursor location
thx for help
Best regards
Hans-PeterWhen informed of the cursor works with static cursors and static sql only.
----------
Sybrand Bakker
Senior Oracle DBA -
Procedure does not--a number not valid online 12
Question: Dear professional PL/SQL! I'm a little desperate as my procedure does not work for all my variables. The debugger in SQL-Developer produces a message error "invalid number on line 12. I checked back and fourth but can't find any error.
You can find the bug or lead my on the right track?
Here are some example data:
P_CNT_GEBIET =' 5630-372
P_STR_LRT = '9170'
P_WG = 5
P_BE = 1
Curious is the fact that it works perfectly when P_STR_LRT is '9110'. With '9170' or '9171' it doesn't work anymore.
Any help is greatly appreciated.
BR,
SEB
My Proc:
create or replace PROCEDURE PROC_TBL_MATRIX_INTMED_CE ( P_CNT_GEBIET VARCHAR2, P_STR_LRT VARCHAR2, P_BE NUMBER, P_WG NUMBER) AS BEGIN DECLARE CNUMBER number; BEGIN SELECT COUNT(*) INTO CNUMBER FROM TBL_MATRIX_INTERMEDIATE_RESULT WHERE LNG_GEBIET = P_CNT_GEBIET AND STR_LRT_CLASS = P_STR_LRT AND INT_BE = P_BE AND INT_WG = P_WG AND EVAL_TYPE = 2; IF CNUMBER = 0 THEN INSERT INTO TBL_MATRIX_INTERMEDIATE_RESULT (LNG_BAUMART, STR_BA_LANG, STR_BA_KAT, STR_BA_GRUPPE, INT_PROZENT, INT_SELTEN, EVAL_TYPE, FLAG, LNG_GEBIET, STR_LRT_CLASS, INT_WG, INT_BE, STR_GEWERTET) SELECT Z.CNT_BAUMART, Z.BA_LANG, Z.BA_KAT, Z.BA_GRUPPE, Z.PROZENT, DECODE(Z.BA_KAT,'B','von Natur aus selten') AS SELTEN, 2, 0, P_CNT_GEBIET, P_STR_LRT, P_WG, P_BE, CASE WHEN Z.CNT_BAUMART = 74 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (5, 6, 7, 8, 9, 81)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.CNT_BAUMART = 72 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (22,23,24,25,26,27)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.CNT_BAUMART = 71 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (46,47)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.CNT_BAUMART = 54 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (13, 14, 15)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.CNT_BAUMART = 53 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (28,29,30,31,32,33,79)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.CNT_BAUMART = 78 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (62)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.BA_KAT = 'N' AND Z.PROZENT > 1 THEN 'Ja' WHEN Z.BA_KAT = 'H' AND Z.PROZENT > 1 THEN 'Ja' WHEN Z.BA_KAT = 'P' AND Z.PROZENT > 1 THEN 'Ja' WHEN Z.BA_KAT = 'B' AND Z.PROZENT !=0 THEN 'Ja' ELSE 'Nein' END AS GEWERTET FROM ((SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT, X.BA_GRUPPE FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, X.BA_GRUPPE ) UNION ALL (SELECT DISTINCT R.CNT_BAUMART, R.BA_LANG, D.BA_KAT, NULL PROZENT, DECODE(R.BA_GRUPPE,1,'Ba-Grp. 1',2,'Ba-Grp. 2',3,'Ba-Grp 3',4,'Ba-Grp. 4',5,'Ba-Grp. 5',6,'Ba-Grp. 6',7,'Ba-Grp. 7',8,'Ba-Grp. 8') BA_GRUPPE FROM VT_TBL_BAUMART R, VT_TBL_MATRIX_CUSTOM_EVAL D WHERE R.CNT_BAUMART = D.LNG_BAUMART AND (D.LRT_CLASS = P_STR_LRT) AND D.BA_KAT IN ('B','H', 'P', 'N') AND (R.CNT_BAUMART NOT IN (SELECT DISTINCT B4.CNT_BAUMART FROM VT_TBL_BESTAND V4, VT_PUNKTDATEN_JOIN P4, VT_TBL_BAUMART B4, VT_TBL_MATRIX_CUSTOM_EVAL X4 WHERE (P4.CNT_GEBIET = P_CNT_GEBIET) AND (V4.LNG_BAUMART = B4.CNT_BAUMART) AND (V4.LNG_INV_PT_ID = P4.INV_PT_ID_SUB) AND (P4.STR_LRT_MAIN = P_STR_LRT) AND (P4.INT_WG = P_WG) AND (P4.INT_BE_MAIN = P_BE) AND (P4.INT_STATUS_SUB = 3) AND (X4.LNG_GEBIET= P_CNT_GEBIET) AND (X4.LRT_CLASS = P_STR_LRT) AND (X4.INT_WG = P_WG) AND (X4.INT_BE = P_BE) AND (X4.LNG_BAUMART=V4.LNG_BAUMART)))) ) Z GROUP BY CNT_BAUMART, BA_LANG, BA_KAT, BA_GRUPPE, PROZENT UNION SELECT NULL, 'Gewertete BA > 1%' BA_LANG, NULL, NULL, NULL, NULL, 2, 1, P_CNT_GEBIET, P_STR_LRT, P_WG, P_BE, (SELECT TO_CHAR(COUNT(GEWERTET)) GEWERTET FROM (SELECT Z.CNT_BAUMART, Z.BA_KAT, Z.BA_GRUPPE, Z.PROZENT , CASE WHEN Z.CNT_BAUMART = 74 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (5, 6, 7, 8, 9, 81)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.CNT_BAUMART = 72 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (22,23,24,25,26,27)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.CNT_BAUMART = 71 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (46,47)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.CNT_BAUMART = 54 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (13, 14, 15)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.CNT_BAUMART = 53 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (28,29,30,31,32,33,79)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.CNT_BAUMART = 78 AND Z.PROZENT IS NOT NULL AND (SELECT COUNT(*) FROM(SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) AND (B.CNT_BAUMART IN (62)) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT )) = 0 THEN 'Ja' WHEN Z.BA_KAT = 'N' AND Z.PROZENT > 1 THEN 'Ja' WHEN Z.BA_KAT = 'H' AND Z.PROZENT > 1 THEN 'Ja' WHEN Z.BA_KAT = 'P' AND Z.PROZENT > 1 THEN 'Ja' WHEN Z.BA_KAT = 'B' AND Z.PROZENT !=0 THEN 'Ja' ELSE 'Nein' END AS GEWERTET FROM ((SELECT B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, SUM(V.DBL_BESTAND) * 100 / (SELECT SUM(V2.DBL_BESTAND) FROM VT_TBL_BESTAND V2, VT_PUNKTDATEN_JOIN P2 WHERE (P2.CNT_GEBIET = P_CNT_GEBIET) AND (V2.LNG_INV_PT_ID = P2.INV_PT_ID_SUB) AND (P2.STR_LRT_MAIN = P_STR_LRT) AND (P2.INT_WG = P_WG) AND (P2.INT_STATUS_SUB = 3) AND (P2.INT_BE_MAIN = P_BE)) AS PROZENT, X.BA_GRUPPE FROM VT_TBL_BESTAND V, VT_PUNKTDATEN_JOIN P, VT_TBL_BAUMART B, VT_TBL_MATRIX_CUSTOM_EVAL X WHERE (P.CNT_GEBIET = P_CNT_GEBIET) AND (V.LNG_BAUMART = B.CNT_BAUMART) AND (V.LNG_INV_PT_ID = P.INV_PT_ID_SUB) AND (P.STR_LRT_MAIN = P_STR_LRT) AND (P.INT_WG = P_WG) AND (P.INT_BE_MAIN = P_BE) AND (P.INT_STATUS_SUB = 3) AND (X.LNG_GEBIET= P_CNT_GEBIET) AND (X.LRT_CLASS = P_STR_LRT) AND (X.INT_WG = P_WG) AND (X.INT_BE = P_BE) AND (X.LNG_BAUMART = V.LNG_BAUMART) AND (X.BA_KAT IN ('B','H', 'P', 'N')) GROUP BY B.CNT_BAUMART, B.BA_LANG, X.BA_KAT, X.BA_GRUPPE ) UNION ALL (SELECT DISTINCT R.CNT_BAUMART, R.BA_LANG, D.BA_KAT, NULL PROZENT, DECODE(R.BA_GRUPPE,1,'Ba-Grp. 1',2,'Ba-Grp. 2',3,'Ba-Grp 3',4,'Ba-Grp. 4',5,'Ba-Grp. 5',6,'Ba-Grp. 6',7,'Ba-Grp. 7',8,'Ba-Grp. 8') BA_GRUPPE FROM VT_TBL_BAUMART R, VT_TBL_MATRIX_CUSTOM_EVAL D WHERE R.CNT_BAUMART = D.LNG_BAUMART AND (D.LRT_CLASS = P_STR_LRT) AND D.BA_KAT IN ('B','H', 'P', 'N') AND (R.CNT_BAUMART NOT IN (SELECT DISTINCT B4.CNT_BAUMART FROM VT_TBL_BESTAND V4, VT_PUNKTDATEN_JOIN P4, VT_TBL_BAUMART B4, VT_TBL_MATRIX_CUSTOM_EVAL X4 WHERE (P4.CNT_GEBIET = P_CNT_GEBIET) AND (V4.LNG_BAUMART = B4.CNT_BAUMART) AND (V4.LNG_INV_PT_ID = P4.INV_PT_ID_SUB) AND (P4.STR_LRT_MAIN = P_STR_LRT) AND (P4.INT_WG = P_WG) AND (P4.INT_BE_MAIN = P_BE) AND (P4.INT_STATUS_SUB = 3) AND (X4.LNG_GEBIET= P_CNT_GEBIET) AND (X4.LRT_CLASS = P_STR_LRT) AND (X4.INT_WG = P_WG) AND (X4.INT_BE = P_BE) AND (X4.LNG_BAUMART=V4.LNG_BAUMART)))) ) Z ) WHERE GEWERTET = 'Ja') PROZENT FROM DUAL; END IF; END; END PROC_TBL_MATRIX_INTMED_CE;
Hello
It's a question of data.
All the values you pass for column LNG_GEBIET?
Concerning
AJR -
My first ARM VI does not compile
Hello
I'm a beginner full and just tried to compile the example VI of the "Getting started with LabVIEW Embedded Module for ARM microcontrollers. I understand not all uVision and correlations LV Embededd ARM and the VI does not compile. Here is my system:
LabVIEW 8.61f1
LabVIEW Embedded for ARM 8.6
Keil uVision 4.13 has
MCB2378 & ULINK2 purchased through the JTAG Board of NOR
I created the project step by step as indicated in the manual above. Before attemtping to Build/Run the VI 'Processor Status' window shows:
uVision status: [LED = Blue] loan
uVision request: [LED = Green] Application
After I start Build/Run I get "Build error" window saying "failed script uVision build tools. By pressing the button "View error...". "gives me the following result"detailed ":
Call library function node in UVSC_OpenConnection.vi-> UVSock_Start_Daemon.vi->
UVSock_Start.vi-> UVControl_Start.vi-> LEP_RV_Build.vi-> LEP_RV_Run_Debug.vi->
LEP_RV_Debug.VI-> LEP_RV_Run.vi-> LEP_RV_Run.vi.ProxyCaller (7)
Until I have leave this window "the uVision status led" in 'the processor status' is Orange!
I would really appreciate help to overcome this situation, I do not understand so I could continue with the chessboard of ARMS by LV instead of via programming uVision. Examples of uVision compile and work OK, so theere must be a problem between the LV-ARM and the native build tools.
Thank you in advance,
OK, solved!
If there is leftover uVision3 or one simply
preses in the dialog asking if upgraded to uVision3 model after the first use of the saved in uVision3 - last project there will be an ongoing problem, as initially indicated. Just uninstall the two LV to ARMS 2010 and Keil uVision 4 toolchain and reinstall them - it works OK.
Best regards
-
ORA-13780: SQL statement does not exist
Hello
on the 11g R2, I get the following message:
Any idea?SQL> variable stmt_task VARCHAR2(64); SQL> EXEC :stmt_task := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_id => 'gh9p77g1fr0kd'); BEGIN :stmt_task := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_id => 'gh9p77g1fr0kd'); END; * ERROR at line 1: ORA-13780: SQL statement does not exist. ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79 ORA-06512: at "SYS.PRVT_SQLADV_INFRA", line 125 ORA-06512: at "SYS.DBMS_SQLTUNE", line 655 ORA-06512: at line 1
Thank you.Sql and the sql_id execution plan has been emptied out of the shared pool, so oracle could not find it.
-Thank you
-
my SQL Developer does not work properly! Help
Hello!!
My problem here is not like I can't live or work, but it's REALLY annoying, see my SQL Developer does not take any different key of letters and the space bar, I mean, if I use the Enter key, does not alter the line, if I use the return key back isn't clear if I use F5/F9 does not execute the msec! and if the keys don't work!
any ideas why this is happening? and if yes how do fix this problem?There is a well known bug but still not solved, causing this type of behavior, if you are a developer SQL 1.5.X you can work around the problem by loading the accelerators by default:
Tools-> accelerators-> load Preset-> by default
If you're on 2.1.X preset may be responsible for
Tools-> preferences->-> others-> load keyboard accelerators
2.1 this problem has not been reported so far, so if you are in 1.5.X you can consider upgrading.
-
My pl/sql codes does not in the express edition, which can do?
pls help me my pl/sql codes does not work in oracle 10g express edition, which can do? pls help me.You must open a window for cmd.exe with Windows Start menu, then run, and type: cmd.exe. The rest is in my previous message.
-
Procedure does not display output
Hello!
The following procedure does not show the output.
{create or replace procedure GET_USER
(username_in IN VARCHAR2, password_in IN VARCHAR2, OUT VARCHAR2 first_name, last_name OUT VARCHAR2)
is
Start
Declare the cursor is c_user (users.username%TYPE, i_password IN users.password%TYPE IN i_username)
Select first_name, last_name
users
where username_in = i_username
and password_in = i_password;
i_username users.username%TYPE;
i_password users.password%TYPE;
l_first_name users.first_name%TYPE;
l_last_name users.last_name%TYPE;
Start
If c_user % isopen then
close c_user;
end if;
Open c_user (i_username, i_password);
extract the c_user in l_first_name l_last_name;
close c_user;
first name: = l_first_name;
name: = l_last_name;
end;
end GET_USER ;}
Output showing only:
Name =
Last_name =
Thanks for any help!Assuming that your cursor never returns a line with name of user and password (if it is not, which seems quite a big security hole!), then your code could just be rewritten:
create or replace procedure GET_USER (p_username_in IN VARCHAR2, p_password_in IN VARCHAR2, p_first_name OUT VARCHAR2, p_last_name OUT VARCHAR2) is begin select first_name, last_name into p_first_name, p_last_name from users where username_in = p_username_in and password_in = p_password_in; end GET_USER; /
I modified your parameter names, as they have matched the same names as the columns in your table, and it's usually a Really Bad Idea (tm)! Keep all your unique identifiers, and you will have less problems!
-
newbie question: sql runs under sqlplus but does not compile in pl/sql?
I have the following two tables, I have a SQL in pl/sql packages so I can use dbms_jobs to automate it however, I get the compile time error. It seems to me that pl/sql dislikes my sql that works well in sqlplus. Here is the error message and my test case?
mdb_user@cmd > view the error
PACKAGE BODY DATA_QUALITY_REPORT_P errors:
LINE/COL ERROR
-------- -----------------------------------------------------------------
10/1 PL/SQL: statement ignored
13/42 PL/SQL: ORA-00942: table or view does not exist
create the table S_ORG_EXT
(
accnt_type_cd varchar2 (100),
cust_stat_cd varchar2 (100)
)
/
insert into s_org_ext
Select column_name, data_type for user_tab_columns where rownum < = 100
/
Select * from s_org_ext
/
create the table data_quality_report
(
RunId number not null,
report_type number of non-null, - type of report as dup dup or not other measures
org_level number not null, - organization level nsgn, sgn, shipto
loc_level number of non-null, - local level by city, by country, by region, grand_total
name varchar2 (100) not null,-the line output of the tot name.
Value number not null, - line value of the tot.
rundate date default sysdate
)
/
create sequence data_quality_report_seq with 1000
INCREMENT BY 1
NOCACHE
NOCYCLE
/
insert into data_quality_report
Select data_quality_report_seq.nextval, 3, 99, 99, accnt_type_cd, cnt, sysdate from
(
Select accnt_type_cd, count cnt (*) of S_ORG_EXT where cust_stat_cd = 'VARCHAR2' group by accnt_type_cd by 2 desc order
)
/
Select * from data_quality_report
/
truncate table data_quality_report
CREATE or replace PACKAGE data_quality_report_p AS
function pull_data return data_quality_report.runid%type;
END data_quality_report_p;
/
create or replace package body data_quality_report_p as
function pull_data return data_quality_report.runid%type is
new_rid data_quality_report.runid%type;
Start
Select data_quality_report_seq.nextval in the double new_rid;
insert into data_quality_report
Select new_rid, 3, 999999, 999999, accnt_type_cd, cnt, sysdate from
(
Select accnt_type_cd, count cnt (*) of S_ORG_EXT where cust_stat_cd = 'VARCHAR2' group by accnt_type_cd by 2 desc order
);
Return new_rid;
exception
When no_data_found then
DBMS_OUTPUT. Put_line ("NO_DATA_FOUND handles the exception.");
while others then
DBMS_OUTPUT. Put_line ("' handling ANOTHER exception.");
end; -end pull_data
end data_quality_report_p;
/Hello
Sorry, I was not clear about that.
The owner of the package needs direct privileges (not only privileges through a role) to compile the code, whehter it is DEFINE AUTHID or AUTHID CURRENT_USER. Option (3) does not help in this case; my mistake.I usually create packages in the same schema tables they use, which was option (2) in my previous message. There may be good reasons why you can't do that; for example, the package may reference multiple schemas tables. In this case, grant the necessary privileges directly to the owner of the whole.
-
Function standard SQL does not compile in formula
I get an error when trying to use nvl2 within a formula. It returns an error "nvl2 identifier must be declared. I am connected to a database while trying to compile. What could be the problem?BTW, I tried this in the database (10g, 11 g have), and it does not work either. Pl/sql v10 just does not support the nvl2.
declare mynumber number(1); begin mynumber := nvl2(null, 1, 2); -- this gives a compilation error dbms_output.put_line(mynumber); mynumber := nvl(null, 1); -- this works dbms_output.put_line(mynumber); end;
-
For loop stored procedure does not
Hello
I wrote a stored procedure that does not work (I mean do not display data)
I set serveroutput on option also.
If I run as a single SQL query its working very well. so please help
create or replace procedure show_empnos (p_deptno number)
is
emp_id emp. EMP_ID % TYPE;
cursor cur_emps is
Select emp_id emp where department_id = '12';
Start
for a cur_emps in
loop
dbms_output.put_line (emp_id);
end loop;
end;
See, when I ran that a single SQL interrogate data dosplayed
SQL > select emp_id from emp where department_id = '12';
EMP_ID
----------
* 101 *.
* 101 *.
* 101 *.
Help, please.You declare a local variable EMP_ID you initialize ever, so it will always be NULL.
In your cursor, you also select a column EMP_ID.The line
dbms_output.put_line(emp_id);
solve the use of uninitialized local variable and then print a NULL value (which would appear as a blank line in the output). Assuming you want to return the value of the column EMP_ID your cursor, you need
dbms_output.put_line(a.emp_id);
As a general approach, including local variables whose names match exactly in the name of a column will create problems on the line where you write the code assumes that you speak for column only to discover that the identifier is resolved to the local variable instead. If you need a local variable to store the EMP_ID, therefore, it would make much more sense to declare it as
l_emp_id emp.EMP_ID%TYPE;
While it is not accidentally get confused with the name of the column.
Finally, if department_id is a NUMBER, it should be compared to a number, not a string, i.e.
WHERE department_id = 12
Justin
-
Beta 3 DW - compass does not compile when DW is reopened
Hello
I created DW Beta 3 this week and everything looks good except for the compilation CSS via the compass
Wednesday I had all works well - config.rb and correct records (I used SASS in the past so have some experience)
The sass/screen.scss has been compiling stylesheets/screen.css - all good. Closed at the end of the day
Thursday, I opened DW and files were compilation not so I have reinstalled the compass installation files, set up the screen.scss again and everything was OK
Saturday - open DW to start work and the compiler has not yet
I'm using the latest beta on Windows 10 with the Google Chrome browser
Any help or advice would be much appreciated
Thank you very much
Julie
You must report all problems from beta to Beta team directly. They are not always aware of the problems.
Log-on the opening page and click on comments in the menu dropdown.
Or, if this does not work for some reason, you can report bugs in the beta version on the link below.
Adobe Dreamweaver (2017 Beta) cc: Feature ideas
Nancy O.
-
AWR SQL Report does not report the stats
AWR report only stats beyond a certain level? I have a statement select simple I know is running (executions of v$ sql increases), but when I run a report AWR SQL (awrsqrpt), it says "no data exists for this section of the report.
Snap Id Snap time Sessions Curs/Sess
--------- ------------------- -------- ---------
BEGIN Snap: 370936 10 June 15 07:00:24 856 36.1
End Snap: 370937 10 June 15 07:20:26 881 38.9
Elapsed time: 20.02 (mins)
DB time: 754.82 (min.)
Summary of SQL DB/Inst: CAMPRD/camprd snaps: 370936-370937
There is no data for this section of the report.
-------------------------------------------------------------
SQL ID: 84kfv4p500pgh DB/Inst: CAMPRD/camprd Snaps: 370936-370937
There is no data for this section of the report.
-------------------------------------------------------------
Full text of SQL
There is no data for this section of the report.
I ran the report on the last 4 days and reports
ORA-20025: SQL 84kfv4p500pgh ID does not exist for this database instance.
and yet, the executions of V$ SQL continues to increase
Thank you
Ian
CWA only captures statements considered to be Top N (DBA_HIST_WR_CONTROL. TOPNSQL)
You can use DBMS_WORKLOAD_REPOSITORY. ADD_COLORED_SQL sort AWR it will include
Maybe you are looking for
-
Equium M40 simply stopped working without warning - do not power led.
My laptop is almost 2 years old and while you browse using the battery it just died without warning.Put it on the sector but no orange at all. I have no power in the machine at all.Its dead as a dodo. My main concern is to get the info off the hard d
-
I have a PXI FPGA RIO of 7133 card. He is seen by MAX but not available through 'my computer' in a project. The card may have been moved to a different location PXI after initial installation. Any suggestions?
-
Hello I got a PC to be flat and re - install. To the rear is an authentic Microsoft XP Home Edition sticker. I downloaded a CD edition of my technet subscription House and tried to install, but whatever I do, the key is invalid. How can I check which
-
"Rev_5 has stopped working" what does that mean?
On switching on, windows displays Rev_5 has stopped working.A problem caused the blocking of the program works correctly. Windows will close the program and notify you if a solution is available.Click to close the program and everything works fine.
-
ON MY LAPTOP DV6-1410EJ UNDER WINDOWS 7 64-BIT, THE TOUCHPADV6.5 SCROLLING HAS STOPPED, AND I CAN'T SELECT THE CHECK BOX TO RESTORE. ALSO, I GET THE MESSAGE