Go Premium for a chance to win a PS4. Enter to Win

x

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

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
New feature and membership benefit!
LVL 11
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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
We are working with a Sybase database and would like to know the names of all of the linked servers, if any; which are currently set up in Sybase ASE. Does anyone know how to look at the linked servers for Sybase?
0
Hello Experts

How to set the column width in sybase databse.I am looking for alternative of oracle alternative "column <column name> format a<width>" in Sybase.

Vinit kumar
0
Dears, kindly help in the following case:

I want to archive a very large table in our production database, by moving it's data to an exact table in another database on another server, then delete data from the original table.

but I want to do this archiving periodically, this means, I need to set a range of data to be moved , I'm planning to use bcpout, then bcp in in the target table,

as we cannot set a range by this tool , I'm thinking to insert part of data in a temp table

(select * into tempdb..tbl1 from tbl1 where date between @date1 and @date2),

then use bcpout on this temp table.

But the case is the data which will copied in the temp table is about 300 MB, while the unused space in the temp database is just 120 MB.

this temp database in the production server, and it is used besides the prod database in many application,

is there any hint to over this problem, or there is another way to archive my data?

please help.
0
DECLARE
 alert VARCHAR2(100);
      rowcount      number;

begin
alert:=show_alert('FLAG_ALERT');
 
if (alert=Alert_button2)then
exit_form;

elsif (x=Alert_button1)then
      SELECT COUNT(*) INTO rowcount FROM om_customer WHERE cust_credit_ctrl_yn = :Rep_value_3;
      
      if (rowcount>0) then
      UPDATE om_customer SET cust_credit_ctrl_yn='Y'
   WHERE CUST_CODE IN
   (SELECT CUST_CODE FROM
   (SELECT * FROM om_customer
   WHERE cust_credit_ctrl_yn= :Rep_value_3
   and cust_code= :Rep_value_2));
      else
0
Hi Experts,
How to check the status of Sybase database are online or offline.
I know sp_helpdb , But is there any other better command which shows state of database.
Thanks.
0
Hi Expert,
We are not sure what is the use of SID_AUDIT database, but i understood we will created this as part of post configuration
Can you please tell us what is the use of CMS and Audit database.
Some times database  fills up and we need to add 20gb of space.
Can you tell us how can we analyse this situation.
0
Hi Team,

I need to write a stored procedure to insert and delete a record in a table in sybase . Iam new to Sybase , below is the code I wrote in Oracle stored procedure
-- Oracle version
Create or replace procedure p1 (id number , status out number)
is
begin
insert into t1 values (id);

delete from t2 where empid=id;
commit;
exception
when others then
dbms_output.put_line(SQLCODE || SQLERRM);
rollback;
end;

I need to write the above logic in sybase , any help is really appreciated.  I have tried the below code  , need an help on the exception handling section

create procedure p1 (@id int , out @status int)
as
begin

insert into t1values (@id);
delete from t2 where empid=@id;
set @status=0;
commit;
-- Need help on how to write an exception block which can handle the error
end;
0
Hi

I am accessing in Access, using the sybase ase 15.7 driver, a sybase table that has date/time fieds. However, when accessing that table over an ADODB connection, the values returned are always only a date without time. If I use convert(varchar(8), <datetime field name>, 8) to get the time part, I invariably get a 00:00:00 time, although I KNOW that these fields all have a non-zero time value.

The weirdest is that, if I just open the table in Access (using the SAME ODBC driver to link the table), I see the time in these fields !

What is going on, and how can I get the time portion of these dates ?

Thanks for help.
Bernard
0
Keep up with what's happening at Experts Exchange!
LVL 11
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Hi Team,

I need to create a stored procedure which inserts rows from an Emp table into the Staging table

Stageing Table
Create table EmployeeStg
(
EmpID INT,
ENAME VARCHAR2(40),
Age INT);
go


Original Table

Employees
EMPID         ENAME                      Age
1               sam                              40
2               xyz                                 20
3              dfdf                               34


My question how can I insert rows EmployeeStg using Employees table from a Sybase stored procedure . Can I use Select into clause . What is the best way to achieve this .

Any sample code is reaaly appreciated. Since MSSQL and Sybase use T-SQL , Iam moving this under both MSSQLSERVER and Sybase database
0
Hi Team,

Iam new to Sybase  and unix , I need an help in writing a shell script which will  pass  the shell script parameters to the stored procedure .  The below code throws an error ,Any help is really appreciated

Procedure DeleteData
@Empid INT,
@empType VARCHAR2(40),
@status OUT INT
WITH RECOMPILE
AS
BEGIN

INSERT INTO TABLENAME VALUES (@EMPID,@emptype);

Delete from TempEMp where empid=@EMPID;

end;
go

I need to call this storedprocedure from the shell script

#!/usr/bin/ksh

EmpId =$1
EmpType=$2
Status=0
result=$(isql -usam -p sam123 -slocalhost << EOF

 DeleteData $EmpId, $EmpType , $Status
EOF)

If [ $Status -eq 0 ]
then
      echo "Success"
else
    echo "failure"
fi
0
Hi Team,

Iamm new to sybase , Need help on any tutorial for performance tuning in Sybase (like explain plan in oracle , hints etc) .
Any help is really appreciated.
0
Hi,

In sybase, table sysdatabases has column dumptrdate, what date does it indicates ?
It is the unix time stamp of that dmp stripes ?

If it unix time stamp, can I manually update that column ?

my problem is as below..

1. Copied the dmp from one server to another
2. Load the dmp
3. Still offline
4. loading trans dmp but failed due to date mismatch.
5. Checked the date in dumptrdate, it is showing wrong date
6. Made it online and checked the date inside database, it is showing correct date.
7. So I suspected that dumptrdate used unix timestamp so I loaded the dmp again..manually updated dumptrdate column and tried loading tran dmp, it is still failing.

Cant figure out where I am going wrong, need some expert advice on this.

Thanks
0
In sql server I can perform an INSERT INTO Table SELECT FROM to copy data from a source table to a target table. Where the target table might already have data in it. Is there a way to do this in SYBASE syntax?
0
I need to create a new column using an alter statement, and I need to add a column value which will default to a value of 0 upon completion. I have tried using the two alter statement seperately, however I get the error message shown below. Can anyone tell me what needs to be done so that I can create a default value of Zero?

EXECUTE (' ALTER TABLE dbo.TrtTable ADD Contag TINYINT DEFAULT 0')


EXECUTE (' ALTER TABLE dbo.TrtTable ADD Contag TINYINT NOT NULL DEFAULT (0) ')


https://www.experts-exchange.com/askQuestion.jsp#
> Script lines 111-138 ------
Neither the select into nor the 'full logging for alter table' database options are enabled for database 'CompEmp'. ALTER TABLE with data copy cannot be done.
0
I need help from a Sybase Expert.
I need to be able  to create a table in my database from scratch.  So I have a master script that creates all of the tables from scratch. For one of the tables, call it "EmpList" when I try to create that table from scratch I get the error message shown below. As a side note, I generated the sql to create the table by right clicking on the table in Aqua studio, and selecting "Script Object to File As : Create".

Why am I getting the error message below(See very bottom of post) when I try to create the table?
Here is my sql to create the table:

CREATE TABLE dbo.EmpList (
EmpId numeric(10,0) IDENTITY NOT NULL,
DtCreated datetime NOT NULL,
CONSTRAINT EmpList_pri PRIMARY KEY NONCLUSTERED(EmpId)
WITH max_rows_per_page = 0, reservepagegap =0
)
LOCK ALLPAGES
WITH max_rows_per_page = 0,
reservepagegap = 0,
identity_gap = 0
ON [default]
GO
GRANT SELECT, INSERT, UPDATE ON dbo.EmpList TO jeltem
GO
GRANT SELECT, INSERT, UPDATE ON dbo.EmpList TO admin
GO





> Script lines
dbo.EmpList not found. Specify owner.objectname or use sp_help to check wether the object exists (sp_help may produce lots of output)
0
Hi,
I would like to know if there is any configuration parameter or procedure from which I could know how many CPUs or cores is used by ASE?
I am using Sybase ASE 16.0 & 15.7.
0
I can add a column to a table as follows. Is there a way to specify that the column can not be null?
Or am I already doing that implicitly.

My Sybase sql which works :
ALTER TABLE dbo.MaxPlayer ADD SmallScore tinyint DEFAULT  0


This does not work as I added NOT NULL:

ALTER TABLE dbo.MaxPlayer ADD SmallScore tinyint NOT NULL DEFAULT  0
0
Hire Technology Freelancers with Gigs
LVL 11
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

I need to create a new column in a Sybase data table, but only if the column does not yet exists. Here is my query, below. My table is named BALANCE and the new column is named SAMP

When I run the query I keep getting an error message "Incorrect Syntax near bit". Can someone tell me what is wrong with my syntax. I know I am close, but I just can't figure it out.

if not exists (select 1 from syscolumns where object_name(id) = 'BALANCE' and name = 'SAMP')
begin
execute('

 alter table BALANCE add column SAMP bit DEFAULT (0) NOT NULL

')
0
I have the following Sybase sql code that is within a stored procedure. When the code executes, an error message is dislpayed 2627 - "Violation of PRIMARY KEY constraint BUKO_PRIMARY". I don't actually have access to the data, so I have limited debugging capabilities right now. However I think that the error is occurring because of maybe an attempt to insert a duplicate record into the table stored in @BakName. Does that sound correct? How should I handle this in Sybase sql to deal with the attempt to insert a duplicate record?
Also does the command "INDEX" attempt to make a column as a unique value in the column?

SELECT queryString = 'SELECT b.* INTO ' + @BakName +
                       'FROM stageTable a (INDEX stageTable_pk) +
                       ' INNER JOIN ' + @PrxyName + 'b (INDEX BUKO_PRIMARY) ON a.ATO_ID = b.TO_ID '
0
I am using DBArtisan 9.1.2 and I want to recompile a Sybase stored procedure that exists because I have to modify the stored procedure. How would I do so?

The stored procedure starts out as ...

create procedure dbo.usp_CalculateImportedItems
as
declare @err                  int
BEGIN
declare @BalanceRecordCount int
declare @PendingRecordCount int
declare @WiredRecordCount int
declare @OpenItemsRecordCount int
declare @IntellimatchRecordCount int
declare @AutoImportDate datetime
declare @ManualImportDate datetime

BEGIN  TRANSACTION
0
hi
i am comparing the output of number of view from syscomments for specific tablename with sp_depends tablename output. i always get few extra views in syscomment output. is it correct way of comparing and why we get extra output from syscomments output.

1. select distinct sysobjects.name,
case
 when sysibjects.type = 'v'
..
  from sysobjects inner join syscomments on
sysobjects.id = syscomments.id
where syscomment.text like'%tablename'

2. sp_depends '%tablename%'

i am comparing above 2 output and find there is diffetence output..
0
Hi,

I'm working in the DATA WAREHOUSE PROJECT, Does anyone have the industry best practices on how to build a  TEST cases.

Such as Tools, Technique, the methodology used?
0
UNABLE TO CONVERT THE DLI_MAIN_CODE AND | CHAR

--SQL================================
CREATE TABLE #PROOF
(
    dli_barcode numeric NOT NULL,
    all_dli_main_code varchar(10) NOT NULL
)

DECLARE cur CURSOR for
    SELECT
       
        U.DLI_BARCODE,
        U.DLI_MAIN_CODE
        FROM OMPROD..PS_DLI_ITEM_UC U, #AD_DAILY_REPORT D
        WHERE U.DLI_MAIN_CODE IN  (7,8,89)
        AND U.DLI_BARCODE = D.CHILD_BARCODE
        AND U.SETID = D.SETID
         


DECLARE @curDLI_BARCODE NUMERIC
DECLARE @lastDLI_BARCODE NUMERIC
DECLARE @curDLI_MAIN_CODE varchar(30)
DECLARE @DLI_MAIN_CODE SMALLINT

OPEN cur
FETCH NEXT FROM cur INTO
      @curDLI_BARCODE, @curDLI_MAIN_CODE
SET @lastDLI_BARCODE = @curDLI_BARCODE
WHILE @@FETCH_STATUS = 0
BEGIN
    IF (@lastDLI_BARCODE != @curDLI_BARCODE)
    BEGIN
        INSERT INTO #PROOF(dli_barcode ,all_dli_main_code)
            VALUES(@lastDLI_BARCODE, @DLI_MAIN_CODE )    --<<<<+ '| '
        SET @lastDLI_BARCODE = @curDLI_BARCODE
        SET @DLI_MAIN_CODE = NULL
    END

    IF (@DLI_MAIN_CODE IS NULL)
        SET @DLI_MAIN_CODE = @curDLI_MAIN_CODE
    ELSE
        SET @DLI_MAIN_CODE = CONVERT(VARCHAR(10), @DLI_MAIN_CODE + N' '+ '| ' + @curDLI_MAIN_CODE) --<<<<20170428 PM

    FETCH NEXT FROM cur INTO
        @curDLI_BARCODE, @curDLI_MAIN_CODE
END

IF (@DLI_MAIN_CODE IS NOT NULL)
BEGIN
    INSERT INTO #PROOF(dli_barcode, all_dli_main_code)
        VALUES(@curDLI_BARCODE, CONVERT(VARCHAR(10), …
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
>