Solved

Need help with SYBASE syntax

Posted on 2016-07-14
5
94 Views
Last Modified: 2016-08-01
I am wondering if there are any SYBASE sql coders who can spot any syntax errors at line 355. I am getting this error message,
and cannot spot what the problem is?

Incorrect syntax near '+'.

355  PRINT ' Client Endtered Data On ' + CONVERT(VARCHAR(10),CONVERT(TIME,GETDATE()))
0
Comment
Question by:brgdotnet
5 Comments
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 41711664
can you post codes from lines 354 to 356 ?

line 355 seems ok.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 41711710
I know the same limitation in sql server:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00801.1510/html/iqrefso/X315758.htm
Syntax
PRINT format-string [, arg-list]

Open in new window

so you need to do this:
PRINT ' Client Endtered Data On %1' , CONVERT(VARCHAR(10),CONVERT(TIME,GETDATE())) 

Open in new window

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 41711711
0
 
LVL 2

Author Closing Comment

by:brgdotnet
ID: 41713777
Thank you Guy
0
 
LVL 3

Expert Comment

by:knel1234
ID: 41738054
Adding to Guy  Hengel's link above (for the print logic only) are you trying to do this
declare @var1 varchar(10), @var2 varchar(10)
select @var1 = convert(varchar(10),getdate(),108)
select @var2 = convert(varchar(10),getdate(),118)
PRINT ' Client Endtered Data On %1!', @var1
PRINT ' Client Endtered Data On %1!' , @var2
PRINT ' Client Endtered Data On %1! and also on %2! ', @var1, @var2

or am I way off base here?

cheers
knel
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unable to get exact error from Sybase Sp to Sql Server 2005 2 396
Sybase SQL Anywhere ISQL 8 1,011
connect to sybase then query 1 759
MS SQL 2008 server - system update recommendation 13 112
There's a lot of hype surrounding blockchain technology. Here's how it works and some of the novel ways it' s now being used - including for data protection.
Ransomware continues to grow in reach and sophistication, putting data everywhere at risk. Learn how to avoid being caught in its sinister clutches with these 11 key tips.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question