Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dropping an index in SYBASE ASE

Status
Not open for further replies.

bschechter

IS-IT--Management
Jul 24, 2002
8
US
Ladies and Gentlemen,

We want to drop and recreate indexes in powerscript using SYBASE ASE 12.0, but we are having problems with the drop side.

We can create them using:

ls_sql = "CREATE INDEX index1 on dba.table1"
EXECUTE IMMEDIATE :ls_sql;

However the drop SQL does not work:

ls_sql = "DROP INDEX dba.table1.index1"
EXECUTE IMMEDIATE :ls_sql;

Neither does:

ls_sql = "DROP INDEX table1.index1"
EXECUTE IMMEDIATE :ls_sql;

Any help would be greatly appreciated.

Regards,
Brian
 
i asked something similar:
thread669-374871

HTH,
 
i asked something similar,
check out this thread,
thread669-374871

hope it helps,
 
SYBASE ASE only requires index names to be unique for a particular table. In fact, many tables in our schema have the same index name, so we need to indicate which table.
 

Could you create a stored procedure to do all your DB maintenance and just call that proc from within PB?
 
We definitely could create a stored procedure for this work. The problem is that we do not seem to be able to come up with a syntax for the drop index statement that works even if the user is dba. If you know of a set of stored procedure commands that would work for our situation, it would make my day :)

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top