Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 10 of 11 total |
3 question on parameters |
Sat, Oct 10 2009 7:23 AM | Permanent Link |
"Sorin H" | Hello
I want to run a parameterised query like: "SELECT ...WHERE OrderDate BETWEEN DATE romDate AND DATE illDate AND Type = ype" 1 What should be the value of the params.DataType of the dates parameters on the TQuery? 2 How to assign a value to the dates parameters (on the right format)? 3.If the pType parameter doesn't have a value, I have to change the where statement or there is a better way? Thanks Sorin |
Sat, Oct 10 2009 7:27 AM | Permanent Link |
"Sorin H" | 4th question
Where can I find some help about working with parameters on the ElevateDB Manager? I open the parameters list but there i'm stuck. Thanks Sorin |
Sat, Oct 10 2009 10:03 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Sorin
>1 What should be the value of the params.DataType of the dates parameters on >the TQuery? Without testing I'd guess string since that's what you would enter into a statement if you were typing it in full, and you'll probably need QuotedStr to make sure its got the quotes round it >2 How to assign a value to the dates parameters (on the right format)? Again a guess query.ParamByName('pFromDate').AsString := QuotedStr(Engine.DateToSQLStr(Date)) >3.If the pType parameter doesn't have a value, I have to change the where >statement or there is a better way? You'll have to change the WHERE clause. As it is you'll have a test "Type = NULL" which will cause an exception Roy Lambert [Team Elevate] |
Sat, Oct 10 2009 11:29 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Sorin
>Where can I find some help about working with parameters on the ElevateDB >Manager? Tim's brain >I open the parameters list but there i'm stuck. The steps are 1. prepare the query 2. click on the parameter tab if its not the current one 3. click on the parameter you want to set a value for 4. Look down at the bottom. There's a difficult to spot TEdit. Type your parameter in here (including any quotes needed) 5. Set the type using the drop down list to the right of the TEdit 6. Click the little button to the right of the type button and that sets the parameter value Roy Lambert [Team Elevate] |
Sun, Oct 11 2009 3:18 AM | Permanent Link |
"Sorin H" | "Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message > The steps are > > 1. prepare the query > 2. click on the parameter tab if its not the current one > 3. click on the parameter you want to set a value for > 4. Look down at the bottom. There's a difficult to spot TEdit. Type your > parameter in here (including any quotes needed) > 5. Set the type using the drop down list to the right of the TEdit > 6. Click the little button to the right of the type button and that sets > the parameter value Thanks for support Roy Still something is missing. I create a new.Sql. Add the sql statement with the parameters. Click on Prepare and this raise the #700 error on the first parameter position. Sorin |
Sun, Oct 11 2009 3:40 AM | Permanent Link |
"Sorin H" | "Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
> Without testing I'd guess string since that's what you would enter into a > statement if you were typing it in full, and you'll probably need > QuotedStr to make sure its got the quotes round it > >>2 How to assign a value to the dates parameters (on the right format)? > > Again a guess query.ParamByName('pFromDate').AsString := > QuotedStr(Engine.DateToSQLStr(Date)) I try with QuotedStr and without but on both cases it raise an error. Looks like the parameter isn't replaced with the assingned value. Thanks Sorin |
Sun, Oct 11 2009 4:04 AM | Permanent Link |
Peter | Sorin
It is my understanding that the DATE predicate isn't required for parameterised queries. In my system, a query similar to yours, but without the "DATE", works just fine. select * from Event where EventDate BETWEEN romDate AND illDate Regards Peter |
Sun, Oct 11 2009 6:07 AM | Permanent Link |
Uli Becker | Sorin,
> I want to run a parameterised query like: > "SELECT ...WHERE OrderDate BETWEEN DATE romDate AND DATE illDate AND > Type = ype" sql.add('SELECT ...WHERE OrderDate BETWEEN romDate AND illDate'); ParamByName('pFromDate').asDate := MyFromDate; ParamByName('pTillDate').asDate := MyTillDate; Uli |
Sun, Oct 11 2009 8:18 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Peter
You're dead right. I've learnt something else. Confusing isn't it Roy Lambert |
Sun, Oct 11 2009 8:18 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Sorin
In that case there's something wrong with the sql. Can you post the exact code you're using. Roy Lambert [Team Elevate] |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Friday, May 3, 2024 at 08:07 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |