Create PROCEDURE alertCount
(
@field1 VARCHAR(200),
@field2 INT,
@field3 INT,
@field4 INT,
@field5 INT,
@field6 INT,
@noOfCount INT OUT
)
AS
BEGIN
SELECT @noOfCount = COUNT(*) from tableA
END
Run Code Online (Sandbox Code Playgroud)
我对存储过程很新,基于一些教程,上面的代码帮助我创建一个过程(我希望它工作正常).
Declare @noOfCount as INT
Exec alertCount asd, 1, 1, 1, 1, 1, @noOfCount
select @noOfCount
Run Code Online (Sandbox Code Playgroud)
现在上面的代码假设返回9,因为我的tableA中有9行记录,但它返回了我null.我可以知道它有什么问题吗?
P/S:请不要理会逻辑.我只是想了解一个非常简单的存储过程.谢谢.
通过使用以下查询,testingTemp将创建临时表并且列的定义取决于oriTable.(我猜)
Select a.ID AS [a],
b.ID AS [b],
c.ID AS [c]
INTO #testingTemp
FROM
oriTable
Run Code Online (Sandbox Code Playgroud)
我的第二个查询如下:
Insert into #testingTemp (c)
Select z.ID AS [c]
FROM
oriTable
Run Code Online (Sandbox Code Playgroud)
现在,当我执行第二个查询时,SQL Server投诉
Cannot insert the value NULL into column 'a' , table 'tempdb.dbo.testingTemp...blabla
Run Code Online (Sandbox Code Playgroud)
我是否知道如何在不改变oriTable结构的情况下解决这个问题?
我有一个字符串变量如下:
string testVar = "abc ";
Run Code Online (Sandbox Code Playgroud)
然后我有一个if声明如下:
if(this.testVar[this.testVar.Length-1].Equals(" "))
Run Code Online (Sandbox Code Playgroud)
从上面我试图找到最后一个字符是否是空格,如果它是空格然后做一些事情.但即使我的话也总是假的testVar = "abc "?
假设我有两个按钮定义如下:
<Button Content="ButtonA" Command="{Binding [SomeTerminal].SomeCommand}"/>
<Button Content="ButtonB" Command="{Binding [SomeTerminal].SomeCommand}"/>
Run Code Online (Sandbox Code Playgroud)
我可以知道是否可以获取按钮的内容?用户单击第一个按钮时的含义,我可以ButtonA使用我的SomeCommand方法吗?
CarID Date Shift
1 2016-08-20 3
1 2016-08-21 1
1 2016-08-21 2
2 2016-08-20 1
3 2016-08-21 3
Run Code Online (Sandbox Code Playgroud)
预期结果
CarID Date Shift
1 2016-08-21 2
2 2016-08-20 1
3 2016-08-21 3
Run Code Online (Sandbox Code Playgroud)
如何编写这样的查询,以获得最大日期和最大班次组合的每辆车的前1名记录?
我已经安装了 powershell PKG 文件,我可以从应用程序启动 powershell 
但是,我想将它集成到 Mac 上的终端中。
根据此链接,安装 pkg 文件后,我应该能够powershell在终端上运行命令并切换到 PS 模式。
import React, { Component } from 'react';
import { View, StyleSheet, Animated } from 'react-native';
export default class Ball extends Component {
componentWillMount(){
this.position = new Animated.ValueXY(0,0);
Animated.spring(this.position, {
toValue: {x :200, y: 500}
}).start();
}
render() {
return (
<Animated.View style={this.position.getLayout()}>
<View style={styles.ball} />
</Animated.View>
);
}
}
const styles = StyleSheet.create({
ball: {
height: 60,
width: 60,
borderRadius: 30,
borderWidth: 30,
borderColor: 'green'
}
});
Run Code Online (Sandbox Code Playgroud)
上图所附代码Animated.ValueXY(100,100)改成后运行没有问题Animated.ValueXY(0,0)
任何人都可以照顾解释为什么这样的行为存在如我的想法是有这个球开始从移动,而不是x:0,y:0我想它开始移动x:100,y:100,而不是
MainComponent:
<Tabs
initialPage={this.props.day}
tabBarUnderlineStyle={{ backgroundColor: '#5AF158' }}
renderTabBar={() => <ScrollableTab />}>
{this.renderTabHeader()}
</Tabs>
renderTabHeader() {
return (
this.props.dateArray.map((date, i) =>
<Tab
key={i}
heading={date.format('DD/MM')}
tabStyle={styles.tabStyling}
activeTabStyle={styles.activeTabStyle}
textStyle={styles.tabTextStyle}
activeTextStyle={styles.activeTabTextStyle}
>
<View style={{ backgroundColor: '#EEEEEE', flex: 1 }}>
<Content contentDate={date.format('YYYY-MM-DD')} />
</View>
</Tab>
)
);
}
Run Code Online (Sandbox Code Playgroud)
内容组件:
class Content extends Component {
componentWillMount() {
console.log('Component Will Mount() ?');
this.props.loadTransactionByDate({ date: this.props.contentDate });
}
render() {
return (
<View><Text>{this.props.contentDate}</Text></View>
);
}
Run Code Online (Sandbox Code Playgroud)
基本上,在MainComponent中有一组选项卡.我注意到一些相当奇怪的东西Content会在他们的标签第一次点击或激活时安装?
这是第一次的意思,我们可以点击Tab索引2并看到控制台登录componentWillMount,然后我们切换到另一个选项卡,如果再次返回Tab索引2,componentWillMount将不再被触发?
通常我会在返回特定对象的方法中实现switch case.如下所示:
private string testing(string input){
switch(input)
{
case "a":
{
....
return "TestingResult";
}
case "b":
{
....
return "TestingResultB";
}
default:
return null;
}
}
Run Code Online (Sandbox Code Playgroud)
现在我想知道是否可以为分配值编写一个开关案例?如下所示:
private string testing(string input){
string TEST="";
switch(input)
{
case "a":
{
....
TEST = "TestingResult";
}
case "b":
{
....
TEST = "TestingResultB";
}
default:
}
return TEST;
}
Run Code Online (Sandbox Code Playgroud)
因为它可以通过简单的If-Else语句实现,这个问题对我来说是了解switch case的更多功能
当然,经过测试,我收到错误
control cannot fall through from one case label('case: "a"') to another
Run Code Online (Sandbox Code Playgroud) c# ×3
sql-server ×3
react-native ×2
sql ×2
amazon-ec2 ×1
block ×1
button ×1
components ×1
equals ×1
expo ×1
lifecycle ×1
macos ×1
native-base ×1
powershell ×1
string ×1
t-sql ×1
volume ×1
wpf ×1
xaml ×1