PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > need setting complex concat to sql variable
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
need setting complex concat to sql variable

Réponse
 
LinkBack Outils de la discussion
Vieux 10/04/2008, 07h52   #1
pbd22
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut need setting complex concat to sql variable



I am trying to do the following:


Code:

SET @sql=SELECT CONCAT("<img src='thumbs/",s.Thumbnail,"' alt=''
class='teaserImage' /><h3><a href=\"javascript:NewWindow('free.aspx?
sid=",c.ScheduleID,"','mypopup','1024','768','cent er','front');
\"><u>",s.title,"</u></a><h3><p>",LEFT(s.Description, 100),"...</p>")
As Event,
c.StartDate As Date, c.ScheduleType As Type, c.StartDate As
Status, GROUP_CONCAT(p.DisplayName) As Presenters
From CommonSchedule c
inner join schedulemetadata s on (c.ScheduleID = s.ScheduleID)
inner join presenter p on (c.ScheduleID = p.ScheduleID)
where l_where_clause
group by c.ScheduleID;



I am getting all sorts of errors.

This is the end of a sort stored procedure where the l_where_clause is
dynamically generated before this code block.
I want to set this code into @sql for further processing.

Does anybody see what I am doing wrong and could you please
suggest corrections?

THanks.
  Réponse avec citation
Vieux 10/04/2008, 12h32   #2
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: need setting complex concat to sql variable

On 10 Apr, 06:52, pbd22 <dush...@gmail.com> wrote:
> I am trying to do the following:
>
> Code:
>
> SET @sql=SELECT CONCAT("<img src='thumbs/",s.Thumbnail,"' alt=''
> class='teaserImage' /><h3><a href=\"javascript:NewWindow('free.aspx?
> sid=",c.ScheduleID,"','mypopup','1024','768','cent er','front');
> \"><u>",s.title,"</u></a><h3><p>",LEFT(s.Description, 100),"...</p>")
> As Event,
> c.StartDate As Date, c.ScheduleType As Type, c.StartDate As
> Status, GROUP_CONCAT(p.DisplayName) As Presenters
> From CommonSchedule c
> inner join schedulemetadata s on (c.ScheduleID = s.ScheduleID)
> inner join presenter p on (c.ScheduleID = p.ScheduleID)
> where l_where_clause
> group by c.ScheduleID;
>
> I am getting all sorts of errors.
>
> This is the end of a sort stored procedure where the l_where_clause is
> dynamically generated before this code block.
> I want to set this code into @sql for further processing.
>
> Does anybody see what I am doing wrong and could you please
> suggest corrections?
>
> THanks.


If you are getting "all sorts of errors" then there are going to be
all sorts of fixes.

Since you haven't actually told us any of the "all sorts of errors"
you are getting, that is as much as we can be.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h05.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08782 seconds with 10 queries