How to insert variable value in mysql insert query?


Problem :

I have written aa insert query in a stored procedure...

   INSERT INTO `ascencom_soa2`.`rardata` (`threatDescription`,`rtpControlObjective`,
  `rtpNonTechnical`,`rtpISOControl`,
  `rtpWorkInstructions`,`VulnerabilityDescription`,
  `assetname`,`companyid`,`assetid`)

  VALUES (threatDesc,rtpcontrol,
  rtpNon,rtpISO,
  rtpWork,rtpvulnarabilityDesc,
  idAsset,idCompany,idAssetType);

Here threatDesc, rtpcontrol, trpNon.... are variables and are initialized before the insert query is executed...

but it is give me error...

1054 : Unknown column 'threatDesc' in 'field list'

please help me with this problem



Solution :

@threatDesc, @rtpcontrol, @trpNon...

Mysql Tutorials

Mysql Howto..

How do I count the number of deleted rows in a MYSQL query?

MYSQL How to show most popular items in the last two days

How to get output parameters from MySQL stored procedure in Rails?

MySQL Notice: Undefined index: How to resolve [duplicate]

How to use MySQL join/count correctly

Mysql- how to select last 100 recodes from a table

how to fetch only a row from a mysql query

How to retrieve a default row when a mysqli_stmt_fetch fails?

How to split an array based on a condition?

How can i pair images in my DB?

How can I convert this php mysql code to SQL which is acceptable by SQL server ? [closed]

mysql how to convert varchar(10) to TIMESTAMP?

How to find more information about a given MySQL process?

how to print on pdf without html tags from mysql database?

How to restart remote MySQL server running on Ubuntu linux?

In MySQL, how to use a subquery to a left join statement?

How to retrieve different latitude and longitude for given 1 mile distance in Java using MySql query?

How to calculate the day deffirence for same events

How to edit this mySQL query to not select rows that have same value in 2 columns?

Node - How to make sure everything gets done in an async enviroment

How to get a total days count

How to know PHP is set-up correctly for Apache on localhost?

How to configure memcached for mysql innodb?

MySQL, how to use subtraction with time stamp?

How to merge 2 result sets with opposite order in MySQL

How to control .htaccess with php or how to input php code inside .htaccess file

How to check how many Users has registered in one week

How to take unicode characters from the mysql data base in PHP

How to perform a case sensitive search on a case insensitive MySQL database?

How do I migrate new MySQL database structure from dev to production website using the command line?