1

I want to create table from a script on sybase-iq. Script table.sql contains:

create table abc
(
 id int
)
go

I run the script command

isql -U*** -P*** -S*** -D*** -itable.sql  -oout.txt

I'm sure connection parameters are ok. Name of script is correct too.

But It doesn't work, script did not create the table and I have not any errors in output file.

Thanks in advance for your advice.

PX

Robert
  • 25,425
  • 8
  • 67
  • 81

2 Answers2

1

I found it!

The script was generated by isql with option -o and it was Macintosh format! I have seen it in np++. I have changed format to DOS\Windows and it's work!

A problem was with EOL. I had char(13) (Mac), but correct is char(13)+char(10) (DOS).

Thanks for your answers!

Robert
  • 25,425
  • 8
  • 67
  • 81
0

put a syntax error in to see if "go" is being found correctly and the statement is actually going to the server. You should get an error.

If it is then is it default database? I'm not certain Sybase IQ has different databases like ASE, but if it does then maybe your login Id has a default db that installs the tab to a different db?

abe_crabbers
  • 201
  • 1
  • 1
  • Thanks for your answer! I have put a syntax error and nothing happened. I changed name of file in isql command and i have got an error "Unable to open input file". So, isql takes the file but nothing else – Robert Aug 14 '12 at 06:44
  • Then there must be something wrong with the "go". On ASE (i.e. not IQ,) that will fail if there is a space before it.) isql when it readsy "go" at the start of a line takes it as the end of the sql batch, and sends that sql to the server. AS you're not getting an error message when you have obviously wrong sql that means "go" is not working. I can't speak for IQ, so check isql definitely works the same. Try isql interactively - does "go" work? – abe_crabbers Aug 14 '12 at 08:50
  • A problem was with EOL. I had char(13), but correct is char(13)+char(10). – Robert Aug 14 '12 at 09:26