feat: refs #6500 procRefactor8 #2131
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#2131
Loading…
Reference in New Issue
No description provided.
Delete Branch "6500-procRefactor8"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feat: refs #6500 procRefactor8to WIP: feat: refs #6500 procRefactor8WIP: feat: refs #6500 procRefactor8to feat: refs #6500 procRefactor8@ -0,0 +16,4 @@
DROP TEMPORARY TABLE IF EXISTS tCreditClients;
CREATE TEMPORARY TABLE tCreditClients
SELECT clientFk, IF (credit > recovery ,credit - recovery,0) newCredit
Espacios: SELECT clientFk, IF (credit > recovery, credit - recovery, 0) newCredit
@ -0,0 +17,4 @@
DROP TEMPORARY TABLE IF EXISTS tCreditClients;
CREATE TEMPORARY TABLE tCreditClients
SELECT clientFk, IF (credit > recovery ,credit - recovery,0) newCredit
FROM (
tabulación FROM
@ -0,0 +20,4 @@
FROM (
SELECT r.clientFk,
r.amount recovery,
timestampadd(DAY, r.period, sub2.created) deadLine,
INTERVAL
@ -0,0 +26,4 @@
JOIN (
SELECT clientFk, amount , created
FROM (
SELECT * FROM clientCredit
Especificar campos, eliminar *
@ -0,0 +34,4 @@
) sub2 ON sub2.clientFk = r.clientFk
WHERE r.finished IS NULL OR r.finished >= util.VN_CURDATE()
GROUP BY r.clientFk
HAVING deadLine <= util.VN_CURDATE()
tabulación HAVING
@ -0,0 +39,4 @@
WHERE credit > 0;
UPDATE client c
JOIN tCreditClients cc ON cc.clientFk = c.id
tabulación JOIN y SET
@ -0,0 +1,4 @@
-- Place your SQL code here
UPDATE bs.nightTask SET `schema`='vn' WHERE id=22;
Utilizar el nombre del procedure y no la posición
@ -0,0 +1,4 @@
-- Place your SQL code here
UPDATE bs.nightTask SET `schema`='vn' WHERE id=22;
UPDATE bs.nightTask SET `schema`='vn',`procedure`='creditRecovery' WHERE id=30;
Utilizar el nombre del procedure y no la posición
@ -0,0 +1,50 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`creditRecovery`()
BEGIN
Falta descripción del procedimiento
@ -0,0 +1,30 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`raidUpdate`()
BEGIN
falta descripción
@ -0,0 +1,36 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`rateView`()
BEGIN
falta descripción
@ -0,0 +10,4 @@
JOIN (
SELECT *
FROM (
SELECT id, landed, tt.warehouseInFk, tt.warehouseOutFk
faltan alias en los campos
@ -0,0 +19,4 @@
JOIN travel t ON t.id = e.travelFk
GROUP BY t.warehouseInFk, t.warehouseOutFk
) tt ON t.warehouseInFk = tt.warehouseInFk AND t.warehouseOutFk = tt.warehouseOutFk
WHERE shipped > util.VN_CURDATE() AND isDelivered = FALSE
isDelivered = FALSE
NOT isDelivered
Faltan alias
@ -0,0 +18,4 @@
( SELECT
t.year,
t.month,
CAST(SUM(divisa) AS DECIMAL(10,2)) dollars,
faltan alias, no se sabe de que tablas vienen los campos
@ -0,0 +28,4 @@
WHERE p.divisa
AND c.code = 'USD'
GROUP BY t.year, t.month
) pagos ON t.year = pagos.year AND t.month = pagos.MONTH
En la medida de lo posible no se debe de escribir en español, en este caso el nombre de la subconsulta es totalmente evitable que este en español, traducir