{"id":460,"date":"2012-01-05T17:29:18","date_gmt":"2012-01-05T08:29:18","guid":{"rendered":"http:\/\/www.climb.co.jp\/blog_dbmoto\/?p=460"},"modified":"2015-06-03T11:30:38","modified_gmt":"2015-06-03T02:30:38","slug":"%e3%83%ac%e3%83%97%e3%83%aa%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%ae%e9%9a%9b%e3%81%abnull%e3%82%92%e7%89%b9%e5%ae%9a%e3%81%ae%e5%80%a4%e3%81%ab%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b-2","status":"publish","type":"post","link":"https:\/\/www.climb.co.jp\/blog_dbmoto\/archives\/460","title":{"rendered":"\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u969b\u306bnull\u3092\u7279\u5b9a\u306e\u5024\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5\u3000\u305d\u306e2\u3010\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30c4\u30fc\u30ebDBMoto\u3011"},"content":{"rendered":"<p><a href=\"\/\/www.climb.co.jp\/blog_dbmoto\/archives\/452\">\u4ee5\u524d\u306e\u306e\u30d6\u30ed\u30b0\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305f\u300c\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u969b\u306bnull\u3092\u7279\u5b9a\u306e\u5024\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5\u3000\u305d\u306e1\u300d<\/a>\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3054\u3068\u306b\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u305f\u3081\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6570\u304c\u591a\u3051\u308c\u3070\u591a\u3044\u307b\u3069\u8a2d\u5b9a\u306b\u6642\u9593\u3092\u8981\u3059\u308b\u3068\u3044\u3046\u30c7\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u7d39\u4ecb\u3059\u308b\u65b9\u6cd5\u306f\u3001\u540c\u3058\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u540c\u3058\u30c7\u30fc\u30bf\u30bf\u30a4\u30d7\u3067\u3042\u308c\u3070\u3001\u8a2d\u5b9a\u30921\u56de\u3067\u6e08\u307e\u3059\u3053\u3068\u304c\u53ef\u80fd\u3067\u3001\u8a2d\u5b9a\u306b\u8981\u3059\u308b\u6642\u9593\u306e\u77ed\u7e2e\u5316\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u25a0\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u6e96\u5099<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u6e96\u5099\u3057\u307e\u3059\u3002<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nImports System\r\nImports System.Data\r\nImports Microsoft.VisualBasic\r\nImports DBMotoPublic\r\nImports DBMotoScript\r\n\r\nNamespace DBRS\r\nPublic Class GlobalScript : Inherits IGlobalScript\r\n\r\nPublic Shared Function SetVAL(obj as Object, obj1 as Object) as Object\r\nIf obj is DBNull.Value Then\r\nReturn obj1\r\nEnd if\r\nIf obj is nothing Then\r\nReturn obj\r\nEnd if\r\nIf String.IsNullOrEmpty(obj.ToString()) = True\u00a0 Then\r\nReturn obj1\r\nElse\r\nReturn obj\r\nEnd If\r\nEnd Function\r\n\r\nEnd Class\r\n\r\nPublic Class MappingRule : Inherits IMappingRule\r\n\r\n&lt;MappingRuleAttribute(&quot;CheckString&quot;, &quot;Set function for NON nullable fields&quot;)&gt;\r\nPublic Function CheckString (ByVal bIsForth As Boolean, ByVal sSourceName As String, ByVal iSourceOrdinal As Integer, ByVal sSourceType As String, ByVal sTargetName As String, ByVal iTargetOrdinal As Integer, ByVal\u00a0\u00a0\u00a0\u00a0 sTargetType As String, ByRef sExpression As System.Text.StringBuilder) As Boolean\r\n\r\nIf sSourceName = sTargetName Then\r\nIf sSourceType = &quot;VARCHAR2&quot; Then\r\nsExpression.Append(&quot;SetVal(&#x5B;&quot; + sTargetName + &quot;],&quot; + &quot;&quot;&quot;NODATA&quot;&quot;&quot; + &quot;)&quot;)\r\nEnd If\r\nReturn True\r\nElse\r\nReturn False\r\nEnd if\r\n\r\nEnd Function\r\n\r\nEnd Class\r\n\r\nPublic Class GlobalEvents : Inherits IGlobalEvents\r\n\r\nEnd Class\r\nEnd Namespace\r\n<\/pre>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p><a href=\"\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010501.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-461\" title=\"2012010501\" src=\"\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010501-300x240.png\" alt=\"\" width=\"300\" height=\"240\" srcset=\"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010501-300x240.png 300w, https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010501.png 830w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u25a0\u30de\u30c3\u30d4\u30f3\u30b0\u753b\u9762\u3067\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u9069\u7528<\/p>\n<p>\u30de\u30c3\u30d4\u30f3\u30b0\u753b\u9762\u306b\u3066\u300cCustom Mapping\u300d\u304b\u3089\u300cCheckString\u300d\uff08\u30b0\u30ed\u30fc\u30d0\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u8a2d\u5b9a\u3057\u305f\u95a2\u6570\u540d\uff09\u3092\u9078\u629e\u3057\u307e\u3059\u3002<br \/>\n<a href=\"\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010502.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-462\" title=\"2012010502\" src=\"\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010502-300x201.png\" alt=\"\" width=\"300\" height=\"201\" srcset=\"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010502-300x201.png 300w, https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010502.png 620w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u4eca\u307e\u3067\u624b\u52d5\u3067\u300cMap to Expression\u300d\u3092\u8d77\u52d5\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u3082\u306e\u304c\u3001\u81ea\u52d5\u3067\u4e00\u62ec\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002<br \/>\n<a href=\"\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010503.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-463\" title=\"2012010503\" src=\"\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010503-300x203.png\" alt=\"\" width=\"300\" height=\"203\" srcset=\"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010503-300x203.png 300w, https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-content\/uploads\/2012\/01\/2012010503.png 616w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u25a0\u30c7\u30fc\u30bf\u30bf\u30a4\u30d7\u304c\u8907\u6570\u3042\u308b\u5834\u5408<\/p>\n<p>\u4eca\u307e\u3067\u306e\u8a2d\u5b9a\u3067\u306f1\u3064\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u5bfe\u3057\u30661\u3064\u306e\u30c7\u30fc\u30bf\u30bf\u30a4\u30d7\u306e\u307f\u306e\u5834\u5408\u306b\u3057\u304b\u9069\u7528\u3067\u304d\u307e\u305b\u3093\u3002\u8907\u6570\u306e\u30c7\u30fc\u30bf\u30bf\u30a4\u30d7\u306b\u5bfe\u3057\u3066\u8a2d\u5b9a\u3092\u884c\u3046\u5834\u5408\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3066If Else\u306b\u3088\u308b\u6761\u4ef6\u5206\u5c90\u306b\u3066\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nIf sSourceName = sTargetName Then\r\nIf sSourceType = &quot;VARCHAR2&quot; Then\r\nsExpression.Append(&quot;SetVal(&#x5B;&quot; + sTargetName + &quot;],&quot; +\r\n&quot;&quot;&quot;NODATA&quot;&quot;&quot; + &quot;)&quot;)\r\nElse If\u3000sSourceType = &quot;CHAR&quot; Then\r\nsExpression.Append(&quot;SetVal(&#x5B;&quot; + sTargetName + &quot;],&quot; +\r\n&quot;&quot;&quot;NODATA&quot;&quot;&quot; + &quot;)&quot;)\r\nElse If sSourceType = &quot;NUMBER&quot; Then\r\nsExpression.Append(&quot;SetVal(&#x5B;&quot; + sTargetName + &quot;],&quot; +\r\n&quot;&quot;&quot;NODATA&quot;&quot;&quot; + &quot;)&quot;)\r\nEnd If\r\nReturn True\r\nElse\r\nReturn False\r\nEnd if\r\n<\/pre>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u524d\u306e\u306e\u30d6\u30ed\u30b0\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305f\u300c\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u969b\u306bnull\u3092\u7279\u5b9a\u306e\u5024\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5\u3000\u305d\u306e1\u300d\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3054\u3068\u306b\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u305f\u3081\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6570\u304c\u591a\u3051\u308c\u3070\u591a\u3044\u307b\u3069\u8a2d\u5b9a\u306b\u6642\u9593\u3092\u8981\u3059\u308b\u3068\u3044\u3046\u30c7\u30e1\u30ea\u30c3\u30c8\u304c\u3042 &hellip; <a href=\"https:\/\/www.climb.co.jp\/blog_dbmoto\/archives\/460\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-460","post","type-post","status-publish","format-standard","hentry","category-syniti"],"_links":{"self":[{"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/posts\/460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/comments?post=460"}],"version-history":[{"count":6,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/posts\/460\/revisions"}],"predecessor-version":[{"id":2604,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/posts\/460\/revisions\/2604"}],"wp:attachment":[{"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/media?parent=460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/categories?post=460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.climb.co.jp\/blog_dbmoto\/wp-json\/wp\/v2\/tags?post=460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}