如何使用另一个相关表中的xml标记值更新xml标记的值?
这样的事情:
UPDATE v2
 SET
 [xml].modify ('replace value of (//TAG1/text())[1] 
                with "CAST(v1.[xml].query(''//TAG2'') AS NVARCHAR(MAX))"')
FROM 
 table2 v2, 
 table1 v1 
WHERE
 v2.id = v1.id
Run Code Online (Sandbox Code Playgroud) 我有一个UITable包含一些海关UITableCells.这些单元格包含一些UILabel和一个UITextField.该表的数据源来自主控制器的属性.(此控制器也是表的委托和dataSource).
这是UI的简化屏幕截图:

现在,当用户编辑其中一个UITextField时,我需要"动态"更新所有UILabel的内容.为此,我正在收听UITextField级别的"编辑已更改"事件.这会触发以下操作:
- (IBAction) editChangeHandler: (id) sender {
    MyAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
    [[delegate.viewController.myDataSourceArray objectAtIndex:self.rowIndex] setANumber: [theTextField.text intValue]];
    [delegate.viewController reloadRows];
}
Run Code Online (Sandbox Code Playgroud)
viewController中的reloadRows方法如下:
- (void) reloadRows {
    NSLog(@"called reloadRows");
    //perform some calculations on the data source objects here...
    [theUITable reloadData];
}
Run Code Online (Sandbox Code Playgroud)
我的问题是,每当用户更改字段中的值时,都会成功调用reloadRows方法,因此显然是reloadData,但它也会导致键盘被解除.
因此,最后,用户只能在键盘解除并重新加载表格之前编辑TextField时触摸一个键.
有人知道解决方案或遇到过同样的问题吗?
我期待在HTML5中播放基于RTP的音频和视频流.我知道正确的方法是使用ConnectionPeer(HTML5)或PeerConnection(webRTC),但由于两者都不可用,我正在寻找替代方案.
一个问题浮现在脑海中,我正在寻找答案.
"rtp://127.0.0.1:4567/path/to/stream"浏览器对RTP URL做了什么?我假设答案是否定的,并且请求未转换为HTTP请求,因为它没有显示在我的Web服务器日志中.
以下2个查询给出了不同的结果:
SELECT A.source_code, B.quantity
FROM Table_A AS A
LEFT JOIN Table_B AS B ON B.merchant_id = A.merchant_id
   AND B.agent_id = A.agent_id
   AND B.default IS NULL
WHERE A.month='2011-10-01'
   AND B.type='600'
Run Code Online (Sandbox Code Playgroud)
和
SELECT A.source_code, B.quantity
FROM Table_A AS A
LEFT JOIN Table_B AS B ON B.merchant_id = A.merchant_id
   AND B.agent_id = A.agent_id
WHERE A.month='2011-10-01'
   AND B.type='600'
   AND B.default IS NULL
Run Code Online (Sandbox Code Playgroud)
我假设条件对两个查询执行相同的操作,仅在不同的时间.我错过了什么吗?
我有一个数据库字段名称调用Code,我试图使用如下所示的变量名称选择它:
Declare @var1 = [Code]
(SELECT @var1
 FROM [VoucherType]
 WHERE [DeletedBy] IS NULL
 AND [AutoID] = 1)
Run Code Online (Sandbox Code Playgroud)
显然,SQL将解释@var1为字符串而不是我的数据库字段,如何以这种方式@var1将其识别为字段名称[Code]而不是字符串,可能没有任何select或if语句.
我正在使用dtexec运行SSIS包.我的系统上的BIDS运行正常.当我创建SQL Server代理程序作业以按计划运行包时.程序包运行步骤被安排为T-SQL任务,而不是SSIS程序包).作业报告没有错误,但它甚至没有在服务器上创建输出excel文件@我想要的目标.
此外,当我在命令shell中单独运行命令时,它会返回下面显示的错误.间歇性地,它还会返回我用来复制文件的FileSystem Task上的错误,说源或目标不存在!! 当相同的变量值在BIDS中适用于我时,为什么SQL作业失败?
Started:  7:33:27 PM
Error: 2012-10-26 19:33:27.60
   Code: 0xC0016016
   Source:
   Description: Failed to decrypt protected XML node "DTS:Password" with error 0
x8009000B "Key not valid for use in specified state.". You may not be authorized
to access this information. This error occurs when there is a cryptographic err
or. Verify that the correct key is available.
End Error
Error: 2012-10-26 19:33:27.78
   Code: 0xC00F9304
   Source: GICSReport Connection manager "Excel Connection Manager"
   Description: SSIS Error Code DTS_E_OLEDB_EXCEL_NOT_SUPPORTED: The …Run Code Online (Sandbox Code Playgroud) 我试图在where子句中做一些"if"语句.我意识到sql不支持这个,但我确信必须有一些方法可以使用sql语法.如我在粗体区域所示,我试图找到所有以d开头的项目,如果他们的userfld2也是容器,则将其过滤掉.
有没有一种比我正在做的更合理的方式来做这件事还是我离开了标记?
提前致谢.
Select a.ItemID
   , b.ConversionFactor VCaseAmt
   , sum(c.ConversionFactor + 1) SCaseAmt
   , a.status
   , a.UserFld2
From timItem a
inner join timItemUnitOfMeas b on a.ItemKey = b.ItemKey
   and b.TargetUnitMeasKey = 115
left join timItemUnitOfMeas c on a.ItemKey = c.ItemKey
   and c.TargetUnitMeasKey = 116
left join timItemUnitOfMeas d on a.ItemKey = d.ItemKey
   and d.TargetUnitMeasKey = 126
Where d.TargetUnitMeasKey is null
   and b.ConversionFactor != c.ConversionFactor + 1
   and a.Status = 1
   and **(filter a.itemid not like 'd%' when a.userfld2 = 'Container')** …Run Code Online (Sandbox Code Playgroud) 从a中查找项目时Exchange 2010 Server journaling inbox,会有一些未传递邮件的通知.
处理这些电子邮件并尝试阅读该DateTimeReceived属性时,我得到一个ServiceObjectPropertyException错误:
You must load or assign this property before you can read its value.
Run Code Online (Sandbox Code Playgroud)
有没有办法识别这样的电子邮件,或加载该DateTimeReceived属性(即使它将为null)?
我的代码是这样的:
FindItemsResults<Item> mails = folder.FindItems(searchConditions, countConstraint);
foreach (Item item in mails)
{
  EmailMessage email = (EmailMessage)item;
  email.Load();
  DateTime receivedTime = email.DateTimeReceived;
  ....
}
Run Code Online (Sandbox Code Playgroud)
这些电子邮件来自日记邮箱,每封邮件都有一个受监控邮箱的副本.
没有此属性的特定电子邮件是有关从其中一个邮箱发送的电子邮件的通知,但无法传递.
通过MFCMapi我能够查看消息,并设置PR_MESSAGE_DELIVERY_TIME属性.
好的,这很难说,所以这里......
我正在使用MS SQL Server 2008 R2.我有一个临时表,可以说有两个已经填充的列.我想根据前两列的值填充第三个空列.我想要做的是为col1和col2的每个匹配组合创建一个guid(使用NEWUID()).这是一个视觉示例:
让我说我有一个最初看起来像这样的临时表:
Name    Activity    SpecialId
James   Running     
James   Running
James   Walking
John    Running
John    Running
John    Walking
Run Code Online (Sandbox Code Playgroud)
我想让它更新新的GUID,使它看起来像这样:
Name    Activity    SpecialId
James   Running     SOMEFAKEGUID_1
James   Running     SOMEFAKEGUID_1
James   Walking     SOMEFAKEGUID_2
John    Running     SOMEFAKEGUID_3
John    Running     SOMEFAKEGUID_3
John    Walking     SOMEFAKEGUID_4
Run Code Online (Sandbox Code Playgroud)
请注意如何为每个匹配对创建新的GUID.因此,James/Running组合对所有James/Running组合具有相同的GUID ...而John/Running也具有与John/Running组合相同的GUID,但与James/Running组合的GUID不同.
我试图尽可能清楚地表明这一点,但希望这不是很清楚!
有人可以告诉我SQL查询会是什么样子,以便使用正确的GUID更新临时表吗?
提前致谢.
瑞安
我有一个表格,其数据类似于以下内容:
我在这方面工作的时间越长,我的SQL就会变得更加丑陋,这告诉我,我可能做错了什么.我想要的是每个国家的唯一清单,只要该国的foo总是相同的(如果foo对于该州的所有记录都不相同,我根本不想要那个国家).此外,我想要COALESCE DateCreated和DateUpdated,并希望该状态的最大值.
所以给出这样的数据:
[ID], [State], [foo], [DateCreated], [DateUpdated]
1,  MA, data1,  05/29/2012, 06/02/2012
2,  MA, data1,  05/29/2012, 06/03/2012
3,  RI, data2,  05/29/2012, NULL
4,  RI, data3,  05/29/2012, NULL
5,  NH, data4,  05/29/2012, NULL
6,  NH, data4,  05/29/2012, 06/05/2012
Run Code Online (Sandbox Code Playgroud)
我只想要这些结果:
[State], [foo], [LastUpdated]
MA, data1,  06/03/2012
NH, data4,  06/05/2012
Run Code Online (Sandbox Code Playgroud)
得到我所追求的最优雅的方法是什么?
sql ×5
sql-server ×4
c# ×1
coalesce ×1
cocoa-touch ×1
group-by ×1
html5 ×1
iphone ×1
max ×1
postgresql ×1
rtp ×1
ssis ×1
t-sql ×1
uitableview ×1
uitextfield ×1
video ×1
xquery ×1