Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass a string to execute stmt?

Status
Not open for further replies.

gmrbase

Programmer
Mar 11, 2009
4
US
Dear all,

In SQL Server you can pass a string variable or literal string to an EXECUTE statement thus:

execute :)stringvar)
/* Where :stringvar is varchar with value 'select * from table'
--OR*/

Execute ('select * from table')


I'm using Marathon 1.1 to try and replicate this function, so as to automate a procedure by passing different subqueries multiple times.

I want my SP to be structured like this:

create procedure SP as

declare variable queryA varchar(50);
declare variable queryB varchar(50);

begin

queryA = 'select * from tableA'
queryB = 'select * from tableB'

insert into tableD
select
(execute :)queryA) as resultA,
(execute :)queryB) as resultB

from tableC

end


Does anyone have an idea as to how to do this in Marathon?

Best,
L
 
Firebird has this solution:

EXECUTE IMMEDIATE :)stringvar | 'literal string')
to do this. Does not work in Marathon though.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top