Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 10 total
Thread Copy Query with parameters
Wed, Feb 3 2016 3:42 AMPermanent Link

Hershcu Sorin

Hello
I have a Query with parameters.
After I assign values to the parameters and open the query
I want to copy the command to another query without need to assign the
parameters values again
Can I do it and how?

Thanks Sorin
Wed, Feb 3 2016 4:48 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Sorin


I don't know a way.

Roy Lambert
Wed, Feb 3 2016 2:31 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< I have a Query with parameters.  After I assign values to the parameters and open the query I want to copy the command to another query without need to assign the  parameters values again  Can I do it and how? >>

Yes, use something like this:

TargetQuery.Close;
TargetQuery.SQL.Assign(SourceQuery.SQL);
TargetQuery.Params:=SourceQuery.Params;

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Feb 4 2016 3:10 AMPermanent Link

Hershcu Sorin

Thanks
No It's raise the error:
Error #700 Invalid expression ? found, dynamic parameter reference not
allowed

Sorin

"Tim Young [Elevate Software]"  wrote in message
news:503013EF-F8F9-440F-8F5D-0C13C6F9A108@news.elevatesoft.com...

Sorin,

<< I have a Query with parameters.  After I assign values to the parameters
and open the query I want to copy the command to another query without need
to assign the  parameters values again  Can I do it and how? >>

Yes, use something like this:

TargetQuery.Close;
TargetQuery.SQL.Assign(SourceQuery.SQL);
TargetQuery.Params:=SourceQuery.Params;

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Feb 4 2016 8:43 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Sorin


Can you show the sql and the parameters you want to apply?

Roy Lambert
Thu, Feb 4 2016 11:23 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< No It's raise the error: Error #700 Invalid expression ? found, dynamic parameter reference not allowed >>

This means that you're using a parameter marker in a location in the SQL where you're not allowed to do so, such as in the SELECT expressions.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Feb 4 2016 12:12 PMPermanent Link

Hershcu Sorin

This is the SQL:

SELECT Id, DateToDo, Tipul, CodCar, Number, Type, Contact, Tel, Shem, Tel1,
Oved, Atar, Problem, ZeutM
FROM KCrTipul Ct
LEFT JOIN KCar Cr ON Ct.CarId = Cr.Id
LEFT JOIN KTblTipul Tt ON Ct.TipulId = Tt.Id
LEFT JOIN KTblType Tp ON Cr.TypeId = Tp.Id
LEFT JOIN KTblOved Tv ON Cr.OvedId = Tv.Id
LEFT JOIN KTblAtar Ta ON Cr.AtarId = Ta.Id
LEFT JOIN KClient Cl ON Cr.ClientId = Cl.Id
WHERE Cr.Pail = True AND Cr.Freze = False AND DateToDo >= TonguemDateF AND
DateToDo <= TonguemDateP
ORDER BY DateToDo

There are 2 parameters. Witch one is not allowed?
Thanks Sorin

"Tim Young [Elevate Software]"  wrote in message
news:738890E1-9F1F-4FE2-B4E0-7479048E841E@news.elevatesoft.com...

Sorin,

<< No It's raise the error: Error #700 Invalid expression ? found, dynamic
parameter reference not allowed >>

This means that you're using a parameter marker in a location in the SQL
where you're not allowed to do so, such as in the SELECT expressions.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Feb 5 2016 12:39 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< There are 2 parameters. Witch one is not allowed? >>

That SQL looks fine.  Are you using the exact same code that I posted ?

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Feb 5 2016 1:03 PMPermanent Link

Hershcu Sorin

Yes. This is the source SQL. I assign the parameters value and open
Then I assign the SQL to a target query, add the command "CREATE VIEW "TEMP"
AS   "
before the SQL and try to execute. Then it raise the error about the
paramater

Thanks Sorin

"Tim Young [Elevate Software]"  wrote in message
news:BA6127D7-C13F-4CF6-8790-297162985845@news.elevatesoft.com...

Sorin,

<< There are 2 parameters. Witch one is not allowed? >>

That SQL looks fine.  Are you using the exact same code that I posted ?

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Feb 8 2016 6:20 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< Yes. This is the source SQL. I assign the parameters value and open Then I assign the SQL to a target query, add the command "CREATE VIEW "TEMP" AS   " before the SQL and try to execute. Then it raise the error about the parameter >>

You can't use parameters with CREATE DDL statements.

Tim Young
Elevate Software
www.elevatesoft.com
Image