Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: SQL Server
Expertise: Beginner
Jul 16, 1999



Application Security Testing: An Integral Part of DevOps

Coding blank spaces in a select statement

After the line break in the code below, the blank space between the quotes is not recognized. I am merely trying to indent the second line, but I get nothing. The field is eventually accessed from an ASP page which explains the html statement in the code.

SELECT RTRIM(Item.unit_pack1) + ' pack(s) @ $' 
+ CONVERT(varchar(8), CONVERT(money, Item.unit_price1)) 
+ ' added to your shopping bag.
' + ' ' + RTRIM(Brand_List.brand_descript)AS qof_descript FROM ..............

Instead of the blank string which apparently gets chopped, try declaring a variable named @filler of varchar(100) and then wrap the select statement in a cursor.

Each time you go through an iteration of purchasing stuff, add another ten spaces into filler so it indented one more level in for every purchase made.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date