procedure

Oracle [Procedure] - Sum function ignores WHERE clause

穿精又带淫゛_ 提交于 2021-02-17 05:32:06
问题 I have a problem with a ORACLE Procedure, it seems that SELECT SUM ignores my WHERE clause, and Sums up ALL of the columns instead of only those that i want to (deptno). However if i use one of this functions like this for example : select SUM(SAL) AS SALSUM FROM SCOTT.EMP WHERE SCOTT.EMP.DEPTNO = 10; It displays the proper SUM. What may be the problem? Thanks for help. CREATE OR REPLACE PROCEDURE PROCEDURE1(numerdept IN number, money OUT number) IS SALSUM NUMBER; COMMSUM NUMBER; WYJATEK

Indicate a valid procedure call

我的未来我决定 提交于 2021-02-11 12:50:32
问题 I come with a question and hope to get an answer Well, my question is: Indicate the correct procedure call I wonder about the answers: b or d but I do not know if this is a good "way of thinking" create procedure car2(out average float) begin select avg(cena) into average from car; end // a) call car2 (average); b) call car2 (@total); c) call car2 (); d) Neither answer is correct Thank you in advance for your answer and maybe explaining why this answer and not another one 回答1: The answer a)

How to solved problem with Oracle DBMS_LOB

痴心易碎 提交于 2021-02-10 05:52:16
问题 I am trying to save the information of an XML file in a database table and I am using this procedure: create or replace PROCEDURE P_FILEUPLOAD_XML (P_CMTT_CODE IN NUMBER DEFAULT 15, P_TEXT IN VARCHAR2, P_TEXT_NAR IN VARCHAR2, P_PATH IN VARCHAR2, P_FILENAME IN VARCHAR2, P_RET_VAL OUT NUMBER) IS GRUPO VARCHAR2(20); l_dir CONSTANT VARCHAR2(35) := P_PATH; l_fil CONSTANT VARCHAR2(30) := P_FILENAME; l_loc BFILE; -- Pointer to the BFILE l_ret BOOLEAN := FALSE; -- Return value l_pos NUMBER := 1; --

how to execute stored procedure through node js

北城以北 提交于 2021-02-10 05:31:20
问题 I am using db-oracle module (node.js) to query the tables (SEARCH command). I am able to fetch the records successfully. I need to execute the stored procedure. Any idea how to execute a oracle stored procedure from node js code ? Can i execute through db-oracle module ? Or anyother module is available ? Note: The stored procedure returns multiple values, I need to capture that too. 回答1: You should be able to call that procedure from the .query method, like: var oracle = require('db-oracle');

How to stop a running procedure in MySQL?

依然范特西╮ 提交于 2021-02-08 13:11:36
问题 I called a procedure in MySQL, but it is in an endless loop now! How to stop a running procedure in MySQL? The following is my procedure code: drop procedure if exists my_proc; DELIMITER $$ CREATE PROCEDURE my_proc () BEGIN DECLARE VAR INT; SET VAR=0; WHILE VAR<10000 DO INSERT INTO my_table () VALUES (); END WHILE; END; $$ DELIMITER; CALL my_proc(); 回答1: Connect to the server (or use phpmyadmin or something similar) and do: SHOW PROCESSLIST; Find the process causing trouble, note its ID and

How to stop a running procedure in MySQL?

五迷三道 提交于 2021-02-08 13:11:16
问题 I called a procedure in MySQL, but it is in an endless loop now! How to stop a running procedure in MySQL? The following is my procedure code: drop procedure if exists my_proc; DELIMITER $$ CREATE PROCEDURE my_proc () BEGIN DECLARE VAR INT; SET VAR=0; WHILE VAR<10000 DO INSERT INTO my_table () VALUES (); END WHILE; END; $$ DELIMITER; CALL my_proc(); 回答1: Connect to the server (or use phpmyadmin or something similar) and do: SHOW PROCESSLIST; Find the process causing trouble, note its ID and

db2 for i : passing a varchar containing comma separated string in an sql procedure in in clause

北城以北 提交于 2021-02-08 10:28:15
问题 i have a string containing comma separated strings in java.. which i m passing to a sql procedure being called in java ... here is example of java string: String codeString = "'232/232','34fd/34//'"; code in sql db2 for i: create procedure history (in id varchar (3), in code varchar (2000)) ...... ...... begin insert into table1 select date_from, date_to, code from table2 where table2.serial= id and table2.status not in (code); end this sql procedure is inserting same string in table1.code

“x is a procedure, use ”call“” when I am already using call

拈花ヽ惹草 提交于 2021-02-05 07:09:49
问题 I'm using Postgres 12 and have written this procedure: CREATE OR REPLACE PROCEDURE reduceStock(id INTEGER, soldQuantity INTEGER) LANGUAGE plpgsql AS $$ BEGIN UPDATE inventory SET ProductStockAmount = ProductStockAmount - soldQuantity WHERE ProductID = id; END; $$; It works perfectly if I open up psql on the command line and run call reduceStock(1,1); However, calling it from my Java program as follows: CallableStatement stmt = conn.prepareCall("{call reduceStock(?, ?)}"); stmt.setInt(1,

“x is a procedure, use ”call“” when I am already using call

空扰寡人 提交于 2021-02-05 07:09:34
问题 I'm using Postgres 12 and have written this procedure: CREATE OR REPLACE PROCEDURE reduceStock(id INTEGER, soldQuantity INTEGER) LANGUAGE plpgsql AS $$ BEGIN UPDATE inventory SET ProductStockAmount = ProductStockAmount - soldQuantity WHERE ProductID = id; END; $$; It works perfectly if I open up psql on the command line and run call reduceStock(1,1); However, calling it from my Java program as follows: CallableStatement stmt = conn.prepareCall("{call reduceStock(?, ?)}"); stmt.setInt(1,

“x is a procedure, use ”call“” when I am already using call

廉价感情. 提交于 2021-02-05 07:09:23
问题 I'm using Postgres 12 and have written this procedure: CREATE OR REPLACE PROCEDURE reduceStock(id INTEGER, soldQuantity INTEGER) LANGUAGE plpgsql AS $$ BEGIN UPDATE inventory SET ProductStockAmount = ProductStockAmount - soldQuantity WHERE ProductID = id; END; $$; It works perfectly if I open up psql on the command line and run call reduceStock(1,1); However, calling it from my Java program as follows: CallableStatement stmt = conn.prepareCall("{call reduceStock(?, ?)}"); stmt.setInt(1,