Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 I am getting wrong output every time

Author  Topic 

DBAstudent123
Starting Member

5 Posts

Posted - 2015-04-07 : 11:53:11
How can I modify this code ?

CREATE TABLE MESSAGES(MTEXT VARCHAR(80) );
INSERT INTO MESSAGES VALUES('This is definitely a challenging
subject!!');
COMMIT;
SELECT MTEXT
FROM MESSAGES;
SELECT MTEXT || MTEXT
FROM MESSAGES;
SELECT MTEXT || MTEXT || MTEXT
FROM MESSAGES;

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-04-07 : 12:01:22
I'm not clear on what you are trying to achieve. Are you trying to concatenate them?

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

DBAstudent123
Starting Member

5 Posts

Posted - 2015-04-07 : 12:17:09
I want to modify the script above such that SQL statements are displayed during execution of the script, a header NAME is displayed every 2 lines, lines are no longer than 20 characters and when a text to be displayed is longer than 20 characters then it must be wrapped to the next line.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-04-07 : 12:30:36
You need to do this in your application and not in T-SQL. It appears you aren't using Microsoft SQL Server though, which is what SQLTeam.com is for. I'd suggest posting your question on a site that specializes in the technologies that you are using.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

DBAstudent123
Starting Member

5 Posts

Posted - 2015-04-07 : 12:41:00
Thanks...I just know this site is of MSQL :)
Go to Top of Page
   

- Advertisement -