ORA-00933 : commande SQL mal terminée

Solved
BelleRose2 Posted messages 10 Status Membre -  
nichola Posted messages 113 Status Membre -
Bonjour,
I work with Windows Forms under Oracle. The following line gives me an error saying that this command is "not properly ended". Can someone help me please? :(

OleDbCommand comdatabase = new OleDbCommand("select * from bi_dictionnaire where CHAMPS='" + textType.Text + "' and LIBELLE_FR LIKE '" + ID2.Text + "%';", condatabase);

2 réponses

nichola Posted messages 113 Status Membre 11
 
Hello,

I'm not an Oracle or Forms expert, but it seems to me that there's a '%' missing after the LIBELLE_FR_ LIKE, right?

It should be this instead:

OleDbCommand comdatabase = new OleDbCommand("select * from bi_dictionnaire where CHAMPS='" + textType.Text + "' and LIBELLE_FR LIKE '%"+ ID2.Text +"%');",
1
BelleRose2 Posted messages 10 Status Membre
 
Thank you very much for the response. My problem is solved. In fact, it was because of the closed parenthesis and the ';' .. I removed it and it works.
Thank you :)
0
BelleRose2 Posted messages 10 Status Membre
 
The error still appears to me with this line:

string strCommand = "UPDATE users SET mot_de_passe=?mot_de_passe WHERE mot_de_passe=" + textBox1.Text;

:
0
nichola Posted messages 113 Status Membre 11
 
I would say that single quotes are missing around the password?
0