1.因为爱所以爱
2.请教同事或上网查
3.a.记的不是很完整,写了一部分;
b.Shl、Shr、Xor、Not 不太清楚
4.打开delphi就可以找到;
5.type
TAstr = array of array of array of string;
function ExampleArrayFunc(var AStr: TAstr;
TS: TStrings = nil): string;
var
I, J, N: Integer;
Count: Integer;
begin
Count := 0;
if TS <> nil then
TS.Clear;
for I := low(AStr) to High(AStr)do
for J := Low(AStr) to High(AStr)do
for N := Low(AStr[J]) to High(AStr[J])do
if TS <> nil then
begin
Inc(Count);
TS.Add('AStr[' + IntToStr(I) + '][' + IntToStr(J) + '][' + IntToStr(N) + '] = ' +
IntToStr(I) + ', ' + IntToStr(J) + ', ' + IntToStr(N))
end
else
Result := result + 'AStr[' + IntToStr(I) + '][' + IntToStr(J) + '][' + IntToStr(N) + '] = ' +
IntToStr(I) + ', ' + IntToStr(J) + ', ' + IntToStr(N) + #13;
TS.Add('&sup1;&sup2;&Ocirc;&Euml;&Euml;&atilde;&Aacute;&Euml;' + IntToStr(Count) + '&acute;&Icirc;')
end;
procedure TForm1.Button1Click(Sender: TObject);
var
AStr: TAstr;
begin
SetLength(AStr, 10, 10, 10);
ExampleArrayFunc(AStr, Memo1.Lines);
end;
6.
go
create table dbo.Prd_Item --(产品项目表)
(
Prd_ID int not null primary key, --Integer(整型) 主键
Prd_ItemName varchar(30) not null, --Varchar(字符型, 长度30)
Prd_ItemPrc float not null, --Float/Integer(12, 2)(浮点型)
Prd_Date dateTime null --Date(日期型)
)
go
create table dbo.Prd_Tab --(产品项目表)
(
Prd_ID int not null, --Integer(整型)
Prd_Itemid int not null, --Integer(整型)
Prd_ItemQTY float not null, --Float/Integer(12, 2)(浮点型)
Prd_ItemSum float null, --Float/Integer(12, 2)(浮点型)
Prd_Date dateTime null --Date(日期型)
foreign key (prd_id) references prd_item (prd_id)
)
ALTER TABLE PRD_TAB
ADD CONSTRAINT UK_ID_ITEMID
UNIQUE (PRD_ID, PRD_ITEMID)
create trigger trg_updatePrd_item
on prd_tab for update, insert as
begin
if @@rowcount <> 0
begin
declare
@Prd_prc float, @Prd_itemQty float, @prd_id int, @prd_itmeId int;
set @prd_id = (Select prd_id from inserted);
set @Prd_itemQty = (Select Prd_itemQty from inserted);
set @prd_itmeId = (Select prd_itemid from inserted);
set @Prd_prc = (select prd_itemprc from prd_item where prd_id = @prd_id);
if @prd_prc = null
set @prd_prc = 0;
if update(prd_itemqty)
update prd_tab set prd_itemsum = @prd_prc * @Prd_itemQty
where prd_id = @prd_id
and prd_itemid = @prd_itmeId;
end;
end;
QuickReport :
select
pi.prd_id,
pi.prd_itemname,
pi.prd_itemprc,
pq.prd_itemid,
pq.prd_itemqty,
pq.prd_itemsum,
pq.prd_date from
prd_item pi left join prd_tab pq on
(pi.prd_id = pq.prd_id)
order by pi.prd_id
7,8.随便讲
这是我的答案==========