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

Requete bizzare

Community Beginner ,
May 31, 2022 May 31, 2022

Copy link to clipboard

Copied

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

Views

144

Translate

Translate

Report

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

Copy link to clipboard

Copied

help plz

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

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

 

with

 

<cfquery>
 ...
<cfquery>

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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#​'

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Ce n'est pas le cas ;-(

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Ce nest pas le cas ;-(

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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? 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

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
Documentation