![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi guys, I have loads of SQL Server experience, but not a lot of mySql. But when I call it lik this: CALL up_GetLatestFirmwareVersion_SelectBy_TargetDeviceI d (inTargetDeviceId='1579', inVariant='S'); It fails with "Unknown column 'inTargetDeviceId' in 'field list'" |
|
My .Net application needs to pass the names: MySqlCommand command = _conn.CreateCommand(); command.CommandType = CommandType.StoredProcedure; command.CommandText = "up_GetLatestFirmwareVersion_SelectBy_TargetDevice Id"; command.Parameters.Add(new MySqlParameter("inTargetDeviceId", 1)); command.Parameters.Add(new MySqlParameter("inVariant", "")); But it seems the proc doesn't want me to name my parameters. What am I doing wrong? |
#3
| |||
| |||
|
|
Hi guys, I have loads of SQL Server experience, but not a lot of mySql. I have created this proc: DROP PROCEDURE IF EXISTS `up_GetLatestFirmwareVersion_SelectBy_TargetDevice Id`; DELIMITER $$ CREATE PROCEDURE up_GetLatestFirmwareVersion_SelectBy_TargetDeviceI d (IN inTargetDeviceId VARCHAR(4), IN inVariant VARCHAR(5)) BEGIN SELECT firmware_version_id, version_major, version_minor, version_variant, version_pre_release, version_variant IS NULL AS variant_isnull, version_pre_release IS NULL AS pre_release_isnull FROM firmware_versions fv INNER JOIN target_device td ON td.target_device_id = fv.target_device_id WHERE td.devid = inTargetDeviceId AND ((version_variant = inVariant) OR (version_variant IS NULL AND inVariant IS NULL)) ORDER BY version_major DESC, version_minor DESC, variant_isnull ASC, pre_release_isnull DESC LIMIT 1; END$$ DELIMITER ; I call it like this: CALL up_GetLatestFirmwareVersion_SelectBy_TargetDeviceI d ('1579', 'S'); And it works well. But when I call it lik this: CALL up_GetLatestFirmwareVersion_SelectBy_TargetDeviceI d (inTargetDeviceId='1579', inVariant='S'); It fails with "Unknown column 'inTargetDeviceId' in 'field list'" |
|
My .Net application needs to pass the names: MySqlCommand command = _conn.CreateCommand(); command.CommandType = CommandType.StoredProcedure; command.CommandText = "up_GetLatestFirmwareVersion_SelectBy_TargetDevice Id"; command.Parameters.Add(new MySqlParameter("inTargetDeviceId", 1)); command.Parameters.Add(new MySqlParameter("inVariant", "")); But it seems the proc doesn't want me to name my parameters. What am I doing wrong? |
![]() |
| Thread Tools | |
| Display Modes | |
| |