cancel
Showing results for 
Search instead for 
Did you mean: 

Execute as a Script

Former Member
0 Kudos

Hi,

How can I execute the whole SQL script in one query template itself like

create table table1..

/

alter table table1..

/

create table table2..

/

....

I mean running more than one SQL statements in a single Query template.

Thanks,

Anil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anil,

Create a stored procedure in the database and execute it using a fixed query.

Hope that helps.

Regards,

Musarrat Husain

Former Member
0 Kudos

Hi Musarrat,

Thanks for the response.

How to execute a stored procedure using fixed query?

simply writing procedure name do not work......procedure1();

Regards,

Anil

Former Member
0 Kudos

Hi,

In Fixed Query you can write like this

EXECUTE STOREDPROC_NAME

'[Param.1]','[Param.2]',

Thanks,

Manisha

Former Member
0 Kudos

Hi Anil,

use FixedQueryWithOutput mode.

write EXECUTE <procedurename> or exec <procedurename> or call <procedurename> to execute the procedure from query template.

Regards,

Musarrat

Answers (2)

Answers (2)

jcgood25
Active Contributor
0 Kudos

Anil,

Use Command mode and not FixedQuery, since your query does not return a valid dataset. FixedQueryWithOutput, which was incorrectly mentioned in an earlier post, is only relevant for Oracle when the query returns a cursor holding the data set.

While a procedure will work for your needs, it is not exactly required. If the multi-line sql request is well formed (oracle requires BEGIN / END around the multi statements) then it should work, but if you use FixedQuery mode you will get a FatalError, even though the query was executed (this is because is does not return any dataset).

MII more or less just passes the query text through the JDBC driver to the DB on the other end for processing.

Regards,

Jeremy

Former Member
0 Kudos

In Fixed Query you write

EXECUTE STOREDPROC_NAME

'[Param.1]'

,'[Param.2]'

In my last post instead of '[Param.1]' it is showing as https://

So i replied again the samething.

Thanks,

Manisha