Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 157
Registered: ‎12-16-2010
My Device: Torch 9800, PlayBook

SQL error: parameter names not found in SQL specified

[ Edited ]

 

sqlQry = "DELETE FROM tblNotes WHERE "
+ "noteID = @noteid;";
sqlStatement.text = sqlQry;
sqlStatement.parameters["@noteid"] = note.ID;
sqlStatement.execute();

 

Can someone help me out with above.. its driving me crazy... i'm converting all my sql queries to use parameters and get this error:

 

 

Main Thread (Suspended: SQLError: 'Error #3115: SQL Error.', details:''@noteid' parameter name(s) found in parameters property but not in the SQL specified.', operation:'execute', detailID:'1003')

Searched all over the place and cannot find anything in regards to this error and the syntax appears to be correct based on examples provided, for example here:
thanks in advance

 

 

----------
If you find this post helpful please "like" it and accept as a solution.
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: SQL error: parameter names not found in SQL specified

hey p3pp3r,

 

im not seeing any errors from what you have wrote. its pretty strange. try doing unnamed parameters and see if that helps. so put like a question mark (?) where @noteid is and use the parameter[0] notation instead. see if that changes anything. good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: SQL error: parameter names not found in SQL specified

[ Edited ]

Edited: I wrote that the Adobe docs say to use :noteid instead of @noteid but was looking at only the example shown, not the full text.  Full text says either one should work...

 


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: SQL error: parameter names not found in SQL specified

Your error doesn't show a line number or anything like that.  Are you certain the error is coming from this code block and not another?

 

Perhaps you are reusing the sqlStatement in a later call to execute(), and that parameter is still set on it.

 

If you want to reuse a sqlStatement instance for an unrelated command, you should do sqlStatement.clearParameters() on it first.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!