小编Tom*_*Tom的帖子

在SQL Server中编写一个Insert Insert Trigger

有一个After Insert触发器.正在写入的原始表具有将采用任何数字的数量字段.但是,插入后触发的触发器必须为每个QTY写入一次事务表.因此,如果原始QTY为4,那么当触发器触发时,它必须将记录写入四次.

USE [BLAH]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


ALTER TRIGGER [dbo].[Track_Change_Detail]   
   ON  [dbo].[MYtABLE]
   AFTER Insert
AS 
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    Declare @Reason varchar(255),
    @TransID  nvarchar(10),
    @Qty bigint,
    @UserID nvarchar(10),
    @Disp   nvarchar(3),
    @ItemNumber nvarchar(20),
    @ItemLevel nchar(1),
    @LocalQTY   Int

    Declare @curChg Cursor
    begin
        --insert into BLAH.dbo.Transactions
        set @curChg = CURSOR FAST_FORWARD FOR
        SELECT              inserted.TransiD, 
                            inserted.Item_num, 
                            inserted.Quantity,
                            inserted.Logged_in,
                            Inserted.Lvl,
                            Inserted.Disposition 

        FROM                inserted …
Run Code Online (Sandbox Code Playgroud)

sql-server

5
推荐指数
1
解决办法
63
查看次数

如何将Dialog转化为DialogFragment?

来自 VB 世界的我今天了解到 Java 中的对话框不是模态的。我的任务是将我们在 VB.net 中为基于 Windows 的摩托罗拉设备编写的程序转换为使用 Android Studio 为 Android 摩托罗拉设备编写的 Java 程序。我正在尝试使其与 Windows 中的表单类似。我所在的表单有几个提示输入的消息框。我尝试使用 java 但注意到对话框并不总是等待响应。我读到使用对话框片段可以完成我想要做的事情。这是我为第一个对话框准备的 XML。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

    android:background="@color/colorBackgroundGray"
    >

    <TextView
        android:id="@+id/theText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:text="Holding Text"
        android:textAlignment="center"
        android:textColor="@color/colorBlack"
        android:textSize="30dp" />


    <Button
        android:id="@+id/buttonYes"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_alignParentBottom="true"
        android:layout_below="@id/message"
        android:layout_margin="8dp"
        android:onClick="onClickYes"
        android:text="Yes"
        android:textSize="26dp" />

    <Button
        android:id="@+id/buttonNo"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_below="@id/message"
        android:layout_margin="8dp"
        android:onClick="onClickNo"
        android:text="No"
        android:textSize="26dp" />


</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

这是我调用对话框的方式。

 final Dialog dialog = new Dialog(ReturnAreaActivity.this, android.R.style.Theme_Black_NoTitleBar_Fullscreen);
                                dialog.setContentView(R.layout.dialog_location);
                                dialog.setTitle("New Location Setup");
                                TextView message …
Run Code Online (Sandbox Code Playgroud)

java

2
推荐指数
1
解决办法
1094
查看次数

标签 统计

java ×1

sql-server ×1