Re: [h2] Sybase like string truncate?
Personally I would say that this is a bug in the application logic that should be fixed. Silent data loss is a very big no-no :-) On Saturday, 2 November 2013, Frank Ratzlow wrote: Hallo Thomas, I hoped for some undocumented Sybase compatibility mode :) but trigger sounds interesting. The challenge will be to bind it to all char/varchar columns of certain tables (having up to 250 cols). I will give it a try. thx for the response Frank -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com javascript:_e({}, 'cvml', 'h2-database%2bunsubscr...@googlegroups.com');. To post to this group, send email to h2-database@googlegroups.comjavascript:_e({}, 'cvml', 'h2-database@googlegroups.com'); . Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out.
Re: [h2] Sybase like string truncate?
Hi, I would probably also change the application. I don't know a database engine that silently truncates data in the way Sybase does. See also http://stackoverflow.com/questions/13912434/how-to-detect-string-truncation Regards, Thomas On Sat, Nov 2, 2013 at 3:53 PM, Noel Grandin noelgran...@gmail.com wrote: Personally I would say that this is a bug in the application logic that should be fixed. Silent data loss is a very big no-no :-) On Saturday, 2 November 2013, Frank Ratzlow wrote: Hallo Thomas, I hoped for some undocumented Sybase compatibility mode :) but trigger sounds interesting. The challenge will be to bind it to all char/varchar columns of certain tables (having up to 250 cols). I will give it a try. thx for the response Frank -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out.
[h2] Sybase like string truncate?
Hi @all, I'm integrating H2 for local tests to mock out a Sybase DB. If you define a column as CREATE TABLE xxx ( mycol VARCHAR(3) ) in Sybase and you insert frank it will truncate the string in the DB to fra and _not_ throw an exception indicating a too long value. Is it possible to emulate the same behaviour in H2 as well? Right now it explodes if I insert the same (too long) values. TIA Frank -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out.
Re: [h2] Sybase like string truncate?
Hi, I'm not sure, but maybe you could use a trigger that truncates the data to the required length. Regards, Thomas On Fri, Nov 1, 2013 at 12:35 AM, Frank Ratzlow ratz...@gmail.com wrote: Hi @all, I'm integrating H2 for local tests to mock out a Sybase DB. If you define a column as CREATE TABLE xxx ( mycol VARCHAR(3) ) in Sybase and you insert frank it will truncate the string in the DB to fra and _not_ throw an exception indicating a too long value. Is it possible to emulate the same behaviour in H2 as well? Right now it explodes if I insert the same (too long) values. TIA Frank -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out.
Re: [h2] Sybase like string truncate?
Hallo Thomas, I hoped for some undocumented Sybase compatibility mode :) but trigger sounds interesting. The challenge will be to bind it to all char/varchar columns of certain tables (having up to 250 cols). I will give it a try. thx for the response Frank -- You received this message because you are subscribed to the Google Groups H2 Database group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out.