If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > sp_dropsegment question.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-07-03, 12:13
lesguyse lesguyse is offline
Registered User
 
Join Date: Jan 2003
Posts: 3
sp_dropsegment question.

I have a baffling problem. If I run this procedure manually (ISQL prompt) it works:

use mydb
go
sp_dropsegment "logsegment", mydb, "mydevice"
go

But if I run it from a script:

isql -Uvaris6 -Pvaris6 -Suss_starship <CleanUpSegments.sql >CleanUpSegments.out

I get this:

Msg 17520, Level 16, State 1:
Procedure 'sp_dropsegment', Line 131:
There is no such segment as '“logsegment”'.
(return status = 1)
Msg 17280, Level 16, State 1:
Procedure 'sp_extendsegment', Line 135:
No such device exists -- run sp_helpdb to list the devices for the current
database.
(return status = 1)

The DBO for mydb is varis6 and it has both SA SSO roles.
"mydb" is the default database for User "varis6"

Why is it failing inside the script? Any clues or ideas would be greatly appreciated.

Regards, Les Guyse
Varian Medical Systems
Reply With Quote
  #2 (permalink)  
Old 03-10-03, 02:52
richardcrossley richardcrossley is offline
Registered User
 
Join Date: Sep 2002
Location: Dublin, Ireland & Woking UK
Posts: 150
I don't see why the file redirections wouldn't work, but try using the following and see if it makes a difference.

isql -Uvaris6 -Pvaris6 -Suss_starship -iCleanUpSegments.sql -o CleanUpSegments.out

Richard.
Reply With Quote
  #3 (permalink)  
Old 03-11-03, 03:03
db_mate db_mate is offline
Registered User
 
Join Date: Mar 2003
Posts: 15
do this

use mydb
go
select db_name()
go
sp_dropsegment "logsegment", mydb, "mydevice"
go

This will tell you the database you are in mydb or master

if you are in master and are giving right dev name then it should work
Hope you are giving the right dev name, try sp_helpsegment to get the dev name
__________________
db_mate
Reply With Quote
  #4 (permalink)  
Old 03-11-03, 09:26
rryn rryn is offline
Registered User
 
Join Date: Mar 2003
Posts: 2
Probably not worth mentioning, but if it works manually, the logsegment is no longer there when executing the script. If you recreate the db all the time to test, run checks like select db_name(), sp_helpsegment etc.
Can you print your script here ? I don't know why you are getting the sp_extendsegment message. If I copy your message it looks like you have some weird chars in your segment name.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On