j**n 发帖数: 551 | 1 请问如何实现:
if a row is exist, then update it.
otherwise, insert a new row.
procedure(in argu1, in argu2)
if (select * from table1 where column1=argu1) exist // how to implement
this???
then (update table set column2=argu2 where column1=argu1)
else
insert into table set column1=argu1, column2=argu2.
多谢。 |
|
w*s 发帖数: 7227 | 2 var spawn = require('child_process').spawn;
// exec 2 commands 1 by 1
var child1 = spawn('cmd1', ['argu1']);
var child2 = spawn('cmd2', ['argu2']);
怎样保证cmd1执行完毕了再执行cmd2 ?
(如果是shell我就这么写,
/home/wds# cmd1 argu1; cmd2 argu2)
上班一天很累啦,求大牛们直接告诉答案。谢谢! |
|
w*s 发帖数: 7227 | 3 比如说
child1 = spawn('ulimit', ['-m', '65536']);
这里65536我想用
var argu1=65536;
child1 = spawn('ulimit', ['-m', argu1]);
但他奶奶的不行。
谢谢各位指点! |
|
c*****d 发帖数: 6045 | 4 在oracle里可以这样做
declare
row_cnt number;
begin
select count(*) into row_cnt from table1 where column1=argu1;
if ( row_cnt = 0 )
then
...
else
...
end if;
end; |
|
|
w*s 发帖数: 7227 | 6 问题是这句怎么改
child1 = spawn('ulimit', ['-m', '65536']);
=>
child1 = spawn('ulimit', ['-m', argu1]);
今天好像就这里错了,明天上班再看 |
|
n*****t 发帖数: 22014 | 7 var argu1 = '65536'
spawn 不用改吧,我猜是要求用 string, node 不会给你把 int 转过去 |
|