Sybase Database

Sybase, a subsidiary of SAP, builds a client/server relational database management system. Products include Adaptive Server Enterprise (ASE), Adaptive Server Anywhere (ASA), Sybase Unwired Platform (SUP) for mobile applications, Afaria for enterprise mobile device management and IQ for data warehouse and big data applications.

Share tech news, updates, or what's on your mind.

Sign up to Post

I am not able to create the below Sybase stored procedure. The Sybase error indicates that it does not like the line where
my TRUNCATE command is. The error message says incorrect syntax near @inTable. If I comment out that line where the TRUNCATE is, I can create the stored procedure. However I need to truncate the table. What is wrong with the line where my TRUNCATE statement is located? Can an expert help me out? What is odd is that I can run the truncate with in the command line if I actually
use the name of the table. Like TRUNCATE Table sampleTable

CREATE PROCEDURE dbo.spTruncateTable
@inTable VARCHAR(100) = NULL
   PRINT 'Table Truncated'
In Sybase, I can run this query - select * from sysservers

and get a list of servernames which host my database(s). So how do I find out which databases are associated with my list of servers?

srvid    srvstatus   srvname  srvnetname srvclass
-------    -------------    ------------  -----------------  -----------
1             0                KITOS01   KITOS01        7
2          1024             SPLIISO    SPLIISO         10
Can a Sybase expert look at my Sybase sql below. I am building a query and then I need to pass it off to be executed at line 3 below.
The table being truncated is on a linked server, and so I am appending the server name and database name to the exec statement
on line 2 below. However when my query executes I am getting an error message of "Incorrect syntax near the keyword 'exec' ".
I hard coded the prefix parameter on line 1 below, just for illustration of what I am talking about. However that value is actually created
dynamically in the stored procedure, and is not hard coded, like on line 1.

and tell me if it looks correct? I am getting an error message of illegal
1.    SET @prefix = 'POCOAPPSRV.DBTest.dbo'
2.    SET @sqlString =@prefix +  'exec ' + '  "TRUNCATE TABLE ' + @inParamTableName + '"'
3.    EXEC(@sqlString)
Hello Sybase Experts. I am porting some SQL Server sql to Sybase sql. The SQL Server sql uses several TRY CATCH blocks in sql server.
Is there any similar type of structure in Sybase to handle exceptions? If so, can someone show me how to do it?
   EXEC (@spName)
     -- Recovery code goes here

In SQL server I can get the date in military time using the following Query:
Example of output : 22:03:15.4700000

Is there any type of similar query in SYBASE which can give me the same result?
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()))

when we use surrogate key in database world. what is its importance of it. please advise
We have a Sybase Database that  needs to sync with a service, however they are asking for a read only DB user. I am not sure there is a default user already in  place. I just need to provide credentials for the Software Vendor.
Hi SQL Admins

I would like to ask you for professional recommendation and suggestions regards new MS SQL server setup.
My plan is to upgrade entire SQL system so it would be reliable and would have Disaster recovery setup.

Let me explain what kind of setup I have.
The previous SQL admin had setup system with 1 standalone SQL server (2008r2)\w attached database and 1 warm server.
SQL DB  have at least 50 instance running at the moment. The performance is not so good.
4000 employees is using this system nonstop.

What would be the best setup that would provide  server and DB great performance,
What would be solution for disaster recover capability (failover)?
What kind of storage system should we use SAN, VM-DB etc?

Also, is it ok to run SQL on VM server (disadvantage and advantage)?

Moreover,  I need to also upgrade server that is hosting internal page. Currently,  I have one Windows 2008r2 (standalone) no DR.
What would be yours recommendation for this sever, too?
I was thinking to setup 2 windows servers with MS IIS Load Balancer?

Please assist with this question\answers.

I downloaded sybaseOT and was able to install it. I vpn to the system then opened Sysbase Central , go to tools then connect.  I entered "sa" for user id and provided the password. However, I get :
could not connect to the database. the odbc driver manager could not find a data source.  I don't Sybase too much. Please help.

I have 900gb database running in sybase 12.5 and 10 testing database. I don't want to create 10 testing database with 900gb size.

So, I want to truncate all tables, and reduce the database size to 50gb, take backup as 50gb dmp and load it in 10  testing database.

Is it possible to do this, if no, please advice how can I achieve this.

Hello Experts,

I am trying to update a table and set a value equal to another value where some IDs match.

Store Number      Product Number      BOHMax
1                                    100                              52
1                                    101                               0
2                                    100                              37
2                                    102                              0
3                                    100                              46
3                                    101                              0

I want to update this table and set the BOHMax for Product 101 equal to the BOHMax of Product 100 where they are in the same store.

UPDATE storeprices SET bohmax = (SELECT bohmax FROM storeprices WHERE storenum = store)?

Something like that....
I so often hear "There is no use case with us that supports in-memory HANA database for our applications. As HANA is useful for only data warehousing (OLAP) applications like SAP BW and not for OLTP applications"

People who work in Oracle database know that 95% of times issues encountered in production are Database performance related. i.e. oracle database becomes slow due to innumerable reasons like non-usage of index, corrupt index, incorrect partitioning etc.. HANA does not need such performance tuning as it does not need indexes.

Thus why is SAP HANA said to be useful only for Data warehousing (OLAP) when all transaction processing OLTP applications can immensely benifit from HANA?
I have a very large range partitioned table in ASE 15.7. I would like to migrate this table to a new empty copy. The extraction from the old table will perform various calculations and manipulations, but for simplicity let’s just use “*”.

The simple way isn’t going to be fast enough…
(and  bcp ain’t going to cut it either.)

I’ve experimented with multiple sessions, each addressing just one partition on the source side (the partition key column has an appropriate index)…
INSERT NewTable SELECT * FROM OldTable WHERE (confine selection to partition N)

But the problem is that all but one session remains in “lock sleep”. Sybase doesn’t deal with targeting partitions the way that Oracle can (at least I don’t think it can), so I can’t seem to get any concurrency across sessions. With Oracle, I would prepare/populate partitions concurrently, and then append them together into a final table.

Any strategy suggestions to explore?

We have requirement data extract from sybase and db2 system and combine them and create a un editable document and present on b2b site . Need cheap solution
I've been learning about in-memory computing (both Oracle and SAP Hana) and this is looking like a major revolution, no ? Making the architecture of the 90's a relic of the past ? Just trying to understand.

In this SAP presentation (first 5 minutes), Prof. Hasso Plattner talks about the revolution that is Hana. Because it's an in-memory database, performance is fast as lightning, thus opening up many possibilities because of the speed. Attached is Hana's .pdf
After researching this a bit (including Oracle, here), I can see the value of in-memory computing: faster, reduces complexity, reduces data footprint, etc.

Prof Plattner also talks about eliminating OLAP databases (and data warehouses, which I suppose is OLAP), because of the speed. So is this true too ? He says to bring analysis back to the OLTP system. I also heard Hana can scan 2 B records per second . . . if so, wow.

So I'm old school Oracle, came at the beginning of client server, three-tiered, etc. with a little COBOL thrown in back in the day. Can write awesome SQL statements and did plenty of PL*SQL programming, and lots of performance tuning. But it's looking to me like this is a new world and I better get a handle on it.

We have a small d.b. so size is not even a consideration. Like 60,000 main master records (students in a …
I'm having trouble fixing the syntax in this statement:
 SELECT Administrator_VhStock.[NO], Val(Right([BR],1)) AS BR2, IIf(Administrator_VhStock.Usage="D","D",IIf(Administrator_VhStock.Usage="L","L",IIf(Administrator_VhStock.Usage="G","S",IIf(Administrator_VhStock.Usage="O","H",IIf(Administrator_VhStock.Rental_Status="R","R",IIf(Administrator_VhStock.SALESDATE Is Not Null,"V",IIf(Administrator_VhStock.STOCK_STATUS="P","O","I"))))))) AS STAT
 FROM Administrator.VhStock
 WHERE NO = varStockNo

error [Sybase][ODBC Driver][SQL Anywhere]Syntax error near '=' on line 1
I'm pretty sure its a syntax issue related to sybase

I am trying to shrink the database size while taking dump so I can load the dump in smaller size database. I guess it is not possible in sybase 12.5. So I am trying to extract only the table structure and load just the table structure into smaller size database so I can use it for simple testings. My objective is NOT to use same size database for my testing purposes.

Please let me know if it possible and if possible I am looking command to extract only table structure and command to load it in smaller size database.

What was the logic of SAP buying Sybase for $5.8 billion when SAP was building SAP HANA from the grounds up as a contender for all other databases especially Oracle and Sql Server.

It would have been much cheaper to hire talent and build SAP HANA from the grounds up than having to acquire Sybase and build HANA side by side.

What is the roadmap for Sybase. Will HANA take over Sybase?
I have  a table like this

I want to display the comma separated email values in separate rows. How can we do this in Sybase in a query?

Any ideas please.
Create table #test...
Insert into #test...
Update #test
Select * from #test

Are all these sybase statements possible with a single prepare, execute and fetch call in perl dbi?
Otherwise whats the option?
Hi Experts

Since a long time I didn't follow the PowerBuilder technology, I've been using version 7.

Could you please give me a sumarized guidance on how to becoming actualized to the newest version?

Thanks in advance
I'm trying to call a stored procedure on a Sybase adaptative server.
The connexion to the database is ok. I can call a stored procedure with : sybase_query(call myproc(), $resid). It works and the proc return lines.
I need to call a stored proedure with two params, when i call it there is no return. I check on the server and it works.

I think the problem is the way i parse the args to the stored procedure.

sybase_query( "call myproc(@iUser='bla', @ipass='passwd'", $resid);

I also try : sybase_query( "'bla', 'passwd'", $resid);

Thank you for your help
Hello Experts,

I have 2 Tables namely AddressTable1 and AddressTable2. Both of them have same number of Columns.

AddressLine1 VARCHAR(55)
AddressLine2 VARCHAR(55)

What I would like to find out is something different here.

A provide(ProviderID) will have entries in both the tables(Only 1 row) and the address of the Provider in both tables may or may not match.

I need a query/proc to find out the Providers those addresses are not matching.

When I say NOT MATCHING, I simply;

do not mean the direct comparison of the fields
do not mean converting them to UPPER case and compre

The addresses may logically be matching. But not physically(actual data in the fields)
E.g:Address.PNGHere, we know that STE and SUITE are same but when you compare them, it will always fail. We can create a crosswalk as one of the functionality to complete this. But there are other scenarios to consider.

The texts in the address fields might be loaded vice-versa. There could be space in between. There could be # instead of No.

The main reason of these data discrepancies is "Manual intervention". The data is loaded into database in 2 different modes.
User Mode: Business Users manually enter the data from a front-end application.
Batch Mode: Inbound data is fed to DB through certain interfaces

We may be able to teach the Business Users to enter the data…
Within a stored procedure, it seems that some "set" directives are ignored by Sybase while others aren't. I'm having trouble understanding why the simple example below displays statistics details, but not the query plan. Am I missing something? Doing something wrong?

1> SELECT @@version
2> go

 Adaptive Server Enterprise/15.7/EBF 22777 SMP SP122 /P/X64/Windows Server/ase157sp12x/3662/64-bit/OPT/Sat Apr 19 01:26:01 2014

(1 row affected)

3>      DECLARE @n int
4>      set statistics io, time, plancost on
5>      set showplan on
7>      SELECT @n=count(*) FROM sysobjects WHERE type='U'
9>      set statistics io, time, plancost off
10>     set showplan off
11> END
12> go

2> go
Total writes for this command: 0

Execution Time 0.
Adaptive Server cpu time: 0 ms.  Adaptive Server elapsed time: 0 ms.
Total writes for this command: 0

Execution Time 0.
Adaptive Server cpu time: 0 ms.  Adaptive Server elapsed time: 0 ms.

==================== Lava Operator Tree ====================

                        (VA = 2)
                        r:1 er:1
                        cpu: 0

            (VA = 1)
            r:1 er:1
            cpu: 0


Open in new window


Sybase Database

Sybase, a subsidiary of SAP, builds a client/server relational database management system. Products include Adaptive Server Enterprise (ASE), Adaptive Server Anywhere (ASA), Sybase Unwired Platform (SUP) for mobile applications, Afaria for enterprise mobile device management and IQ for data warehouse and big data applications.

Top Experts In
Sybase Database

No Top Experts for this time period. Answer questions to earn the title!