Questions tagged [execute]

In many dialects of SQL, the execute statement is used to invoke a stored procedure.

In many dialects of SQL, the execute or exec statement is used to invoke a stored procedure.

For example:

CREATE PROCEDURE MyStoredProc @myParam NVARCHAR(500)
AS
BEGIN
    ...
END
GO

EXEC MyStoredProc @myParam = N'Testing'

Related Topics

1326 questions
12
votes
1 answer

T-SQL(MS SQL 2008), Executing procedure without 'EXEC' or 'EXECUTE' word

Is it OK to execute a stored procedure without 'EXEC' or 'EXECUTE' word in the beginning ? Normally to execute stored procedure I do EXEC DeleteProfile 'Joe Smith' But, I've noticed that next command works as well: DeleteProfile 'Joe Smith' Why…
Aremyst
  • 1,480
  • 2
  • 19
  • 33
11
votes
4 answers

Execute shell script from python with a variable

I have this code: opts.info("Started domain %s (id=%d)" % (dom, domid)) I want to execute a shell script with the parameter domid from above. Something like this: subprocess.call(['test.sh %d', domid]) How does it work? I've tried it…
Vince
  • 1,133
  • 3
  • 17
  • 34
10
votes
2 answers

How to use EXECUTE FORMAT ... USING in Postgres function

CREATE OR REPLACE FUNCTION dummytest_insert_trigger() RETURNS trigger AS $BODY$ DECLARE v_partition_name VARCHAR(32); BEGIN IF NEW.datetime IS NOT NULL THEN v_partition_name := 'dummyTest'; EXECUTE format('INSERT…
vg123
  • 235
  • 2
  • 3
  • 13
9
votes
5 answers

Copy a function in memory and execute it

I would like to know how in C in can copy the content of a function into memory and the execute it? I'm trying to do something like this: typedef void(*FUN)(int *); char * myNewFunc; char *allocExecutablePages (int pages) { template = (char *)…
Elinghton
  • 111
  • 1
  • 1
  • 4
9
votes
2 answers

Executing a vbs file with arguments created by python

I would like to convert dozens of excel sheets to csv files at once. I have a working .vbs file which makes the conversion, and I would like to execute this .vbs file on the different sheets with the help of a python code. I have the following 2…
Rieux
  • 103
  • 1
  • 1
  • 5
8
votes
4 answers

PostgreSQL syntax error when using EXECUTE in Function

I'm trying to create a function which references a temporary table in PostgreSQL 8.4. Based on my research it seems the best way to do this is to use the EXECUTE command to execute my query from a defined string. Unfortunately I'm getting an odd…
Mike Deck
  • 18,045
  • 16
  • 68
  • 92
8
votes
1 answer

Execute stored procedure with parameters

I have stored procedure and should get its result. From debugging of Java part: return getJdbcTemplate().call(newCallableStatementCreator(inParams), getDeclaredParameters()); I've discovered procedure's name and its parameters. How can I execute…
sergionni
  • 13,290
  • 42
  • 132
  • 189
8
votes
1 answer

How to return dictonary or json if I use psycopg2?

I try to use RealDictCursor: cur = conn.cursor(cursor_factory = psycopg2.extras.RealDictCursor) cur.execute('SELECT * FROM items') res = cur.fetchall() print(res) print(type(res[0])) But it doesn't work. Result: [RealDictRow([('id', 1), ('name',…
Vlad
  • 87
  • 1
  • 1
  • 6
8
votes
1 answer

Mac execute bash script

I'm on a Mac, and have a bash script that works very nicely. I'd like to make it so that a double-click will run it, but I don't know the "open with" operand. Please, what am I missing?
user2779590
  • 111
  • 1
  • 1
  • 2
8
votes
3 answers

Inserting into a temporary table from an Execute command

I need to insert data from a select statement into a temporary table using the execute command. if OBJECT_ID('tempdb..#x') is not null drop table #x Create Table #x(aaa nvarchar(max)) declare @query2 nvarchar(max) set @query2 = 'SELECT [aaa] from…
Daniel Billingham
  • 1,391
  • 5
  • 15
  • 25
8
votes
1 answer

Dapper (connection.Query or connection.Execute)

I see the example of using Dapper in executing stored procedures with dynamic parameters, and returning the results of the procedure. Usually, the examples use .Execute, but a few of them use .Query. I have difficulty in using .Execute. Which am…
Kevin Earley
  • 165
  • 2
  • 8
8
votes
3 answers

How to auto execute a macro when opening a Powerpoint presentation?

I have a pretty basic question, but could not find the answer on internet.In Powerpoint 2010, I have a macro that I would like to be executed everytime the Powerpoint document is opened. How to achieve this ?Thanks !
Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89
7
votes
1 answer

VSCode: Cannot Seem to Find Run Button to Run Javascript Code

I have the following line of code that I want to run in my VSCode application. I cannot find a Run button or option. I think it should be on the top right corner. It also looks like VSCode is not recognizing my code either.
PineNuts0
  • 4,740
  • 21
  • 67
  • 112
7
votes
1 answer

Executing a stored oracle procedure in R using ROracle

I'm having trouble executing/calling an Oracle procedure in R via ROracle. I've tried many different ways of calling the procedure and I keep getting the same errors. I've had no problem doing SELECT queries but calling a procedure is proving…
Ankhnesmerira
  • 1,386
  • 15
  • 29
7
votes
1 answer

Sybase, execute string as sql query

In Sybase SQL, I would like to execute a String containing SQL. I would expect something like this to work declare @exec_str char(100) select @exec_str = "select 1" execute @exec_str go from the documentation of the exec command execute |…
Mike
  • 58,961
  • 76
  • 175
  • 221
1
2
3
88 89