Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Requete bizzare

Community Beginner ,
May 31, 2022 May 31, 2022

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

TOPICS
Database access
376
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 01, 2022 Jun 01, 2022

help plz

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 02, 2022 Jun 02, 2022

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

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

 

with

 

<cfquery>
 ...
<cfquery>

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 02, 2022 Jun 02, 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#​'
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 02, 2022 Jun 02, 2022

Ce n'est pas le cas ;-(

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 02, 2022 Jun 02, 2022

Ce nest pas le cas ;-(

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 02, 2022 Jun 02, 2022

OK, let's move on.

Verify that the table name and column name are correct.

What is your database brand? Some, like PostgreSQL are case-sensitive. Which means you should use the exact (case-sensitive) table name and column name.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 03, 2022 Jun 03, 2022
LATEST
quote

Ce nest pas le cas ;-(

 


By @Jean-Marie22691987kfb3

Please realize that that is an insufficient answer to the questions,

  • Is Pro_ID a column in the Produits table?
  • Is Pro_ID a varchar and not a number? 
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 02, 2022 Jun 02, 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)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources