MySQL Forums
Forum List  »  Stored Procedures

'Unknown column in field list' (column name specified as parameter)
Posted by: skasab2s skasab2s
Date: March 26, 2010 07:33AM

Hello,

in our coumpany we have a JavaScript application which calls a stored procedure. The stored procedure has a parameter (in my case it is called 'bgaField1') which is used as a column name:

DELIMITER $$
...
CREATE DEFINER=`someuser`@`localhost` PROCEDURE `insertUpdateBga`(protokollnummer1 varchar(255), orderId1 varchar(255), bgaField1 varchar(255), value1 varchar(255), orderDate1 varchar(255), source1 varchar(255))
...
INSERT INTO vptbl_bga (Protokollnummer, OrderId, bgaField1, tStamp, Ort) VALUES (protokollnummer1, orderId1, value1, orderDate1, source1);
...
DELIMITER ;

When I invoke the stored procedure using JavaScript, I get the message:

Unknown column 'ka' in 'field list'
(in this case 'ka' is the content of variable bgaField1 from the stored procedure )

But the column 'ka' exists in table vptbl_bga.

Here is how the stored procedure is called:
dbConnEarOrEir.executeUpdate("call insertUpdateBga('"+protokollnummer+"','"+orderId+"',"+bgaField+","+labVal+",'"+ orderDate+"','LAB')");

I 've read that in my case the parameter 'bgaField' should be threated differently (for example in .NET it should be given to the stored procedure as "?bgaField"). I tried this solution in JavaScript but it doesn't work.

Do you know how to solve this problem?

Thanks a lot and many regards!

Svetlomir Kasabov.

Options: ReplyQuote


Subject
Views
Written By
Posted
'Unknown column in field list' (column name specified as parameter)
15975
March 26, 2010 07:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.