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

Can someone please help me to change my query slightly?

I have a simple database table  which is named "City". It includes the id of the district, and last names of people in the district.
As you can see in the sample table the last names occur more than once, as there are many people in the city with the same last name in different districts.

I have a query which counts the number of unique names in the city by district. The name will not be counted more than once. Meaning if it was already counted in a previous district, it won't be counted again. So for example you can see in the query result that last name "Marconi" was only counted once, as it was counted in District 1, but not District 2.

The query works great, but it needs to be modified slightly so that it will also display the total of all of the names in a district, regardless if there are repeat names in a district. Please see the "Desired result" below to see what I need my query to produce. Attached is a copy of my table with data which can be recreated in sql server by running the attached script. My sql is very generic, so that it runs on other sql platforms like Sybase and Oracle.


My Working Query :
select t.Cityid, t.DiD, count(FamilyName) AS DistinctFamilyNames
from (
    select
            CityId, MIN(DistrictId)AS DiD,FamilyName  
    from City WHERE CityId = 'Austin' Group By CityId,FamilyName
    ) t
group by t.CityId, t.DiD;



City table :

CityId  DistrictId        …
0
Become a Microsoft Certified Solutions Expert
LVL 12
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Suppose I have a City which is divided into districts.
 

I have a database table  which is named "City". It includes the id of the district, and last names of people in the district.
As you can see in the sample table the last names occur more than once, as there are many people in the city with the same last name.

What I need is a query which will display the data broken up into the CityId, the DistrictId, and the unique last name of each person in each district. Note that the count of a last name should not occur more than once. So if the same district has 10 people with the last name of "Brown" that name should not be counted more than once. Also if the name was already counted in another district, is should not be counted again in a different district.

City Table :
CityId  |  DistrictId | FamilyName
----------------------------------
Austin  |  1          | Brown
Austin  |  1          | Brown
Austin  |  1          | James
Austin  |  1          | Maroni
Austin  |  2          | Maroni
Austin  |  2          | Trevor
Austin  |  2          | Jones
Austin  |  3          | Brown
Austin  |  3          | Greyson
Austin  |  3          | Maroni
Austin  |  3          | Nantula


Query result :

Austin | 1 | Brown
Austin | 1 | James
Austin | 1 | Maroni
Austin | 2 | Trevor
Austin | 2 | Jones
Austin | 3 | Greyson
Austin | 3 | Nantula

I have a sql query which will return the correct result in sql server, but it will not work in Sybase, because Sybase…
0
Hi

We are running ASE 15.0 (with character set latin-1 on Solaris 10).  We want to convert the charset of database server from latin-1 to UTF-8 to support  Chinese characters.
can anybody help us to list the steps involved in this charset conversion?  We understand we may have to bcp out/in all the tables unless the data stored in tables are only ASCII-7.  Is there any easy method to convert to UTF-8 without bcp in/out?

We have setup Warm standby using Sybase Replication Server. Do we need to change the charset of Replication server too to support UTF-8 along with dataserver? Kindly advise.

thanks
Chan
0
SELECT Professor_Name, Salary FROM SALARIES WHERE Salary > (SELECT MIN(Salary) FROM SALARIES) * 4;
why above query not working
please advise
0
Dear EE,

We have licensed EAServer 6.3.1 software available.

Now we want to relocate our EAServer machine from one location to another. (Geographic relocation).

Please help us to confirm whether same EAServer license will work or we have to request SAP for another license.

As per our understanding EAServer license is bind with Server MAC Address.

Do we need to maintain same server name and ip address etc ?

Thanks
0
I'm trying to establish a connection to Medisoft database using ODBC but I can not get a connection established. This is the command string I'm putting in my application:

ODBC;Server=HDCServer;DSN=MSPatient;User ID=user;Password=password;

The ODBC source is pointing to MWDDF.ADD

The error is that "the table is a database table, it can not be opened as a free table"

The ODBC driver is installed. Any ideas ?
0
what are uses of Windows functions like

OVER(), PARTITION etc.

is it supported in all the databases?

what are other windows functions are there?
why they called windows functions

please advise
0
what are differences between correlated vs non-correlated sub query

when we use each one of them
what is moving range date and how correlated sub query useful there?

also when we use Cartesian product with cross join
please advise
0
DIFFERENCES BETWEEN

1. FUL OUTER JOIN
2. LEFT OUTER JOUN
3. RIGHT OUTER JOIN
4. LEFT INNER JOIN
5. RIGHT INNER JOIN
6. FULL INNER JOIN

WHEN TO USE WHICH ONE

please advise
0
SELECT UPPER(COLUMN1)
FROM SCHEMA1.TABLE1

SELECT UPPER(COLUMN2)
FROM SCHEMA2.TABLE2

i have 100 records in column 1 and column 2 with roughly half capitol words(HONDA etc.) and rest of half small words(nissan etc.)

when i do UPPER character function

i expected to see 50 records with values like NISSAN


when i do LOWER character function
i expected to see 50 records with values like honda

but i got only 2 records.

can you please advise how to fix this
0
Amazon Web Services
LVL 12
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Hello Experts,
Currently I am in the process of comparing a large number of tables between two databases. The source db is Sybase and the destination to which it was migrated to is SQL Server. One simple but a tedious way is to save the output as text files and compare it with each other using file comparison, which really is not efficient when the rows are several hundred thousands. Hence, would like to know if there is an easy way out.

Thanks in Advance!
0
I have a Sybase Anywhere 16 database. I was wondering if there was anyway of see who or when a row or column was last changed. I am thinking there is not but I am not that familiar with Sybase.
0
SELECT COUNT ( DISTINCT cust_code ) AS "Number of employees"
FROM orders;

checking above query at
https://www.w3resource.com/sql/aggregate-functions/count-with-distinct.php

how to display those unique values of  cust_code rather than just count
please advise
0
SELECT COUNT(POPULATION) from CITY
WHERE District= "California";

what is difference between above and below query?

SELECT SUM(POPULATION)
FROM CITY
WHERE DISTRICT = "California";

Please advise
0
Need to know if its possible in SAP Plant Maintenance to do a manual call on just ONE maintenance item # on a multi-item maintenance plan. For example, I have a maintenance plan # 1001 that has 99 task list items on it, varying in intervals from daily to annually, and one of those task lists maint items is # 567, I want to manually call just that 567 item to generate a work order tomorrow. I know if I were to create a maintenance plan for every task list, this would not be a problem, but my maintenance plans have many task lists on them and I cannot figure out how to manually call just ONE of them and not any others on that maintenance plan.
thx experts
BobR
0
In Sybase sql how do I check if a stored procedure exists?
If the procedure exists I need to recreate it.

If it does not exists I need to also create it.
0
I wrote some SYbase sql to check if a column exists. If it does not exists I create a new column in the table. It almost works but something is wrong with my exec statement at line 3. When I try and run the code code block below I get an error message --> stored procedure '"ALTER TABLE dbo.customers ADD CustLoyalty VARCHAR(20)"' not found.
 So can someone tell me what is wrong at line 3 below?


1  if not exists (select 1 from syscolumns where id= object_id('dbo.customers') and name = 'CustLoyalty')
2   begin
3  exec "ALTER TABLE dbo.customers ADD CustLoyalty VARCHAR(20)"
4  end
0
My question involves not only Oracle but Sql server and Sybase. I am wondering if there is a way to monitor database changes so to prevent catastrophic events so to speak in the database. By catastrophic events, below are some examples.
The reason I am asking this is that on my job I work with about 6 different databases. two are Oracle, two are Sybase and two are Sql server. I need to somehow monitor any catastrophic changes to the database. Is there a way to do that? I have an application that accesses the databases and of course the application will crash if certain catastrophic events occur. But sometimes running the application is not enough, so to somehow monitor any database changes would be great.


- Deletion of linked servers
- Deletion of user accounts
- Deletions from key tables
0
But whenever possible have a unique clustered index.  For example, on the state codes table, a unique clustered index on state_code would work just fine.
i am reading as above.
what is meaning of unique clustered index and how it is different from regular index. please let me know advantages of using it.

please advise
0
CompTIA Cloud+
LVL 12
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

I had a situation where a '\x0d' charater was appearing (appended) to the data in a single column.

Scenario:
In a stored procedure, data is retrieved and a #table is used for data manipulation.
At the end of the proc, the data is inserted into a permenant table, selecting from the #table.
However, in 1 column (not all) a carriage return, '\x0d', was appended to the data.

this was not in the #table and I could not see why this was happening.

I recompiled the permenant table and the error disappeared.

My concern is this is a production procedure & table, and it is not feasible to re-create the table and rerun the procedure every time (if) it reappears.

Any experience of this issue?
Any theories??

TIA
0
why we need junction table for many to many.

i am not clear on that concept. can you please elaborate with example tables with data?
i am going through below link but not completely clear
https://www.youtube.com/watch?v=P_nhBKs25DQ
please advise
0
hi,
What is normalization concept


if a table called Student as below with 4 columns and data as below

Student table

StudentName YearOfStudy Subject TeacherName
john                    10thGrade    Maths    Ashley

why it is better to move away Teacher information to separate table as below

Teacher Table

TeacherName TeachingSubject
Ashley                 Maths


what is various types of normalizations?
Please advise
0
Hi,

I need your help please.

I'm using Sybase database to complete this task.
I have update BSTX_TEXT field that is VARBINARY TEXT
to say "NON GROUP VBIP"

The field currently encrypted and stored as VARBINARY TEXT
what I want is to change the text field name in it.

Is there a way to read this VARBINARY ?

UPDATE dbo.CMC_BSTX_SUM_TEXT SET
 convert(char(70), BSTX_TEXT) as BSTX_TEXT = 'VBID PRESTIGE OPTION'
WHERE PDBC_PFX = 'E595'

Thanks,
Lulu
0
i am not good with table relationships on primary foreign key and 1-n and n-1 etc relationships, data model diagram reading esp when there are 100 tables connecting one other? how do i go about digesting those diagrams.
shoe i take printout and using a pencil mark physically which table is talking to which super table and sub table.

please advise any good links, resources, training, free video tutorials on this.
this concept is same across any kind of database right?
0
Does anyone have some code they can share with me. I need to grab table names in a database and grant permissions on the tables. I think this can be done with a Cursor, but I don't know how to do it, and am up against a deadline. If someone can help I would really appreciate it.
0

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
<
Monthly
>