[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

magix

3/28/2007 6:38:00 PM

If I have following, but can I just SET the variable for string like : SET
@FullName = @vName1
It return syntax error. How can fix it ?

DECLARE
@vName1 varchar(100),
@vName2 varchar(100),
@FullName varchar(100),

SELECT Name2, Name2 FROM myRecord
OPEN dCursor

FETCH NEXT FROM dCursor INTO @vName1, @vName2
WHILE ( @@fetch_status <> -1 )
BEGIN

IF LTRIM(RTRIM(@vName1)) <> '' OR LTRIM(RTRIM(@vName1)) IS NOT NULL)
BEGIN
SET @FullName = @vName1
END
ELSE
BEGIN
SET @FullName = @vName2
END


....
.... and so on.




2 Answers

magix

3/28/2007 6:54:00 PM

0

Please Ignore this.

"magix" <magix@asia.com> wrote in message news:460ab61f_1@news.tm.net.my...
> If I have following, but can I just SET the variable for string like :
> SET @FullName = @vName1
> It return syntax error. How can fix it ?
>
> DECLARE
> @vName1 varchar(100),
> @vName2 varchar(100),
> @FullName varchar(100),
>
> SELECT Name2, Name2 FROM myRecord
> OPEN dCursor
>
> FETCH NEXT FROM dCursor INTO @vName1, @vName2
> WHILE ( @@fetch_status <> -1 )
> BEGIN
>
> IF LTRIM(RTRIM(@vName1)) <> '' OR LTRIM(RTRIM(@vName1)) IS NOT NULL)
> BEGIN
> SET @FullName = @vName1
> END
> ELSE
> BEGIN
> SET @FullName = @vName2
> END
>
>
> ...
> ... and so on.
>
>
>
>


Alejandro Mesa

3/28/2007 6:58:00 PM

0

Can you tell us what the error is?


AMB


"magix" wrote:

> If I have following, but can I just SET the variable for string like : SET
> @FullName = @vName1
> It return syntax error. How can fix it ?
>
> DECLARE
> @vName1 varchar(100),
> @vName2 varchar(100),
> @FullName varchar(100),
>
> SELECT Name2, Name2 FROM myRecord
> OPEN dCursor
>
> FETCH NEXT FROM dCursor INTO @vName1, @vName2
> WHILE ( @@fetch_status <> -1 )
> BEGIN
>
> IF LTRIM(RTRIM(@vName1)) <> '' OR LTRIM(RTRIM(@vName1)) IS NOT NULL)
> BEGIN
> SET @FullName = @vName1
> END
> ELSE
> BEGIN
> SET @FullName = @vName2
> END
>
>
> ....
> .... and so on.
>
>
>
>
>