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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Curvy brackets?

Author  Topic 

Gideon
Starting Member

15 Posts

Posted - 2002-05-14 : 20:03:35
Does anyone know what this is doing, it's in the WHERE clause, I don't know what the brackets indicate, an array maybe...also the ts (timestamp maybe)....thanks in advance,

AND (TRANS.TRAN_D>{ts '2002-02-28 00:00:00'})

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-14 : 20:29:22
I've never seen this used in SQL Server, are you using another database product?

Go to Top of Page

Gideon
Starting Member

15 Posts

Posted - 2002-05-14 : 21:38:48
I'm pretty sure it's SQL Server......they run a Microsoft platform here..Have you seen it on other platforms?

Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-05-14 : 21:54:26
Hi

It is just a datetime

If you do this

Select {ts '2002-02-28 00:00:00'}

it comes out the same as

Select Cast('2002-02-28 00:00:00' as datetime)


I had never seen it either

Damian
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-14 : 21:59:46
I actually found an entry for this in Books Online, it seems that the { } format is an ODBC format, and SQL Server handles ODBC functions natively. If you look under "datetime data type, format" you'll find the entry that explains this ODBC format.

Go to Top of Page

Gideon
Starting Member

15 Posts

Posted - 2002-05-14 : 22:04:44
Thanks Merkin,

Could I use trunc for the same effect?

Go to Top of Page

Gideon
Starting Member

15 Posts

Posted - 2002-05-14 : 22:07:21
Cheers Robvolk,

I haven't been there before. Can you post the link please.

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-14 : 22:08:13
TRUNC() is not a SQL Server function. It's an Oracle function though; if you're retrieving data from an Oracle linked server or something like that, then you could use TRUNC().

The Books Online entry can be found in the Index (this is the version that's on your hard drive, under Start:Programs:Microsoft SQL Server)

If you don't have it on your hard drive, you can try searching MSDN for "ODBC Date Format" and you should find it.

Edited by - robvolk on 05/14/2002 22:09:50
Go to Top of Page

Gideon
Starting Member

15 Posts

Posted - 2002-05-14 : 22:16:15
Thanks......I'm an Oracle developer, just starting on SQL Server so please excuse any stupid questions

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-14 : 22:20:37


Did we steal you away from Larry's realm? WOO-HOO!

Don't EVER apologize for trying to use Books Online, at least you're making the effort to find it!

Go to Top of Page

Gideon
Starting Member

15 Posts

Posted - 2002-05-15 : 00:16:51
Do you have any sites that will give me a glossary of Oracle SQL commands vs SQL Server commands.....Something that gives a brief rundown, I'm not that interested in huge speels about architecture etc...

Cheers

Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-05-15 : 00:26:47
I don't think there are any.
It has been discussed once or twice and I think the general feeling is that you shouldn't think in terms of a straight port. SQL Server do things in different ways and it is best to build to the platform.

IMO

Damian
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-15 : 00:53:41
One or two words of advice: Merkin is 100% correct, PL/SQL and Transact-SQL do not translate, don't spend any time trying, you'll just pull your hair out.

Second, Oracle likes cursors, SQL Server does not. It's not a reflection on the performance of either system or the method they use. If you have cursors in Oracle and they work, fine. But DO NOT look to write T-SQL code using cursors, you'd be tying SQL Server's hands behind its back.

We are highly skilled at changing cursors to pure set-based SQL here on SQL Team so if you get stuck on something just come on back here and we'll help!

Go to Top of Page

joldham
Wiseass Yak Posting Master

300 Posts

Posted - 2002-05-15 : 07:48:25
Another thing to note is that some of the operational things in Oracle are different than SQL Server. For instance, when you do an ORDER BY statement in Oracle, it places Null values at the end, whereas SQL Server places them at the beginning.

Just my 2 cents worth.

Jeremy

Go to Top of Page

SKIBUM
Starting Member

32 Posts

Posted - 2002-05-15 : 12:52:22
I've seen these curly braces in Crystal Reports. When querying a SQL Server.

Go to Top of Page
   

- Advertisement -