PDA

View Full Version : SQL View input parameters?



Joe88
March 16th, 2009, 11:27 AM
Does anyone know the syntax for getting input from a user in mySQL?, I'm guessing the syntax would be like this:

CREATE VIEW patientGP AS
SELECT GP
FROM patient
WHERE PName = ['Please input patient name: '];

CptPicard
March 16th, 2009, 12:35 PM
You need to write some sort of script/external application to do that sort of stuff... you accept user input there, and then manipulate the database accordingly. And no, you would not use "create view" like that at all.

Joe88
March 16th, 2009, 01:23 PM
Thanks for the helpful reply, I am an SQL beginner and I was stuck on the last question of a practice university assignment, because I thought it was asking me to make a view with user input.

CptPicard
March 16th, 2009, 01:40 PM
Well, you can run a "create view" from a script like that, but I have this strong feeling that they are just after a select...