-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInsertOperation.cls
50 lines (45 loc) · 1.27 KB
/
InsertOperation.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Class Start.InsertOperation Extends Ens.BusinessOperation
{
Parameter INVOCATION = "Queue";
Method Insert(pRequest As Start.InsertRequest, Output pResponse As Ens.Response) As %Status
{
set st=$$$OK
#dim ex As %Exception.AbstractException
try {
// /* objectで更新する場合 */
/*
set obj=##class(Start.WeatherHistory).%New()
set obj.Product=pRequest.Product
set obj.Area=pRequest.WeatherInfo.Area
set obj.AreaDescription=pRequest.WeatherInfo.AreaDescription
set obj.AreaPuclicTime=pRequest.WeatherInfo.AreaPublicTime
set obj.KionMin=pRequest.WeatherInfo.KionMin
set obj.KionMax=pRequest.WeatherInfo.KionMax
$$$THROWONERROR(ex,obj.%Save())
*/
// /* SQLで更新する場合*/
set cols(2)=pRequest.WeatherInfo.Area
set cols(3)=pRequest.WeatherInfo.AreaDescription
set cols(4)=pRequest.WeatherInfo.AreaPublicTime
set cols(6)=pRequest.WeatherInfo.KionMax
set cols(7)=pRequest.WeatherInfo.KionMin
set cols(8)=pRequest.Product
&sql(insert into Start.WeatherHistory values :cols())
if SQLCODE<0 {
throw ##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE,%msg)
}
}
catch ex {
set st=ex.AsStatus()
}
Quit st
}
XData MessageMap
{
<MapItems>
<MapItem MessageType="Start.InsertRequest">
<Method>Insert</Method>
</MapItem>
</MapItems>
}
}