|
The title says it all... What are the real world pros and cons of executing a dynamic SQL command in a stored procedure in SQL Server with
EXEC(@SQL)
versus
EXEC SP_EXECUTESQL(@SQL)
?
Started by Ash Machine on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
When using sp_executesql , parameters are explicitly....
Sp_executesql is more likely to promote query plan reuse.
The big thing about SP_EXECUTESQL is that it allows you to create parameterized queries which is very good if you care about SQL injection .
|
|
I want to run an exe file on my server and return the output to the browser screen. The exe file takes a input file and then returns data on the screen.
Why is this code not working?
$output = shell_exec('myprogram < INP.DAT'); echo "<pre>" ....
Started by chris on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Shell_exec() ....
One of the comments on the shell_exec manual page says:
Beware of the following inconsistency: shell_exec() and the backtick operator will not return a string if the command's output is empty if PHP is in safe mode .
|
|
This doesn't work,
Runtime.getRuntime().exec("stat /*");
nor this;
Runtime.getRuntime().exec(new String[] {"stat", "/*"})
Is there any way around it ?
Thanks,
Started by Devrim on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
That asterisk to be added i call this file without it,
Runtime.getRuntime().exec("/my_shell_file /miki.
|
Ask your Facebook Friends
|
How to run external program from php with exec command using relative paths?
<?php exec('program_name '); ?>
this works only if program_name.exe is in the same directory as this php script. for example
exec('something/program_name ');
doesnt work...
Started by mm on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
'program_name ');
To answer your question, "how [to] use relative paths in exec command?"
$rel = 'something/program_name'; $abs = realpath($rel); exec($abs);.
exec(dirname(__FILE__) .
Make it absolute, relative paths are evil.
|
|
Echo "sed -i 's/NULL/\\N/g' ".$_REQUEST['para'].".sql";
The above statement works. But it fail when I use it in exec like this...
exec("sed -i 's/NULL//\/\/\N/g' ".$_REQUEST['para'].".sql");
Started by shantanuo on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
You should escape backslashes with backslashes, not with forward slashes, like this:
exec("sed($_REQUEST['para'].".sql"); if(!is_writable($file)) throw new Exception('bad filename'); exec("sed.
|
|
What are the differences between fork() and exec()?
Started by Sashi on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
exec is a bit easier to grasp, you just tell exec to execute a process using the target executable Hawkins says, exec can be used after you fork to execute in the current process the target executable through any shared file handles....
|
|
I currently have this in my Ant build script:
<exec dir="${basedir}" executable="perl"> <arg line="${basedir}/version.pl -major"/> </exec>
However, when that runs, I get this error message:
[exec] Could not open -major
[exec] Result:...
Started by Thomas Owens on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
You can try this:
<exec executable="perl" dir="${basedir}"> <arg value="version.pl"/> <arg value="-major"/> </exec>
On windows that is
Try this if it works:
<exec dir="${basedir}" executable="./test.pl"> <....
|
|
Specifically, I need to call a version of exec that maintains the current working directory and sends standard out to the same terminal as the program calling exec. I also have a vector of string arguments I need to pass somehow, and I'm wondering how...
Started by Stefan Kendall on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The man command available so you can man fork and man exec (or maybe man 2 fork and man 3 exec.
|
|
I'm trying to execute my project using the Maven exec:exec goal and I've tried to configure it with this snippet:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1...
Started by Cogsy on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
GroupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <.
|
|
Why can I not change global variables from inside a function, using exec()? It works fine when the assignment statement is outside of exec(). Here is an example of my problem:
>>> myvar = 'test' >>> def myfunc(): ... global myvar ......
Started by linkmaster03 on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
How about this:
>>> myvar =....
>>> myfunc contents.
exec 'myvar="boooh!"' in globals() ...
Per the docs , the exec statement takes two optional expressions, defaulting to globals/precise...:
>>> def myfunc(): ...
|