Re: OT sql problem

2005-04-29 Thread Nathan Maves
hmm let me try and clarify what i need. Here is the table with the data : METRIC_ID FREQUENCY PERIOD ACTUAL TARGET - - - 1 1 2005-02-01 00:00:00.0 3 1 1

Re: OT sql problem

2005-04-29 Thread Larry Meadors
I presume you mean without using the queryForList(id, parms, skip, max) call in iBATIS. ;-) Using that it is a snap: List topNList = queryForList("Customer.getTransactions", parms, 0, n); Without that, depending on the database, it can be done. SQL server has a "top (n)" syntax that you can us

OT sql problem

2005-04-29 Thread Nathan Maves
Say you had a customer transaction table that held all of the transactions for your customers. Is there any way in one query to pull back the last n number of transactions for all customers? This is only a hypothetical instance Mine is much more difficult :) Nathan

Re: Is there a way to construct an sqlmap that takes a List as well as another variable?

2005-04-29 Thread Larry Meadors
Make the list part of a bean or Map? Larry On 4/29/05, Abeyratne, Sam <[EMAIL PROTECTED]> wrote: Hey All,   Here is the scenario. My sql has an iterate tag which iterates a select statement based on a list of sid values I am passing. In addition, I want to pass another variable. I t

Is there a way to construct an sqlmap that takes a List as well as another variable?

2005-04-29 Thread Abeyratne, Sam
Hey All,   Here is the scenario. My sql has an iterate tag which iterates a select statement based on a list of sid values I am passing. In addition, I want to pass another variable. I tried a few options such as passing a ParameterMap, extra ParameterClass, etc, but haven’t had any luck.

Re: selectKey and MySql problem

2005-04-29 Thread Lieven De Keyzer
Right, should have read the API doc. It's because in the JPetStore example all inserts are done with the update() method. Thanks a lot. From: Larry Meadors <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: ibatis-user-java@incubator.apache.org Subject: Re: selectKey and MySql problem Date: Fri,

Re: selectKey and MySql problem

2005-04-29 Thread Larry Meadors
Shouldn't you be calling insert instead of update? The update method always returns the number of rows updated. The select key statement will not be executed unless you call the insert method. Larry On 4/29/05, Lieven De Keyzer <[EMAIL PROTECTED]> wrote: I've searched the archive for this issue,

selectKey and MySql problem

2005-04-29 Thread Lieven De Keyzer
I've searched the archive for this issue, but still couldn't solve it. I'm working on a webbased application using Struts 1.2.4, iBatis SQL Maps 2.0 and iBatis DAO Framework. I also try to stick close to the concept of JPetStore 4.0.5. The problem I encounter is with the stanza. These are in Fo

Re: Problem with result mapping.

2005-04-29 Thread Albert L. Sapp
Bandon, Found the problem really quick doing that. It was in the underlying bean and the use of toUpperCase on some strings. I failed to check to see if the strings where null. Once I add that check, everything worked. Won the bet with myself. We just recently started converting all strings

RE: ANSI_PADDING

2005-04-29 Thread Bitra, Venkateswararao \(Corporate, consultant\)
Need to use executeUpdate("SET ANSI_PADDING=OFF",null) method of SQLMAP class before executing any sql statement and ofcourse after starting a transaciton. -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Friday, April 29, 2005 9:14 AM To: ibatis-user-java@incubator

Re: ANSI_PADDING

2005-04-29 Thread Brandon Goodin
Please tell us how you would accomplish this with straight JDBC. You never really answered Clinton's question. Brandon On 4/29/05, Bitra, Venkateswararao (Corporate, consultant) <[EMAIL PROTECTED]> wrote: > You are right its not an IBATIS question. I just needed to use executeUpdate > method to

Re: How to obtain results looking for a NULL

2005-04-29 Thread Brice Ruth
Does it work when you use straight JDBC, with the parameterClass that you're passing in being used to populate your prepared statement?On 4/29/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hello;   I'm trying to get results from a table, but I can't search for a col = null or col = 'va

Re: How to obtain results looking for a NULL

2005-04-29 Thread Brandon Goodin
Just change your prepend to an OR when searching for NULL. B IS NULL On 4/29/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello; > > I'm trying to get results from a table, but I can't search for a col = null > or col = 'value'. > > > This is my sqlmap statement. > >

RE: ANSI_PADDING

2005-04-29 Thread Ron Grabowski
Have you tried this: SET ANSI_PADDING=OFF GO SELECT * FROM Foo --- "Bitra, Venkateswararao (Corporate, consultant)" <[EMAIL PROTECTED]> wrote: > You are right its not an IBATIS question. I just needed to use > executeUpdate method to execute "SET ANSI_PADDING=OFF/ON" statement. > > -Origina

RE: ANSI_PADDING

2005-04-29 Thread Bitra, Venkateswararao \(Corporate, consultant\)
You are right its not an IBATIS question. I just needed to use executeUpdate method to execute "SET ANSI_PADDING=OFF/ON" statement. -Original Message- From: Ron Grabowski [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 26, 2005 9:15 AM To: ibatis-user-java@incubator.apache.org Subject: RE

How to obtain results looking for a NULL

2005-04-29 Thread eloy.garcia.b
Title: Mensaje Hello;   I'm trying to get results from a table, but I can't search for a col = null or col = 'value'.     This is my sqlmap statement.     SELECT A, B FROM ME