MsSQL to MySQL function conversion - mysql

So I am trying to convert a function I created in MSSQL to MYSQL. The way I have it written in MSSQL is:
ALTER function FormatDate(#date datetime) returns varchar(10)
begin
declare #salida varchar(10)
if (#date != '') and (#date != '01/01/1900')
begin
declare #day varchar(2)
set #day = cast(day(#date) as varchar)
if len(#day) = 1
set #day = '0' + #day
declare #month varchar(2)
set #month = cast(month(#date) as varchar)
if len(#month) = 1
set #month = '0' + #month
select #salida = #month + '/' + #day + '/' + cast(year(#date) as varchar)
end
else
set #salida = null
return #salida
end
I am trying to convert that function into a MYSQL function. I tried this:
Delimiter $$
create function FormatDate(tiempo datetime)
RETURNS varchar(10)
READS SQL DATA
BEGIN
declare salida varchar(10);
if ((tiempo != '') and (tiempo != '01/01/1900')) then
BEGIN
declare dia varchar(2);
set dia = cast(day(tiempo) as varchar);
if len(dia) = 1 then
set dia = '0' + dia;
END IF;
declare mes varchar(2);
set mes = cast(month(tiempo) as varchar);
if len(mes) = 1 then
set mes = '0' + mes;
END IF;
select salida = mes + '/' + dia + '/' + cast(year(tiempo) as varchar);
else
set salida = null;
END; End if;
return (salida);
END $$
Delimiter ;
but I get an error when I try to execute that code.
This is the error I am getting:
Error Code: 1064. You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'varchar);
if len(dia) = 1 then
' at line 14
Can someone please help me convert this MSSQL function into a MYSQL function?

The function to determine a strings lenght in MySQL is called LENGTH(), not len()
http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_length
MORE:
I added a working version of your function below. But please note that the built-in function DATE_FORMAT() does exactly what you want:
mysql> SELECT FormatDate( NOW() ), DATE_FORMAT( NOW(), "%m/%d/%Y" );
+---------------------+----------------------------------+
| FormatDate( NOW() ) | DATE_FORMAT( NOW(), "%m/%d/%Y" ) |
+---------------------+----------------------------------+
| 07/15/2011 | 07/15/2011 |
+---------------------+----------------------------------+
You should either use it or replace your function body with a call of that function. Here is, however, a MySQL compatible version of your function:
DELIMITER $$
CREATE FUNCTION `FormatDate`(tiempo datetime) RETURNS varchar(10)
READS SQL DATA
BEGIN
DECLARE salida VARCHAR(10);
DECLARE dia VARCHAR(2);
DECLARE mes VARCHAR(2);
IF ( (tiempo <> '') AND ( tiempo <> '01/01/1900' ) ) THEN
SET dia := CAST( DAY( tiempo ) AS CHAR );
IF LENGTH( dia ) = 1 THEN
SET dia := CONCAT( '0', dia);
END IF;
SET mes := CAST( MONTH( tiempo ) AS CHAR );
IF LENGTH( mes ) = 1 THEN
SET mes := CONCAT( '0', mes );
END IF;
SET salida := CONCAT_WS( '/', mes, dia, CAST( YEAR( tiempo ) AS CHAR ) );
ELSE
SET salida := NULL;
END IF;
RETURN salida;
END $$
DELIMITER ;

Related

MySQL error after attempting to convert Microsoft SQL function

I am trying to convert a function I made in Microsoft SQL into a function for MySQL however I have absolutely no clue how to do that. I tried converting the original code through SQLines and messing with it to no avail.
The working Microsoft code is
ALTER FUNCTION [dbo].[TotalTripsGuideFunc] (#guideid CHAR(4))
RETURNS VARCHAR
BEGIN
DECLARE #trip_counts INT
DECLARE #results VARCHAR
SELECT #trip_counts = COUNT(*) FROM dbo.Reservation,dbo.TripGuides WHERE Reservation.TripID = TripGuides.TripID AND TripGuides.GuideNum = #guideid
SELECT #results = #guideid + ' has ' + CAST (#trip_counts AS VARCHAR(4))+ ' guides '
RETURN #results
END
and the attempted MySql code is
DELIMITER //
CREATE FUNCTION TotalTripsGuideFunc (p_guideid CHAR(4))
RETURNS VARCHAR(1)
BEGIN
DECLARE v_trip_counts INT DEFAULT 0;
DECLARE v_results VARCHAR(1);
SELECT COUNT(*) INTO v_trip_counts FROM Reservation,TripGuides
WHERE Reservation.TripID = TripGuides.TripID AND TripGuides.GuideNum = p_guideid;
SELECT v_results = concat(p_guideid , ' has ', CAST(v_trip_counts AS CHAR), ' guides ');
RETURN v_results;
END;
//
DELIMITER ;
Which returns the error
1415 - Not allowed to return a result set from a function
EDIT
Here is the revised code
DELIMITER //
CREATE FUNCTION TotalTripsGuideFunc (p_guideid CHAR(4))
RETURNS VARCHAR
BEGIN
DECLARE v_trip_counts INT DEFAULT 0;
DECLARE v_results VARCHAR(30);
SELECT COUNT(*) INTO v_trip_counts FROM Reservation,TripGuides
WHERE Reservation.TripID = TripGuides.TripID AND TripGuides.GuideNum = p_guideid;
SET v_results = concat(p_guideid , ' has ', v_trip_counts, ' guides ');
RETURN v_results;
END;
//
DELIMITER ;
Which returns the new error
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BEGIN DECLARE v_trip_counts INT DEFAULT 0; DECLARE v_results VARCHAR(3' at line 3
Small mistakes:
DECLARE v_results VARCHAR(1); should be a little bigger like DECLARE v_results VARCHAR(30);
RETURNS VARCHAR(1) should be RETURNS VARCHAR
You used the select into right in the first select and wrong in the second. Just need to fix it:
-- from
SELECT v_results = concat(p_guideid , ' has ', CAST(v_trip_counts AS CHAR), ' guides ');
-- to
SELECT concat(p_guideid , ' has ', v_trip_counts, ' guides ') INTO v_results;
-- OR just:
SET v_results = concat(p_guideid , ' has ', v_trip_counts, ' guides ');
-- no need for CAST, MySQL will do implicit conversion
EDIT: here is a working final version:
DELIMITER //
CREATE FUNCTION TotalTripsGuideFunc (p_guideid VARCHAR(30)) RETURNS VARCHAR(30)
BEGIN
DECLARE v_trip_counts INTEGER;
DECLARE v_results VARCHAR(30);
SELECT COUNT(*) INTO v_trip_counts FROM Reservation,TripGuides
WHERE Reservation.TripID = TripGuides.TripID AND TripGuides.GuideNum = p_guideid;
SET v_results = concat(p_guideid , ' has ', v_trip_counts, ' guides ') ;
RETURN v_results;
END
//
DELIMITER ;
I think you should return like this RETURN ( v_results )

#1320 - No RETURN found in FUNCTION MYSQL

I'm try create a function in mysql but
the error is: #1320 - No RETURN found in FUNCTION
Thanks for the help
DELIMITER $$
CREATE FUNCTION `bascar20_GPCSAS`.`getPrice`(codRef integer(11), ultimoInventario varchar(50), fechaInicial varchar(50), fechaFinal varchar(50))
RETURNS INT(11)
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
-- SET #codRef := 105;
-- SET #ultimoInventario := "2016-10-31";
-- SET #fechaInicial := '2016-11-01';
-- SET #fechaFinal := '2016-11-30';
SET #S := (SELECT IF(COUNT(*)=0,0,Saldo) FROM inventarios_finales WHERE FK_codigo_referencia = #codRef and fecha_inventario = #ultimoInventario AND FK_bodega = 1001);
SET #VU := (SELECT IF(COUNT(*)=0,0,valorUnitario) FROM inventarios_finales WHERE FK_codigo_referencia = #codRef and fecha_inventario = #ultimoInventario AND FK_bodega = 1001);
SET #VT := #S * #VU;
BEGIN
DECLARE returnVal INT(11);
SELECT ROUND(T.precio,0) INTO returnVal
FROM (
SELECT Fecha, referecia, Tipo, Cantidad, PrecioUnitario, IF(Tipo='EA'||Tipo='EM',(#S:=#S+Cantidad),(#S:=#S-Cantidad)) as SALDO ,IF(Tipo='EA'||Tipo='EM',(#VT:=#VT+(Cantidad*PrecioUnitario)),#VT:=#VT-(Cantidad*#VU)) as valortotal,IF(Tipo='EA'||Tipo='EM',#VU:=#VT/#S,#VU) as precio
FROM documentos
WHERE PrecioUnitario != 0 and Cantidad != 0 and Fecha BETWEEN #fechaInicial and #fechaFinal and NombreArticulo = #codRef and (Tipo = 'RM' or Tipo = 'EA' or Tipo = 'EM')
ORDER BY Fecha
) T
ORDER BY T.Fecha DESC
LIMIT 1
RETURN returnVal;
END$$
the error is:
1320 - No RETURN found in FUNCTION
Thanks for the help
That's cause you are missing a ; before the RETURN statement as pointed below from your posted code.
.....<rest of code>.....
ORDER BY Fecha
) T
ORDER BY T.Fecha DESC
LIMIT 1 <----------- Here
RETURN returnVal;

MySQL: Procedure Loops, but only inserts once

CREATE DEFINER=`root`#`localhost` PROCEDURE `GenerateCharges2`()
BEGIN
Declare sumFunding LONG;
Declare done INT DEFAULT FALSE;
Declare invoiceCharge LONG;
Declare agencyID INT;
declare invoiceID int;
Declare fundingID INT;
Declare amountOfFunding LONG;
Declare getInvoiceData CURSOR For select invoices.idInvoices, invoices.idAgencies, invoices.InvoiceAmount, fundings.FundingBalance, fundings.idfundings from invoices
inner join agencies on invoices.idAgencies = agencies.idAgencies
inner join fundings on agencies.idAgencies = fundings.IdAgencies
where processed =0
group by invoices.idInvoices;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
open getInvoicedata;
ze_loop: Loop
Fetch getInvoiceData into invoiceID, agencyID, invoiceCharge, amountOfFunding, fundingID;
if done then leave ze_loop;
end if;
if amountOfFunding > invoiceCharge then
insert into charges VALUES (invoiceCharge, invoiceID, fundingID);
end if;
end loop;
close getInvoiceData;
END
My issue is that if you were to insert a select statement, it runs a proper amont of times. However, the insert statement only inserts once with sample data. In every case, amnountOfFunding is ALWAYS greater than invoiceCharge. Desired results is to have all inserts happen for rows fetched.
I have this loop and insert every record that i need! Maybe you can modifiy or update yours loop with that!
DECLARE done INT DEFAULT FALSE ;
DECLARE l_local_formato_retail_codigo,
l_producto_sku,
l_producto_descripcion_sra,
l_producto_marca,
l_producto_categoria VARCHAR (100) ;
DECLARE l_precio DECIMAL (20, 7) DEFAULT 0 ;
DECLARE l_un_1 INT (20) DEFAULT 0 ;
DECLARE l_un_2 INT (20) DEFAULT 0 ;
DECLARE l_clp_1 DECIMAL (20, 7) DEFAULT 0 ;
DECLARE l_clp_2 DECIMAL (20, 7) DEFAULT 0 ;
DECLARE contador INT DEFAULT 0 ;
DECLARE valores CURSOR FOR
SELECT
local_formato_retail_codigo,
producto_sku,
producto_descripcion_sra,
producto_marca,
producto_categoria
FROM
base_comercial
WHERE mes_fecha = fecha
GROUP BY producto_sku,
local_formato_retail_codigo
ORDER BY local_formato_retail_codigo ASC,
producto_sku ASC ;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE ;
TRUNCATE precio_cd ;
OPEN valores ;
read_loop :
LOOP
FETCH valores INTO l_local_formato_retail_codigo,
l_producto_sku,
l_producto_descripcion_sra,
l_producto_marca,
l_producto_categoria ;
IF done
THEN LEAVE read_loop ;
END IF ;
SET l_clp_1 =
(SELECT
ROUND(SUM(sellout_clp), 7)
FROM
base_comercial
WHERE anno = DATE_FORMAT(fecha, '%Y')
AND mes = DATE_FORMAT(fecha, '%c')
AND local_formato_retail_codigo = l_local_formato_retail_codigo
AND producto_sku = l_producto_sku) ;
SET l_clp_2 =
(SELECT
ROUND(SUM(sellout_clp), 7)
FROM
base_comercial
WHERE anno = DATE_FORMAT(
DATE_ADD(fecha, INTERVAL - 1 MONTH),
'%Y'
)
AND mes = DATE_FORMAT(
DATE_ADD(fecha, INTERVAL - 1 MONTH),
'%c'
)
AND local_formato_retail_codigo = l_local_formato_retail_codigo
AND producto_sku = l_producto_sku) ;
SET l_un_1 =
(SELECT
SUM(sellout_un)
FROM
base_comercial
WHERE anno = DATE_FORMAT(fecha, '%Y')
AND mes = DATE_FORMAT(fecha, '%c')
AND local_formato_retail_codigo = l_local_formato_retail_codigo
AND producto_sku = l_producto_sku) ;
SET l_un_2 =
(SELECT
SUM(sellout_un)
FROM
base_comercial
WHERE anno = DATE_FORMAT(
DATE_ADD(fecha, INTERVAL - 1 MONTH),
'%Y'
)
AND mes = DATE_FORMAT(
DATE_ADD(fecha, INTERVAL - 1 MONTH),
'%c'
)
AND local_formato_retail_codigo = l_local_formato_retail_codigo
AND producto_sku = l_producto_sku) ;
IF (ISNULL(l_clp_1))
THEN SET l_clp_1 = 0 ;
END IF ;
IF (ISNULL(l_clp_2))
THEN SET l_clp_2 = 0 ;
END IF ;
IF (ISNULL(l_un_1))
THEN SET l_un_1 = 0 ;
END IF ;
IF (ISNULL(l_un_2))
THEN SET l_un_2 = 0 ;
END IF ;
SET l_precio = ((l_clp_1 + l_clp_2) / (l_un_1 + l_un_2)) ;
IF (ISNULL(l_precio))
THEN SET l_precio = 0 ;
END IF ;
INSERT INTO precio_cd
VALUES
(
l_local_formato_retail_codigo,
l_producto_sku,
l_producto_descripcion_sra,
l_producto_marca,
l_producto_categoria,
l_precio
) ;
END LOOP read_loop ;
CLOSE valores ;
SELECT
*
FROM
precio_cd ;

Mysql : Not allowed to return a result set from a function

I have write one function but getting this error Not allowed to return a result set from a function
DELIMITER $$
CREATE FUNCTION getTestFunction
(
p_ParentID int,
p_ListName nvarchar(50),
p_Type nvarchar(50),
p_Count int
)
RETURNS nvarchar(2000)
BEGIN
DECLARE p_KeyValue nvarchar(2000);
DECLARE p_ListValue nvarchar(2000);
DECLARE p_TextValue nvarchar(2000);
DECLARE p_ReturnValue nvarchar(2000);
DECLARE p_Key nvarchar(2000);
IF p_ParentID = 0 THEN
IF p_Count = 0 THEN
SET p_ReturnValue = '';
ELSE
SET p_ReturnValue = p_ListName;
END IF;
ELSE
SELECT p_KeyValue = ListName + '.' + Value
FROM ListsTable
WHERE EntryID = p_ParentID LIMIT 1 ;
RETURN p_ReturnValue;
If p_Type = 'ParentKey' Or (p_Type = 'ParentList' AND p_Count > 0) THEN
SET p_ReturnValue = p_KeyValue;
ELSE
IF p_Type = 'ParentList' THEN
SET p_ReturnValue = p_ListValue;
ELSE
SET p_ReturnValue = p_TextValue;
END IF;
END IF;
IF p_Count > 0 THEN
If p_Count = 1 AND p_Type = 'ParentList' THEN
SET p_ReturnValue = p_ReturnValue + ':' + p_ListName;
ELSE
SET p_ReturnValue = p_ReturnValue + '.' + p_ListName;
END IF;
END IF;
END IF;
RETURN p_ReturnValue;
END$$
DELIMITER ;
You want to assign the result of a query to a variable, but in fact you're just selecting. That's why MySQL's complaining.
You have to change this
SELECT p_KeyValue = ListName + '.' + Value
FROM ListsTable
WHERE EntryID = p_ParentID LIMIT 1 ;
to
SELECT CONCAT(ListName, '.', `Value`)
INTO p_KeyValue
FROM ListsTable
WHERE EntryID = p_ParentID LIMIT 1 ;
And you should add an ORDER BY. A LIMIT without ORDER BY doesn't make sense, since there's no guaranteed order in a relational database.
Mysql complains about SELECT statement in your function,
probably it understands SELECT p_KeyValue = ListName + '.' + Value as comparison
change it to
SELECT CONCAT(ListName, '.', Value) INTO p_KeyValue

Converting MSSQL function to MySQL function

I am trying to convert this user defined function (taken from a MSSQL) and tweak it so that I can run it MYSQL. I have made several attempts but all seem to error on the declare variable.
I am running the following version: 5.6.11-log - MySQL Community Server (GPL)
USE [DataGB]
GO
/****** Object: UserDefinedFunction [dbo].[FullPostCodeFix] Script Date: 11/20/2013 16:10:44 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE FUNCTION [dbo].[FullPostCodeFix] (#Postcode VARCHAR(20))
RETURNS VARCHAR(20)
BEGIN
/*
Puts postcode into correct format if it is currently in any of the below formats
AB12AA
AB 12AA
AB1 2AA
AB 1 2AA
Returns #Postcode
*/
DECL ARE #District Varchar(50)
DECLARE #Remainder Varchar(50)
DECLARE #Sector Varchar(50)
SET #District= CASE
WHEN LEN(#Postcode) - CHARINDEX(' ', REVERSE(#Postcode)) = len(#Postcode) THEN SUBSTRING(#Postcode,1,(len(#Postcode) - 3))
WHEN LEN(#Postcode) - CHARINDEX(' ', REVERSE(#Postcode)) < 3 THEN SUBSTRING(#Postcode,1,(len(#Postcode) - 3))
ELSE SUBSTRING(#Postcode, 0, LEN(#Postcode) - CHARINDEX(' ', REVERSE(#Postcode)) + 1)
END
SET #District = dbo.PostcodeFix(#District)
SET #Remainder= RIGHT(#Postcode,3)
SET #Sector = #District + ' ' + LEFT(#Remainder,1)
SET #Postcode = #District + ' ' + #Remainder
RETURN #Postcode
END
My attempt at creating a MYSQL version is below:
CREATE FUNCTION FullPostCodeFix (Postcode VARCHAR(20))
RETURNS VARCHAR(20)
BEGIN
DECLARE District Varchar(50)
DECLARE Remainder Varchar(50)
DECLARE Sector Varchar(50)
SET District= CASE
WHEN LEN(Postcode) - CHARINDEX(' ', REVERSE(Postcode)) = len(Postcode) THEN SUBSTRING(Postcode,1,(len(Postcode) - 3))
WHEN LEN(Postcode) - CHARINDEX(' ', REVERSE(Postcode)) < 3 THEN SUBSTRING(Postcode,1,(len(Postcode) - 3))
ELSE SUBSTRING(Postcode, 0, LEN(Postcode) - CHARINDEX(' ', REVERSE(Postcode)) + 1)
END
SET District = dbo.PostcodeFix(District)
SET Remainder= RIGHT(Postcode,3)
SET Sector = District + ' ' + LEFT(Remainder,1)
SET Postcode = District + ' ' + Remainder
RETURN Postcode
END
The error that I get is as follows:
Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DECLARE Remainder Varchar(50) DECLARE Sector Varchar(50)
There is another function called from within the function "FullPostCodeFix". This is my attempt:
DELIMITER $$
CREATE FUNCTION PostCodeFix (strDistrict VARCHAR(20))
RETURNS VARCHAR(20)
DETERMINISTIC
BEGIN
DECLARE intASCII INTEGER;
SET strDistrict = LTRIM(strDistrict);
SET strDistrict = RTRIM(strDistrict);
IF LENGTH(strDistrict) > 4 OR LENGTH(strDistrict) = 0 THEN RETURN 'ERROR: ' + strDistrict;
ELSE
BEGIN
SET intASCII = ASCII(LEFT(strDistrict, 1));
IF ( intASCII > 47 AND intASCII < 58 ) THEN RETURN 'ERROR: ' + strDistrict;
ELSE
BEGIN
SET intASCII = ASCII(SUBSTRING(strDistrict, 2, 1));
IF ( intASCII > 47 AND intASCII < 58 ) THEN SET strDistrict = LEFT(strDistrict, 1) + ' ' + RIGHT(strDistrict, LENGTH(strDistrict)-1);
SET intASCII = ASCII(SUBSTRING(strDistrict, 3, 1));
IF ( intASCII < 48 OR intASCII > 57 ) AND (intASCII <> 32) THEN RETURN 'ERROR: ' + strDistrict;
ELSE IF LENGTH(strDistrict) < 4 THEN SET strDistrict = LEFT(strDistrict, 2) + ' ' + RIGHT(strDistrict, LENGTH(strDistrict)-2);
END IF;
END IF;
RETURN strDistrict;
END IF;
Ok lets start, replace MS-SQL functions with MySQL equivalent functions.
MSSQL MySQL
LEN() LENGTH()
SUBTRING() SUBSTR()
CHARINDEX() INSTR()
below is documentation and list of all MySQL String functions
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
Here is correct MySQL Syntax that I have verified.
CREATE FUNCTION FullPostCodeFix (Postcode VARCHAR(20)) RETURNS VARCHAR(20)
BEGIN
DECLARE district VARCHAR(50);
DECLARE remainder VARCHAR(50);
DECLARE sector VARCHAR(50);
IF LENGTH(Postcode) - INSTR(' ', REVERSE(Postcode)) = LENGTH(Postcode) THEN SET district = SUBSTR(Postcode,1,(LENGTH(Postcode) - 3));
ELSEIF LENGTH(Postcode) - INSTR(' ', REVERSE(Postcode)) < 3 THEN SET district = SUBSTR(Postcode,1,(LENGTH(Postcode) - 3));
ELSE SET district = SUBSTR(Postcode, 0, LENGTH(Postcode) - INSTR(' ', REVERSE(Postcode)) + 1);
END IF;
SET District = dbo.PostcodeFix(District);
SET Remainder= RIGHT(Postcode,3);
SET Sector = CONCAT(District,' ',LEFT(Remainder,1));
SET Postcode = CONCAT(District,' ',Remainder);
RETURN Postcode;
END
Here is your second function
CREATE FUNCTION PostCodeFix (strDistrict VARCHAR(20))
RETURNS VARCHAR(20)
DETERMINISTIC
BEGIN
DECLARE intASCII INTEGER;
SET strDistrict = LTRIM(strDistrict);
SET strDistrict = RTRIM(strDistrict);
IF LENGTH(strDistrict) > 4 OR LENGTH(strDistrict) = 0 THEN RETURN 'ERROR: ' + strDistrict;
ELSE
SET intASCII = ASCII(LEFT(strDistrict, 1));
IF ( intASCII > 47 AND intASCII < 58 ) THEN RETURN 'ERROR: ' + strDistrict;
ELSE
SET intASCII = ASCII(SUBSTRING(strDistrict, 2, 1));
IF ( intASCII > 47 AND intASCII < 58 ) THEN SET strDistrict = LEFT(strDistrict, 1) + ' ' + RIGHT(strDistrict, LENGTH(strDistrict)-1);
END IF;
SET intASCII = ASCII(SUBSTRING(strDistrict, 3, 1));
IF ( intASCII < 48 OR intASCII > 57 ) AND (intASCII <> 32) THEN RETURN 'ERROR: ' + strDistrict;
ELSEIF LENGTH(strDistrict) < 4 THEN SET strDistrict = LEFT(strDistrict, 2) + ' ' + RIGHT(strDistrict, LENGTH(strDistrict)-2);
END IF;
END IF;
RETURN strDistrict;
END IF;
END