asked on
ASKER
ASKER
create procedure usp_my_proc (parameterName1 parameterType1[, parameterNameN, parameterTypeN]) )
begin
...
end
There are quite a few pages available on the web to explain how to create stored procedures in MySQL. Check out this one and here for starters. Search in Google for MySQL Stored Procedures for more information.SELECT FIRST_NAME + ' ' + MID_INIT + '. ' + LAST_NAME AS FullName,
LEFT(SSN, 3) + '-' + SUBSTRING(SSN, 4, 2) + '-' + RIGHT(SSN, 4) AS SSN
'(' + LEFT(PHONE, 3) + ') ' + SUBSTRING(PHONE, 4, 3) + '-' + RIGHT(PHONE, 4) AS PhoneNumber
FROM myTable
instead of just returning FIRST_NAME, MID_INIT, LAST_NAME, SSN and PHONE and letting the presentation layer format the data. Many will tell you that the presentation layer should do your formatting; for one thing, there may be locale/language differences that need to be taken into account. The database server may reside in the U.S. but you have a web application pulling data from Japan, the U.K. India and Italy. The database does not necessarily know where the data request is coming from, but the application that is running does.
ASKER
DELIMITER $$
CREATE DEFINER=`DATABASE`@`%` PROCEDURE `PROCEDURENAME`(IN `ListName` TEXT, `Status` TEXT)
BEGIN
SELECT *
FROM TABLE
WHERE STATUS = STATUS AND ListName = ListName;
END$$
DELIMITER ;
The output is the entire database - even though I'm prompted to choose Status and List type. What am I doing wrong?
ASKER
ASKER
DELIMITER $$
CREATE DEFINER=`DATABASE`@`%` PROCEDURE `MyFirstSQLProcedure`(IN `ListName` CHAR(20), IN `StatusList` CHAR(20))
READS SQL DATA
BEGIN
SELECT Column0, Column1, Column3, Column4, Column5, Column6, Column7 FROM Ventelister
WHERE Column1 = ListName AND Column7 = StatusList;
END$$
DELIMITER ;
Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.
TRUSTED BY
https://stackoverflow.com/
To ensure you code is crafted well, use http://sqlmap.org/ to test your code.
You'll use the PHP as an example, then map the PHP approach to your ASP code base.