{"id":68,"date":"2019-07-16T15:57:29","date_gmt":"2019-07-16T15:57:29","guid":{"rendered":"https:\/\/snowflake.pavlik.us\/?p=68"},"modified":"2019-09-15T20:28:43","modified_gmt":"2019-09-15T20:28:43","slug":"creating-a-hello-world-stored-procedure-in-snowflake","status":"publish","type":"post","link":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/","title":{"rendered":"Creating a Hello World Stored Procedure in Snowflake"},"content":{"rendered":"\n<p>Snowflake makes creating stored procedures easy. Make sure that you have the database in context where you want to create the stored procedure. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"720\" src=\"https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1-1024x720.jpg\" alt=\"\" class=\"wp-image-70\" srcset=\"https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1-1024x720.jpg 1024w, https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1-300x211.jpg 300w, https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1-768x540.jpg 768w, https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1-624x439.jpg 624w, https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1.jpg 1032w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\n--Create a hello world Snowflake Stored Procedure.\ncreate or replace procedure MyProcedure()\n--Optionally return a value, only one.\nreturns VARCHAR\nlanguage JavaScript\nas\n  -- The &quot;$$&quot; indicates the beginning and end of the JavaScript code\n  -- in the stored procedure\n  $$  \n  \n  \/\/ Since we&#039;re in Javascript now, use Javascript comment markers.\n  return &quot;Hello world.&quot;\n  \n  $$;\n  \n<\/pre><\/div>\n\n\n<p>Now, let&#8217;s run the stored procedure.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n  --Call the stored procedure.\n  call MyProcedure();\n<\/pre><\/div>\n\n\n<p>The output will look like this:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"990\" height=\"452\" src=\"https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Results_of_Hello_World_SP.jpg\" alt=\"\" class=\"wp-image-71\" srcset=\"https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Results_of_Hello_World_SP.jpg 990w, https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Results_of_Hello_World_SP-300x137.jpg 300w, https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Results_of_Hello_World_SP-768x351.jpg 768w, https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Results_of_Hello_World_SP-624x285.jpg 624w\" sizes=\"auto, (max-width: 990px) 100vw, 990px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Snowflake makes creating stored procedures easy. Make sure that you have the database in context where you want to create the stored procedure. Now, let&#8217;s run the stored procedure. The output will look like this:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-68","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\r\n<title>Creating a Hello World Stored Procedure in Snowflake - Snowflake in the Carolinas<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"Creating a Hello World Stored Procedure in Snowflake - Snowflake in the Carolinas\" \/>\r\n<meta property=\"og:description\" content=\"Snowflake makes creating stored procedures easy. Make sure that you have the database in context where you want to create the stored procedure. Now, let&#8217;s run the stored procedure. The output will look like this:\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/\" \/>\r\n<meta property=\"og:site_name\" content=\"Snowflake in the Carolinas\" \/>\r\n<meta property=\"article:published_time\" content=\"2019-07-16T15:57:29+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2019-09-15T20:28:43+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1.jpg\" \/>\r\n\t<meta property=\"og:image:width\" content=\"1032\" \/>\r\n\t<meta property=\"og:image:height\" content=\"726\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\r\n<meta name=\"author\" content=\"Greg Pavlik\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Greg Pavlik\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/\"},\"author\":{\"name\":\"Greg Pavlik\",\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/#\\\/schema\\\/person\\\/019455f4675665b6cf5edea31ec44d7b\"},\"headline\":\"Creating a Hello World Stored Procedure in Snowflake\",\"datePublished\":\"2019-07-16T15:57:29+00:00\",\"dateModified\":\"2019-09-15T20:28:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/\"},\"wordCount\":44,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/snowflake.pavlik.us\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/Set_DB_Context-1-1024x720.jpg\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/\",\"url\":\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/\",\"name\":\"Creating a Hello World Stored Procedure in Snowflake - Snowflake in the Carolinas\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/snowflake.pavlik.us\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/Set_DB_Context-1-1024x720.jpg\",\"datePublished\":\"2019-07-16T15:57:29+00:00\",\"dateModified\":\"2019-09-15T20:28:43+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/#\\\/schema\\\/person\\\/019455f4675665b6cf5edea31ec44d7b\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/#primaryimage\",\"url\":\"https:\\\/\\\/snowflake.pavlik.us\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/Set_DB_Context-1.jpg\",\"contentUrl\":\"https:\\\/\\\/snowflake.pavlik.us\\\/wp-content\\\/uploads\\\/2019\\\/07\\\/Set_DB_Context-1.jpg\",\"width\":1032,\"height\":726},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/index.php\\\/2019\\\/07\\\/16\\\/creating-a-hello-world-stored-procedure-in-snowflake\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/snowflake.pavlik.us\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating a Hello World Stored Procedure in Snowflake\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/#website\",\"url\":\"https:\\\/\\\/snowflake.pavlik.us\\\/\",\"name\":\"Snowflake in the Carolinas\",\"description\":\"Random thoughts on all things Snowflake in the Carolinas\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/snowflake.pavlik.us\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/snowflake.pavlik.us\\\/#\\\/schema\\\/person\\\/019455f4675665b6cf5edea31ec44d7b\",\"name\":\"Greg Pavlik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d81df729eebf37a042922b17d4a4c834b1e0ccfa9fea1c2c78cb8e95c7e91701?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d81df729eebf37a042922b17d4a4c834b1e0ccfa9fea1c2c78cb8e95c7e91701?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d81df729eebf37a042922b17d4a4c834b1e0ccfa9fea1c2c78cb8e95c7e91701?s=96&d=mm&r=g\",\"caption\":\"Greg Pavlik\"},\"description\":\"Greg is a Senior Sales Engineer at Snowflake Computing, in the Raleigh-Durham area. He's been in data management and security for the twenty years.\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating a Hello World Stored Procedure in Snowflake - Snowflake in the Carolinas","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/","og_locale":"en_US","og_type":"article","og_title":"Creating a Hello World Stored Procedure in Snowflake - Snowflake in the Carolinas","og_description":"Snowflake makes creating stored procedures easy. Make sure that you have the database in context where you want to create the stored procedure. Now, let&#8217;s run the stored procedure. The output will look like this:","og_url":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/","og_site_name":"Snowflake in the Carolinas","article_published_time":"2019-07-16T15:57:29+00:00","article_modified_time":"2019-09-15T20:28:43+00:00","og_image":[{"width":1032,"height":726,"url":"https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1.jpg","type":"image\/jpeg"}],"author":"Greg Pavlik","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Greg Pavlik"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/#article","isPartOf":{"@id":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/"},"author":{"name":"Greg Pavlik","@id":"https:\/\/snowflake.pavlik.us\/#\/schema\/person\/019455f4675665b6cf5edea31ec44d7b"},"headline":"Creating a Hello World Stored Procedure in Snowflake","datePublished":"2019-07-16T15:57:29+00:00","dateModified":"2019-09-15T20:28:43+00:00","mainEntityOfPage":{"@id":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/"},"wordCount":44,"commentCount":0,"image":{"@id":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/#primaryimage"},"thumbnailUrl":"https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1-1024x720.jpg","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/","url":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/","name":"Creating a Hello World Stored Procedure in Snowflake - Snowflake in the Carolinas","isPartOf":{"@id":"https:\/\/snowflake.pavlik.us\/#website"},"primaryImageOfPage":{"@id":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/#primaryimage"},"image":{"@id":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/#primaryimage"},"thumbnailUrl":"https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1-1024x720.jpg","datePublished":"2019-07-16T15:57:29+00:00","dateModified":"2019-09-15T20:28:43+00:00","author":{"@id":"https:\/\/snowflake.pavlik.us\/#\/schema\/person\/019455f4675665b6cf5edea31ec44d7b"},"breadcrumb":{"@id":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/#primaryimage","url":"https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1.jpg","contentUrl":"https:\/\/snowflake.pavlik.us\/wp-content\/uploads\/2019\/07\/Set_DB_Context-1.jpg","width":1032,"height":726},{"@type":"BreadcrumbList","@id":"https:\/\/snowflake.pavlik.us\/index.php\/2019\/07\/16\/creating-a-hello-world-stored-procedure-in-snowflake\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/snowflake.pavlik.us\/"},{"@type":"ListItem","position":2,"name":"Creating a Hello World Stored Procedure in Snowflake"}]},{"@type":"WebSite","@id":"https:\/\/snowflake.pavlik.us\/#website","url":"https:\/\/snowflake.pavlik.us\/","name":"Snowflake in the Carolinas","description":"Random thoughts on all things Snowflake in the Carolinas","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/snowflake.pavlik.us\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/snowflake.pavlik.us\/#\/schema\/person\/019455f4675665b6cf5edea31ec44d7b","name":"Greg Pavlik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d81df729eebf37a042922b17d4a4c834b1e0ccfa9fea1c2c78cb8e95c7e91701?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d81df729eebf37a042922b17d4a4c834b1e0ccfa9fea1c2c78cb8e95c7e91701?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d81df729eebf37a042922b17d4a4c834b1e0ccfa9fea1c2c78cb8e95c7e91701?s=96&d=mm&r=g","caption":"Greg Pavlik"},"description":"Greg is a Senior Sales Engineer at Snowflake Computing, in the Raleigh-Durham area. He's been in data management and security for the twenty years."}]}},"_links":{"self":[{"href":"https:\/\/snowflake.pavlik.us\/index.php\/wp-json\/wp\/v2\/posts\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/snowflake.pavlik.us\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/snowflake.pavlik.us\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/snowflake.pavlik.us\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/snowflake.pavlik.us\/index.php\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":3,"href":"https:\/\/snowflake.pavlik.us\/index.php\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":160,"href":"https:\/\/snowflake.pavlik.us\/index.php\/wp-json\/wp\/v2\/posts\/68\/revisions\/160"}],"wp:attachment":[{"href":"https:\/\/snowflake.pavlik.us\/index.php\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/snowflake.pavlik.us\/index.php\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/snowflake.pavlik.us\/index.php\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}