Skip to main content
Participant
May 31, 2022
Question

Requete bizzare

  • May 31, 2022
  • 3 replies
  • 353 views

Bonjour,

Je programme cette requête souvent avec d'autres fichiers mais là je ne vois pas mon erreur :
Bonjour,

    SELECT *
	FROM Produits
	WHERE Pro_ID=#session.Produit#
</CFQUERY>
		

SQLSTATE 	  07002
EXCEPTIONS 	  <small><i>not set</i></small>
DATASOURCE 	  soliv_solivresdb
VENDORERRORCODE 	-3010
SQL 	  SELECT * FROM Produits WHERE Pro_ID=1139




Merci pour votre aide

This topic has been closed for replies.

3 replies

Charlie Arehart
Community Expert
Community Expert
June 2, 2022

I'd propose other questions and suggestions:

  1. What happens if you leave off the where clause?
  2. Does ANY query from cf to that db work?
  3. What is the db you're call? Sql server? mysql?etc
  4. Does the same query work if run from a query tool for that db?
  5. Is this a newly installed db? Or a newly installed cf?
  6. (I'll note that the code 3010 is often associated with a new sql server install requiring a box reboot before completion. But I'd not really expect it in reply to a query, so that's possibly an unrelated matter.) 
  7. What version of cf and the db is it? 
/Charlie (troubleshooter, carehart. org)
BKBK
Community Expert
Community Expert
June 2, 2022

Such strange errors usually arise when you embed <cfquery> within <cfoutput>. Review your code and replace

<cfoutput> 
    <cfquery>
     ...
    <cfquery>
<cfoutput> 

 

with

 

<cfquery>
 ...
<cfquery>

 

BKBK
Community Expert
Community Expert
June 2, 2022

Two more possible causes of the error:

  • Is Pro_ID a column in the Produits table?
  • Is Pro_ID a varchar and not a number? If so, change to
    Pro_ID='#session.Produit#​'
Participant
June 1, 2022

help plz