由买买提看人间百态

topics

全部话题 - 话题: argu2
(共0页)
j**n
发帖数: 551
1
来自主题: Database版 - 如何判断一行是否存在的问题。
请问如何实现:
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)
上班一天很累啦,求大牛们直接告诉答案。谢谢!
(共0页)