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

Inserting a variable + string using select statement with cfquery

Participant ,
Apr 09, 2010 Apr 09, 2010

I'm trying to do an insert by a select statement where the insert for one of the fields needs to be a combination of a vaule retrieved from the select and concatenated with a string of text. Is this possible and if so what would the correct syntax be? Here is an example of what I'm trying but is not working.

<cfquery name="createnote" datasource="#application.datasource#">
        INSERT INTO gtbl_notes(notedate, strCustomerID, notetype, note, notecreatedby)
        SELECT "#currentdate#", strCustomerID, "misc", "#gtbl_people.email#  REMOVED DUE TO HARD BOUNCE", "Bounce Routine"
        FROM gtbl_people, gtbl_bounces
        WHERE gtbl_bounces.email = gtbl_people.email AND gtbl_bounces.subscriber = 1 AND gtbl_bounces.status = 2

</cfquery>

Any input would be greatly appreciated.

TOPICS
Database access
571
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

correct answers 1 Correct answer

LEGEND , Apr 09, 2010 Apr 09, 2010

Concatonation is possible with most if not all databases.  The syntax is software specific and you didn't specify yours.

Translate
LEGEND ,
Apr 09, 2010 Apr 09, 2010

Concatonation is possible with most if not all databases.  The syntax is software specific and you didn't specify yours.

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
Participant ,
Apr 09, 2010 Apr 09, 2010
LATEST

After posting this message I found what I was looking for. The concat function solved my issue:

concat(gtbl_people.email, " removed due to hard bounce")

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