Home » SQL & PL/SQL » SQL & PL/SQL » Sybase str (11.1.0.7.0)
Sybase str [message #445965] Thu, 04 March 2010 23:03 Go to next message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
What would be sybase str(approx_numeric [, length [, decimal] ])
equivalent in oracle.

Sybase call :

select str(10000.5555, 6, 3) as Test.

Tset    
 ------- 
  10001 


[Updated on: Thu, 04 March 2010 23:04]

Report message to a moderator

Re: Sybase str [message #445967 is a reply to message #445965] Thu, 04 March 2010 23:09 Go to previous messageGo to next message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
ROUND()

regards,
Delna
Re: Sybase str [message #445974 is a reply to message #445965] Thu, 04 March 2010 23:57 Go to previous messageGo to next message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
Thansk Delna,

I Think equivalent Sybase select str(10000.5555, 6, 3) as Test. would be ( literal translation )


select to_char(round(10000.5555,3),'999999') from dual;


[Typo]

[Updated on: Fri, 05 March 2010 00:04]

Report message to a moderator

Re: Sybase str [message #445981 is a reply to message #445974] Fri, 05 March 2010 00:42 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
SQL> select to_char(10000.5555, '99999') from dual;

TO_CHA
------
 10001

No need for an explicit round(), since it will be done implicitly. Of course having explicit functions is often better than doing things implicitly, but I think str() in SQLServer might actually be doing the same (an implicit rounding).
Re: Sybase str [message #445988 is a reply to message #445965] Fri, 05 March 2010 01:01 Go to previous message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
Well Frank I would prefer literal translation .. Smile thanks.

Previous Topic: i have a query to solve
Next Topic: Sum of Character column
Goto Forum:
  


Current Time: Fri Sep 30 21:01:35 CDT 2016

Total time taken to generate the page: 0.07184 seconds