M**********r 发帖数: 1087 | 1 “Second result is 0 means the proc executes successfully.”,但是这个@
result below returned 1. 所以我想 exec @variable = sp_xxxx 只可以用在有
return 的sprc 里。你认为呢?
create procedure sp_test1
( @input int)
AS
if @input = 0
return 0
else
return 1
declare @result int
exec @result = sp_test1 100
select @result -- returned 1 |
|
y****9 发帖数: 144 | 2
Thanks for the above hint, it helps. I am finally close to my goal. As an
Oracle DBA, I am used to use command line. What I try to do is to simulate
Tom kyte's print rows as colum procedure in Oracle.
I did two test cases, usp_p is my procedure which is to display rows as
column for an input sql.
1> exec usp_p @s='select top 5 id, clustered_data, scattered_data from big_
table'
2> go
----------------------------------------------
id: 1
clustered_data: 0
scattered_data: ... 阅读全帖 |
|
S**H 发帖数: 1256 | 3 requirement is straight: when table A has Insert/Update --> do some string
manipulation-->then output the result to a .txt file.
current plan: use trigger on table A, --> trigger then execute one stored
procedure to do the string manipulation and output the result to a .txt file.
problem is : the stored procedure could only be executed successully
manually and the *.txt is created.
if it is called though the trigger. The application
hangs there...
the stored procedure ... 阅读全帖 |
|
l******9 发帖数: 579 | 4 【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: get value returned by SQLstored procedure from python
发信站: BBS 未名空间站 (Fri Aug 1 18:07:59 2014, 美东)
I need to check the returned value from a stored procedure on SQL server
2008 R2.
import pyodbc
sql_str = """
DECLARE @return_value int
SET @return_value = -1
INSERT INTO [my_database].[dbo].[my_table]
EXEC @return_value = [my_database].[dbo].[my_stored_
proce... 阅读全帖 |
|
l******9 发帖数: 579 | 5 I need to run a SQL server 2008 R2 stored procedure from Eclipse pydev with
python 3.2 on win 7. If I run the stored procedure from management studio,
it works well.
But, if I run it from ptython , it does not work.
sql_str_test = """
DELETE FROM [my_db].[dbo].[my_table] -- this line works
EXEC [my_db].[dbo].[my_store_procedure] -- but this line
does not work, no run-time error message, but no results generated
"""
sql_str_connect = "DRIVER={S... 阅读全帖 |
|
y********o 发帖数: 61 | 6 请问这个procedure干什么用的?sql 蝌蚪,读不懂啊~~求高人指点
USE [CFH_ODS]
GO
/****** Object: StoredProcedure [dbo].[DQ_VALIDATE] Script Date: 07/13/
2015 15:08:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DQ_VALIDATE](@tableID bigint = null, @fldID bigint =
null)
AS
BEGIN
SET NOCOUNT ON
declare @VAL_ID bigint;
--
INSERT INTO DQ_VAL(VAL_START_DT) values(GETDATE());
SELECT @VAL_ID = @@IDENTITY;
DECLARE c CURSOR LOCAL STATIC READ_ONLY FORWARD_ONLY
... 阅读全帖 |
|
x****e 发帖数: 1773 | 7 USE [CFH_ODS]
GO
/****** Object: StoredProcedure [dbo].[DQ_VALIDATE] Script Date: 07/13/
2015 15:08:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[DQ_VALIDATE](@tableID bigint = null, @fldID bigint =
null) -- This proc takes @tablID and @fldID arguments.
-- No idea what this proc does without knowing about the procs it calls, and
all the tables that are involved in the whole process.
AS
BEGIN
SET NOCOUNT ON
declare @VAL_ID bigint; -- Declare an ... 阅读全帖 |
|
s*******l 发帖数: 1386 | 8 1. UserA owns table A
2. UserB owns table B and proc C
3. Proc C returns results from both table A and table B
3. UserC need to exec proc C.
What permission does userC have?
这个问题看得比较糊涂,如果USERC可以exec UserB 的proc,那么还需要grant UserC
select permission on tableB 吗? |
|
w*******e 发帖数: 1622 | 9 EXEC permission. No need SELECT permission
[在 slowsnail (小蜗牛) 的大作中提到:]
:1. UserA owns table A
:What permission does userC have?
:这个问题看得比较糊涂,如果USERC可以exec UserB 的proc,那么还需要grant UserC
select permission on tableB 吗? |
|
|
L******t 发帖数: 1985 | 11 From comment of http://www.bradreese.com/blog/11-24-2014.htm:
I don't often praise Cisco, but taking an impartial point of view, Cisco's
action against Arista actually does have strong merit. Case law precedent is
on Cisco's side on this one. And Arista's stock taking a severe beating is
indicative of how things will pan out. Arista is worried big time even if
they are putting up a brave face and defiance in the media.
Is Cisco being a bully? You betcha! Is Cisco being opportunistic? Perhaps.
Do... 阅读全帖 |
|
|
|
|
i*****t 发帖数: 220 | 15 我刚过SAS BASE 认证, 现有2004年最新版-SAS base 认证考试资料(SAS出版,两本). 我
查了AMAZON, 上面只有2000版的资料:
http://www.amazon.com/exec/obidos/tg/detail/-/158025649X/qid=1129389834/sr=1-1/ref=sr_1_1/002-6186558-4884815?v=glance&s=books
http://www.amazon.com/exec/obidos/tg/detail/-/1580256503/qid=1129389862/sr=1-1/ref=sr_1_1/002-6186558-4884815?v=glance&s=books
2000版的太老了吧?! 4年中SAS软件都升N级了.
以下是老贴:
具体的题记不清了,我的复习周期很短,最近两天都在做题,也分不清哪是练习题哪是考题
了. 在这个版上有些收获, 分享一下: 我的SAS应该没有什么经验, 2年前上课学过,但
都忘了. 我的准备时间是差不多三个星期weekdays(所有周末都没有学习), 每天平均4 |
|
r******s 发帖数: 18 | 16 谢谢你.我发现用法如下:
NT:
Runtime.getRuntime().exec("cmd /c " + "copy c:\\temp\papaya.txt .");
(It won't work without "cmd /c")
Solaris:
Runtime.getRuntime().exec("cp /tmp/papay.txt .");) |
|
p******a 发帖数: 6 | 17 Runtime.exec() returns a Process which has an input
stream and an output stream. You should read from
the Process's output (called getInputStream though)
and dump it to the screen. Windows' implementation
doesn't follow the spec (did you use Microsoft's
VJ++? :))
The following code works:
import java.io.*;
public class tstr
{
public static void main(String args[])
{
Runtime r = Runtime.getRuntime();
Process theProcess = null;
try {
theProcess = r.exec("ls -l");
|
|
p***p 发帖数: 559 | 18 It works fine for me, I use following code to open a default Browser.
For windows:
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
It open a new Browser Process for every URL, have to shut down one by one. Now
After opening a browser, the following urls will be launched in the same
browser.
So first:
public static Process launchURL(Process p, String url)
if (p==null) {
p = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " +
url);
} else {
? |
|
H*****n 发帖数: 336 | 19 直接用runtime的exec来执行bat文件老是直接就退出了,不得已,写了一个专门的类
来执行,仿照网上的例子。然后我同时开几个FileLauncher(定义在下面)。
但是,似乎还是不能同时运行,表现是几个bat文件在同一个cmd里面运行,输出,你一句
来我一句,path搞的乱七八糟。
请问大侠怎么办?
public class FileLauncher extends Thread {
public String sFileName;
public void run()
{
try {
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(sFileName);
BufferedReader output = new BufferedReader(
|
|
m******t 发帖数: 2416 | 20 Try the other exec(), i.e. getRuntime().exec(String[] cmdarray),
and see if jvm handles the conversion better than your pair of
single quotes.
If that doesn't work, pipe xxxx through uni2ascii before
sending it to ./list. You may have to write a small shell
script to do that. |
|
j*******s 发帖数: 81 | 21 想实现“ls -l | sort”
开两个进程,一个运行ls -l,另一个运行sort,进程1的输出作为进程2的输入,可是
似乎
进程2没收到,谁能帮我看看下面代码的问题?
public void runStep0(){
try {
Process proc1 = Runtime.getRuntime().exec("ls -l");
InputStream stdin1 = proc1.getInputStream(); //
InputStreamReader isr1 = new InputStreamReader(stdin1);
BufferedReader br1 = new BufferedReader(isr1);
Process proc2 = Runtime.getRuntime().exec("sort");
InputStream stdin2 = proc1.getInputStream();
|
|
l******n 发帖数: 577 | 22 Here I post the an example from thinking in java:
If you blindly apply the idea of atomicity, you see that getValue( ) in the
following program fits the description:
//: concurrency/AtomicityTest.java
import java.util.concurrent.*;
public class AtomicityTest implements Runnable {
private int i = 0;
public int getValue() { return i; }
private synchronized void evenIncrement() { i++; i++; }
public void run() {
while(true)
evenIncrement();
}
public static voi... 阅读全帖 |
|
z****c 发帖数: 50 | 23 好像有点问题啊
$ find . -name "index.php" -exec chmod 755 {} ;
find: missing argument to `-exec' |
|
s****n 发帖数: 786 | 24 vi $HOME/.vnc/xstartup
make it look like this:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startx &
la
can |
|
Z**0 发帖数: 1119 | 25 加个exec看看。
//192.168.56.1/work /home/work cifs user,exec....
0755 |
|
w*m 发帖数: 1806 | 26 edit ~/.vnc/xstartup
here is a copy of mine,
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
startx &
ps: startx will start gnome or kde. |
|
g**s 发帖数: 79 | 27 我写了个C++ 程序, 退出ubuntu shell后需要一直运行。
正常运行 sudo ./exec
我用 nohup sudo ./exec
没有任何反应 怎么办呢
什么地方错了? |
|
|
b***y 发帖数: 2799 | 29 ☆─────────────────────────────────────☆
eecareer (没睡醒, 明天接着睡) 于 (Sat Nov 22 20:17:15 2008) 提到:
under UNIX environment.
thanks
☆─────────────────────────────────────☆
goodbug (好虫) 于 (Sat Nov 22 20:23:29 2008) 提到:
Runtime.getRuntime().exec(...)
☆─────────────────────────────────────☆
eecareer (没睡醒, 明天接着睡) 于 (Sat Nov 22 22:51:55 2008) 提到:
当运行到run.exec()时总是IOException, 可能什么原因?
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{ |
|
l********s 发帖数: 358 | 30 有个Linux下的project,我正在写command line parser。project的名字叫exec,那我
运行./exec后进入interactive mode. 我就可以输入如下的命令来运行各个task.
exec0001> read a.in
exec0002> write a.out
exec0003> quit
Parsing command line比较简单,我只要split into token,在调用getopt来parse。
我遇到的问题是我不能想shell一样输入<-(left arrow), ->(righ arrow)在command
line里面左右移动,也不能按Up arrow, Down arrow在之前和之后的command history里查
找,也不能按Tab来实现auto-complete,如果按arrow显示的是^[[A之类的乱码。
我需要添加些什么才能实现这些功能,有什么source code可供我参考吗?或者有什么
现成的library我可以使用? 我也用一个Berkeley的Linux下类似的程序,但它可以实现
这些功能,我进到 |
|
l******t 发帖数: 12659 | 31 向大家请教一个问题:
1. 编译文件: g++ -o exec prog.cpp
2. 重定向: exec < folder > output
目的是打算从folder里面寻找所需要的文件,然后处理后,将结果保存到output
请问,我在主程序中,如何得到folder的名字;里面的文件等信息啊?
多谢了! |
|
c*******9 发帖数: 6411 | 32 The following that contain "*" works fine in windows build, but does not
work when build on mac, I try to escape that does not seem to work also.
dir="/src" >
|
|
F*****n 发帖数: 1552 | 33 我建了一个web app,其中有一步用exec调用一段c++写的程序pp。因为这段程序运行时
间较长,所以打算在后台运行。我用了exec("pp > /dev/null &", $retval)。但是我
发现这样做的话,由pp输出的数据被重定向到/dev/null里面去了,$retval根本接收不
到。这种情况该如何处理呢? |
|
s****0 发帖数: 117 | 34 贴一个scala的。正在学习,书还没完全看完。初学乍练,多多指教
package myTest
import scala.collection.mutable.Map
import scala.collection.mutable.Stack
class Test3(lst: Array[Int], target: Int, all: Boolean) {
def solve() = {
for (inst <- genInstr(lst.length); op <- ops(lst.length - 1); l <- lst.
permutations) {
val rst = exec(inst, op, l);
if (rst == target) {
println(inst + ", " + op)
}
}
}
def genInstr(n: Int): IndexedSeq[String] = {
if (n == 1)
return Array("g");
for ... 阅读全帖 |
|
a***n 发帖数: 538 | 35 当然可以的。
对了不要用exec,用system。新的进程exec会代替当前进程的。 |
|
c*********e 发帖数: 16335 | 36 3个问题
1。 getTree function的 callback function cb怎么写的?
2。 nodes从哪来的,怎么赋值的?你的gettree() function里面并没有写nodes怎么赋
值啊。
3。 next(err);是async.each item执行后的call back,应该只需要call一次。你如果
放到递归recursion里,最后递归退出是通过
if (err)
return cb(err);
那 next(err)就没有被call到。
async.each(results, function(x, next) {
getTree(x.cid, function(err, nodes) {
node[x.name] = nodes;
next(err); //next(err);放这对吗?
... 阅读全帖 |
|
c*********e 发帖数: 16335 | 37 你这个function的结果,node["老王"] 里面只会包含一个儿子: “子一”或者“子二
”,不可能同时包含2个或者多个儿子。
你运行了这个function吗?结果正确吗?
// model is the mongoose collection Model
function getTree(parent_cid, cb) {
var node = {};
model.find({
parent_cid : parent_cid || 0,
}).exec(function(err, results) {
if (err)
return cb(err);
async.each(results, function(x, next) {
getTree(x.cid, function(err, nodes) {
... 阅读全帖 |
|
w*s 发帖数: 7227 | 38 简化版的程序,logout, 按了back key后
isAuthenticated() 还说 "you are logged in".
var express = require('express');
var passport = require('passport');
var net = require('net');
var bodyParser = require('body-parser');
var http = require('http');
var multer = require('multer');
var cp = require('child_process');
var exec = require('child_process').exec;
var sys = require('sys');
var path = require('path');
var util = require('util');
var session = req... 阅读全帖 |
|
s*****w 发帖数: 1527 | 39 人呢?
我老现在只能用child process 了。
第一方案
waterfall
{
fs.rename(originalFile, newFile),
find info in the 2nd line of the newFile,
delete last line of the newFile (child_process.exec("sed '$ d' newFile")
...
}
第二方案
child_process.exec("do_all_stuff.py")
大牛们怎么看? |
|
o*****p 发帖数: 2977 | 40 以前用python2的时候,对多参数输入喜欢建立一个.txt 文件,然后用文件读入exec执
行,比如:
parameter1 = 1
parameter2 = 'aabb'
paraList = [parameter1, parameter2]
paraPath = r'C:\workspace\folder1\filename'
这样对不同的工作改变这个文件中的参数,也比较容易保留参数记录。
现在python3 的 exec的功能已经不能进行参数赋值,怎么试都不行。这条路已经不通
了。
请问有没有什么办法象这样从文件中输入参数?(可以同时输入变量名和赋值)或者你
在这种情况下一般怎么做?
多谢! |
|
|
i**********r 发帖数: 36 | 42 【 以下文字转载自 Linux 讨论区 】
【 原文由 interstellar 所发表 】
Can anyone tell me the step-by-step to do so?
I have a .forward in my $home,
and have a .procmailrc in my $home
in .forward,
"|exec $home/.procmailrc"
in .procmailrc
#!/usr/bin/sh
#
:0:
*.......
folder
.....
I tried to send to this account from another account,
the email was bounced back, saying
can't execute "|exec $home/.procmailrc"
any gurus tell me what is wrong with it?
thanks, |
|
g****e 发帖数: 62 | 43 the following is a problem from the homework.
I do not understand how to do that in C. For example, how do
i use system call(fork, exec..) in C language? Is there any
place that i can find similar programs.
thanks
2. Write a C program demonstrating how the shell implements
background processing.
Hint, please use the system calls (fork, exec, signal…)
presented in class or lookup the man pages online. Your
shell should exit when you type contrl C .
Command passed for background processing can be |
|
g****e 发帖数: 62 | 44 the following is a problem from the homework.
I do not understand how to do that in C. For example, how do
i use system call(fork, exec..) in C language? Is there any
place that i can find similar programs.
thanks
2. Write a C program demonstrating how the shell implements
background processing.
Hint, please use the system calls (fork, exec, signal…)
presented in class or lookup the man pages online. Your
shell should exit when you type contrl C .
Command passed for background processing can be |
|
l******t 发帖数: 108 | 45 try replace the line
olwm -3 &
with
exec /home/wangz/bin/openbox
sorry,我对shell script是一无所知。
刚才在.xinitrc里试了试,似乎没有反应:(
我在# Add any initializations desired by the user
这一句的下一行加了这样一行:
exec /home/wangz/bin/openbox
错在哪儿?
未修改前的.xinitrc是这样的:
# .xinitrc - OpenWindows startup script.
if [ -f $HOME/.Xdefaults ]; then
xrdb $HOME/.Xdefaults & # Load Users X11 resource database
else
xrdb $OPENWINHOME/lib/Xdefaults & # Load Default X11 resource database
fi
$OPENWINHOME/lib/openwin-sys & |
|