mysql default value

2009-03-17 Thread Alin Popa
Hi, I have the following db table (MySQL): CREATE TABLE `examples`(        `id` SERIAL PRIMARY KEY,        `name` VARCHAR(255),        `status` VARCHAR(20) NOT NULL DEFAULT 'ready',        `description` TEXT ) ENGINE=innodb DEFAULT CHARSET utf8 DEFAULT COLLATE utf8_bin; Using ibatis sql-map I'm

Re: mysql default value

2009-03-18 Thread Alin Popa
ment feature, read user manual. > > Kengkaj > > On Tue, Mar 17, 2009 at 10:37 PM, Alin Popa wrote: >> >> Hi, >> >> I have the following db table (MySQL): >> >> CREATE TABLE `examples`( >>        `id` SERIAL PRIMARY KEY, >>    

Re: mysql default value

2009-03-18 Thread Alin Popa
>> >> For , I think that we should specify value explicitly in the >> model, error from database is correct behavior in case the field has null >> value (actually this is the reason why we set NOT NULL constraint). >> >> Kengkaj >> >> >> On Wed, Ma

Re: mysql default value

2009-03-19 Thread Alin Popa
t; I haven't tested this, but it should work. > > Regards, > Iwao > > on 09.3.18 9:42 PM Alin Popa said the following: >> Thanks Nicholoz, >> >> This is what I've done. And I also have a facade that will abstract >> for the user, the insert actions. >>

Executed SQL log

2009-03-19 Thread Alin Popa
Hi, It's possible to display the executed SQL somehow ? I know it's about doing the PreparedStatement ... but .. maybe there is an option to set in order to display these. Some workaround also will be helpful. Thanks. -- Best Regards, Alin

Re: Executed SQL log

2009-03-19 Thread Alin Popa
Cool, Thanks. On Thu, Mar 19, 2009 at 5:17 PM, Nicholoz Koka Kiknadze wrote: >> >> It's possible to display the executed SQL somehow ? > > Sure, it's possible to log what statements are prepared, what parameters are > set to and what results are retrived. Check the > 'Logging SqlMap Activity' se

iBatis - MySQL pagination

2009-05-15 Thread Alin Popa
Hi, I'm using iBatis with MySQL and also trying to do some pagination: return getSqlMapClientTemplate().queryForList("getAll", skipResults, maxRecords); and the "getAll" query: SELECT * FROM mytable Indeed, the pagination seems to work fine, BUT in mysql logs I see executed

Re: iBatis - MySQL pagination

2009-05-15 Thread Alin Popa
Thanks Larry for your quick response. If I'm doing it in Mysql statement, I'll do it using LIMIT which is taking exactly the same 2 params like ibatis (skipResults and maxRecords). My dilemma is: why ibatis is doing this kind of abstraction if on the underlying server is doing it wrong ? Might ca

Re: iBatis - MySQL pagination

2009-05-15 Thread Alin Popa
to doing pagination > with iBatis as well but would not want a full scan on the DB but rather only > get amount of rows specified by skipResults > > On Fri, May 15, 2009 at 12:10 PM, Alin Popa wrote: >> >> Hi, >> >> I'm using iBatis with MySQL and a

Re: iBatis - MySQL pagination

2009-05-15 Thread Alin Popa
ke this in iBatis: > > SELECT rownum, table_name > FROM user_tables > > WHERE rownum <=; > so when I call this from my code. will the above query be ran 5 times?? > > On Fri, May 15, 2009 at 12:42 PM, Alin Popa wrote: >> >> Bhaarat, >> >> If you're using

Re: iBatis - MySQL pagination

2009-05-15 Thread Alin Popa
Can anyone please suggest me a link to ibatis documentation regarding $substitution$ ? Thanks. On Fri, May 15, 2009 at 7:15 PM, Larry Meadors wrote: > Do it in the sql statement instead of using pagination in ibatis. > > Look at limit, row_count and offset here: > > http://dev.mysql.com/doc/refm

Re: iBatis - MySQL pagination

2009-05-15 Thread Alin Popa
I wanted to say that is retrieving all the data from database (into memory) and after that is iterating over it. What is happening when "SELECT * FROM mytable" is returning 5 MIL records ? For sure I don't want that. I don't know if mysql knows how to do optimization without "helping" it somehow (L

string substitution example/docs

2009-05-15 Thread Alin Popa
Hi, There is a place where I can find some documentation/examples/links related to string substitution in ibatis ? ($substitution$ thingy ) In the official pdf documentation I didn't find anything about it; also google didn't helped much. Thanks, Alin

Re: string substitution example/docs

2009-05-15 Thread Alin Popa
it. You open yourself to SQL > injection risks. In other words don't take a value that is passed in from a > web page and assign it in your SQL as s literal. > > Brandon > > > On Fri, May 15, 2009 at 3:52 PM, Alin Popa wrote: >> >> Hi, >> >> There

Re: how to get the sql string

2009-05-26 Thread Alin Popa
Hi Joson, Afaik, the only way to display the executed query is by enabling logging for Connection ... etc. It will display the queries before preparation. As a workaround, I enable sql logging for server (mysql in my case). Indeed, it will really help if ibatis can display the SQLs in an explicit

Re: Populate List within object in iBatis

2009-06-01 Thread Alin Popa
Hi Babitha, Hopefully that I understand right your issue, so, here is how I made it (and I think also this is the iBatis way to handle it) SELECT obj.id as id, obj.name, obj.details, p.id as proper

Re: String list in resultMap

2009-06-10 Thread Alin Popa
Hi, I suggest doing something like that (this example was not tested): On Wed, Jun 10, 2009 at 9:06 PM, cbchhaya wrote: > > Unfortunately that doesn't work either. > > The question in really simple terms: > > What should be the result map for this clas