Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Please tell me what I doing wrong
Fri, Nov 9 2007 10:23 PMPermanent Link

"Trevor Keegan"
Hi,

I am using EDB v1.5b2 and have the following SQL Statement:

INSERT INTO MyTable
SELECT Acc.OID, Acc.Number, Acc.Name, Acc.TypeID, Acc.TaxTreatmentID,
Acc.Percent, Type.Code, Type.Description AS Desc
FROM AccHeader AS Acc
, AccType AS Type
WHERE Acc.TypeID = Type.OID
AND Type.Code = :Type

If I change my query to :

INSERT INTO MyTable
SELECT Acc.OID, Acc.Number, Acc.Name, Acc.TypeID, Acc.TaxTreatmentID,
Acc.Percent, Type.Code, Type.Description AS Desc
FROM AccHeader AS Acc
, AccType AS Type
WHERE Acc.TypeID = Type.OID
AND Type.Code = 'A'

Then everything seems to work OK.   It seems as though I cannot use
parameters here is that correct?

Regards
Trevor Keegan

Sat, Nov 10 2007 12:56 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Trevor,

<< Then everything seems to work OK.   It seems as though I cannot use
parameters here is that correct? >>

Is the original query just slow ?  If so, then the reason is described here:

http://www.elevatesoft.com/edb_faqt_6.htm

--
Tim Young
Elevate Software
www.elevatesoft.com

Sat, Nov 10 2007 5:40 PMPermanent Link

"Trevor Keegan"
Hello Tim,

The Query is not slow (could also be because I do not have much data), but I
have noted your FAQ.

My problem is just that the query does not run at all with the parameters in
it.  I found that if I try requesting the Execution plan on the first query
i.e. I do not get an execution plan at all.

However, when I run exactly the same query without the use of parameters, I
get both and execution plan and the desired result.

I also tried romiving the INSERT line i.e. Turn it into a simple SELECT
statement using Parameters.....and this worked fine.

This is what let me to ask.....can parameters can be used in this type of
statement?

Regards
Trevor Keegan

Mon, Nov 12 2007 5:58 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Trevor,

<< My problem is just that the query does not run at all with the parameters
in it.  I found that if I try requesting the Execution plan on the first
query i.e. I do not get an execution plan at all. >>

Did you try this with 1.06 ?  There was an issue with parameterized queries
that could cause something like this.  Unfortunately, I think I found it
during my work and forgot to log it.  If you want to send me the database
catalog/tables, I can test it here and see if it fits that case and
officially add it as an incident report that has been fixed in 1.06.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image