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 > isql bat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-26-11, 20:14
Marek_sokram Marek_sokram is offline
Registered User
 
Join Date: Aug 2011
Posts: 3
isql bat

hi everyone

I'm new utlizando the sybase command, for this I am creating the next bat with this code


ECHO La ruta de la BD es: "%rutaBD%\%nombreBD%"
ECHO La ruta de la BD de respaldo es: "%RP%"
ECHO El nombre del servicio es: "%servicio%"
ECHO El usuario de la BD es: %user%
ECHO La contraseņa de la BD es: %pwd%
ECHO El Sybase 9 se encuentra en: %RutaSybase9%
"%RutaSybase9%\dbbackup.exe" -c uid=%user%;pwd=%pwd%;dbf="%rutaBD%\ek_adm01" -y RP

"%RutaSybase9%\dbstop.exe" -d -c "uid=%user%;pwd=%pwd%;eng=%servicio%;dbn=ek_ad m99"

copy %RP%\ek_adm99.db %RP%\ek_adm99_1.db

cd 99\

rename ek_adm01.db ek_adm99.db

rename ek_adm01.log ek_adm99.log

"%RutaSybase9%\dblog.exe" -t ek_adm99.log ek_adm99.db
"%RutaSybase9%\dbisql.exe" -c "uid=%user%;pwd=%pwd%" "%RP%\StarBase.sql"

I have this code in a sql script

UPDATE CIA SET NUM_CIA='88' WHERE NUM_CIA='99';
UPDATE CNIA SET CL_CNIA = '88' WHERE CLAVE_COMPANIA = '99';
.....
...

can someone tell me how to run theses lines from the file bat??
Reply With Quote
  #2 (permalink)  
Old 08-29-11, 03:02
aflorin27 aflorin27 is offline
Registered User
 
Join Date: Apr 2008
Location: Iasi, Romania
Posts: 317
isql -Sserver_name -Uuser_name -Ppassword -iscript_file
__________________
Florin Aparaschivei
Iasi, Romania
Reply With Quote
  #3 (permalink)  
Old 08-29-11, 10:31
Marek_sokram Marek_sokram is offline
Registered User
 
Join Date: Aug 2011
Posts: 3
hello

yeah , i tried that

but the message i received is unknown sentence isql

i writing inside the file

"C:\program files\Sybase9\SQL Anywhere 9\win32\dbisql.exe" isql -U user -S server -P pass -i D:\BDatos\Script\StarBase.sql

that is correct??

thanks again
Reply With Quote
  #4 (permalink)  
Old 08-30-11, 03:40
aflorin27 aflorin27 is offline
Registered User
 
Join Date: Apr 2008
Location: Iasi, Romania
Posts: 317
Sorry - isql is for Sybase ASE. For SQL Anywhere I've found this example:
Interactive SQL utility (dbisql)
__________________
Florin Aparaschivei
Iasi, Romania
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