cancel
Showing results for 
Search instead for 
Did you mean: 

Using same database file on different platforms

huber1
Participant
2,531

I had created and filled a database file on Mac OS X 10.6. I then transfered and use that very same file on Windows 2008 Server. It works fine and I can't see any obvious problems. To be a bit more sure I would like to know if this is fully support by Sybase? What are the experiences regarding creating a database file (and log) on one OS and move it to another OS? I am also wondering about the encoding of the file, line breaks etc., which are different for the different platforms. Is this internally handled?

Best regards, Robert

Accepted Solutions (0)

Answers (1)

Answers (1)

MarkCulp
Participant

Yes, moving databases between platforms is fully supported by SQL Anywhere.

All integer data within the file is stored in little endian (but users don't really need to know this).

[n]varchar data is stored in the character set specified when the database was created. Line terminators are up to the application developer to decide - i.e the database just stores the data that is given to it.

HTH

huber1
Participant
0 Kudos

It helps me a lot, thanks very much! Regards, Robert

huber1
Participant
0 Kudos

Coming back to your answer concerning the line terminators, if people enter data with Macs and Windows machines and therefor entering different line breaks (LF vs CR and LF), will such text appear as the same (visually) if users look at them on the other platform? Thanks in advance for clarifying, Robert

Former Member

That depends on your viewer. What are you using to view the text? Many Windows-based text viewers/editors will do the right thing in the absence of the CR character. Some UNIX/Mac-based ones also display the text when there is a CR character. However, most UNIX/Mac-based text viewers/editors will display the CR character as ^M. Web browsers will probably almost always just ignore the CR character. I can't say for sure what Sybase Central or dbisql will do. I suspect they just show the r and n characters as the escape sequence.

If you want to support free-form text entry/extraction, you could probably use a filter.

For example, you could create a stored procedure or a trigger that removes all CR characters (saves space this way) during insert/update. Then you could create a stored procedure that looks at the OS field in the AppInfo connection parameter and adds CR for clients on Windows. All access to the text data would have to go through the stored procedure(s), but at least then you'd have an automatic way to get platform-specific text.

huber1
Participant
0 Kudos

Thanks for the suggestion! I am using Servoy as IDE (www.servoy.com), the result is either a SmartClient which is Java based, i. e. a Java client or a Web Client. We use both, i. e. users enter data via the application (Java Client) and the Web Client. I am going to look how it works as I am not sure if there is also a difference between various (display) types of fields like text, HTML area, ...)

0 Kudos

Hi Robert, I sent an email to the general email box on your website about your application and how it works. We are looking at doing something similar (desktop application with web client option) and it would be great to talk to someone who has already done it.