使用命令行访问hdbsql:

# hdbsql -u SYSTEM -d SYSTEMDB -i 90

输入SYSTEM用户的密码。

在默认的HXE database tenant上启用document store:

ALTER DATABASE HXE ADD 'docstore';

使用下面的命令行创建一个document store collection:

CREATE COLLECTION food_collection;

注:hqlsql主要是用于Administration类型的工作使用,开发过程中最好还是用sqlpad等工具连接SAP HANA express.

往该document store里插入数据:

INSERT INTO food_collection VALUES('{ "name" : "Kiwi", "group" : "Fruits", "subgroup" : "Tropical fruits", "nutrients" : { "Carbohydrate" : 20945.0, "Energy" : 176.0, "Fat" : 1955.0, "Fiber" : 1925.0, "Proteins" : 1421.3 }, "description" : "The kiwifruit, often shortened to kiwi in many parts of the world, is the edible berry of a woody vine in the genus Actinidia. The most common cultivar group of kiwifruit (''Hayward'') is oval, about the size of a large hen''s egg (5?8 centimetres in length and 4.5?5.5 centimetres in diameter). It has a fibrous, dull greenish-brown skin and bright green or golden flesh with rows of tiny, black, edible seeds. The fruit has a soft texture and a sweet but unique flavor, and today is a commercial crop in several countries, such as Italy, New Zealand, Chile, Greece and France." }');

INSERT INTO food_collection VALUES('{ "name" : "Onion", "group" : "Vegetables", "subgroup" : "Onion-family vegetables", "nutrients" : { "Carbohydrate" : 18057.407, "Energy" : 345.333, "Fat" : 0.0, "Fiber" : 2296.154, "Proteins" : 2150.741 }, "description" : "Allium haematochiton is a species of wild onion known by the common name redskin onion. It is native to northern Baja California and southern California. It it grows on the slopes of the coastal hills and mountains, such as those of the Peninsular Ranges, Transverse Ranges, and southern California Coast Ranges." }');

INSERT INTO food_collection VALUES('{ "name" : "Garlic", "group" : "Herbs and Spices", "subgroup" : "Herbs", "nutrients" : { "Carbohydrate" : 50898.333, "Energy" : 770.333, "Fat" : 0.0, "Fiber" : 3850.000, "Proteins" : 8301.667 }, "description" : "With a history of human use of over 7,000 years, garlic (Allium sativum) is native to central Asia, and has long been a staple in the Mediterranean region, as well as a frequent seasoning in Asia, Africa, and Europe. There are two sub-varieties of allium sativum: Allium sativum var. sativum (soft-necked garlic) and Allium sativum var. ophioscorodon (hard-necked garlic). Soft-necked garlic is the most commonly found. Bulb garlic is available in many forms, including fresh, frozen, dried, fermented (black garlic) and shelf stable products (in tubes or jars)." }');

INSERT INTO food_collection VALUES('{ "name" : "Cashew nut", "group" : "Nuts", "subgroup" : "Nuts", "nutrients" : { "Carbohydrate" : 33540.993, "Energy" : 1622.625, "Fat" : 15466.667, "Fiber" : 2381.818, "Proteins" : 13402.857 }, "description" : "The cashew, or caju, is a small tree native to Brazil. Cashew nuts are the seeds of the cashew apple, and are found in the grey bump at the end of the fruit. The cashew apple itself is sweet, soft and juicy.Cashews are usually sold roasted and salted and eaten as a snack." }');

INSERT INTO food_collection VALUES('{ "name" : "Pineapple", "group" : "Fruits", "subgroup" : "Tropical fruits", "nutrients" : { "Carbohydrate" : 17650.476, "Energy" : 179.613, "Fat" : 2188.600, "Fiber" : 705.263, "Proteins" : 542.857 }, "description" : "The Pineapple (Ananas comosus), named for its resemblance to the pine cone, is a tropical plant with edible multiple fruit consisting of coalesced berries, and the most economically significant plant in the Bromeliaceae family. Pineapples may be cultivated from a crown cutting of the fruit, possibly flowering in 20–24 months and fruiting in the following six months. Pineapple does not ripen significantly post-harvest. Pineapples are consumed fresh, cooked, juiced, and preserved, and are found in a wide array of cuisines. In addition to consumption, in the Philippines the pineapple''s leaves are used to produce the textile fiber piña- employed as a component of wall paper and furnishings, amongst other uses." }');

INSERT INTO food_collection VALUES('{ "name" : "Peanut", "group" : "Nuts", "subgroup" : "Nuts", "nutrients" : { "Carbohydrate" : 19706.341, "Energy" : 1571.563, "Fat" : 14543.900, "Fiber" : 6891.892, "Proteins" : 22098.293 }, "description" : "The peanut, also known as the groundnut and the goober and taxonomically classified as Arachis hypogaea, is a legume crop grown mainly for its edible seeds. It is widely grown in the tropics and subtropics, being important to both small and large commercial producers. It is classified as both a grain legume and, because of its high oil content, an oil crop. World annual production of shelled peanuts was 42 million tonnes in 2014. Atypically among crop plants, peanut pods develop underground rather than aboveground. It is this characteristic that the botanist Linnaeus used to assign the specific name hypogaea, which means ''under the earth''." }');

INSERT INTO food_collection VALUES('{ "name" : "Horseradish", "group" : "Herbs and Spices", "subgroup" : "Spices", "nutrients" : { "Carbohydrate" : 22922.500, "Energy" : 229.000, "Fat" : 700.000, "Fiber" : 3600.000, "Proteins" : 4557.500 }, "description" : "Horseradish (Armoracia rusticana, syn. Cochlearia armoracia) is a perennial plant of the Brassicaceae family (which also includes mustard, wasabi, broccoli, and cabbage). The plant is probably native to southeastern Europe and western Asia. It is now popular around the world. It grows up to 1.5 metres (5 feet) tall, and is cultivated primarily for its large, white, tapered root. The intact horseradish root has hardly any aroma. When cut or grated, however, enzymes from the now-broken plant cells break down sinigrin to produce allyl isothiocyanate, which irritates the mucous membranes of the sinuses and eyes. Once exposed to air (via grating) or heat, if not used immediately or mixed in vinegar, the grated mash darkens, loses its pungency, and becomes unpleasantly bitter-tasting." }');

INSERT INTO food_collection VALUES('{ "name" : "Asparagus", "group" : "Vegetables", "subgroup" : "Shoot vegetables", "nutrients" : { "Carbohydrate" : 4725.000, "Energy" : 58.364, "Fat" : 2150.000, "Fiber" : 1276.471, "Proteins" : 2872.889 }, "description" : "Asparagus officinalis is a spring vegetable, a flowering perennial plant species in the genus Asparagus. It was once classified in the lily family, like its Allium cousins, onions and garlic, but the Liliaceae have been split and the onion-like plants are now in the family Amaryllidaceae and asparagus in the Asparagaceae. Asparagus officinalis is native to most of Europe, northern Africa and western Asia, and is widely cultivated as a vegetable crop." }');

INSERT INTO food_collection VALUES('{ "name" : "Brazil nut", "group" : "Nuts", "subgroup" : "Nuts", "nutrients" : { "Carbohydrate" : 11897.863, "Energy" : 2082.000, "Fat" : 67459.500, "Fiber" : 4266.667, "Proteins" : 11679.000 }, "description" : "The Brazil nut (Bertholletia excelsa) is a South American tree in the family Lecythidaceae, and also the name of the tree''s commercially harvested edible seed." }');

INSERT INTO food_collection VALUES('{ "name" : "Common beet", "group" : "Vegetables", "subgroup" : "Leaf vegetables", "nutrients" : { "Carbohydrate" : 9100.909, "Energy" : 102.500, "Fat" : 0.0, "Fiber" : 2327.273, "Proteins" : 1490.000 }, "description" : "The beet (Beta vulgaris) is a plant in the Chenopodiaceae family which is now included in Amaranthaceae family. It is best known in its numerous cultivated varieties, the most well known of which is the root vegetable known as the beetroot or garden beet. However, other cultivated varieties include the leaf vegetable chard, as well as the root vegetable sugar beet, which is important in the production of table sugar, and mangelwurzel, which is a fodder crop. Three subspecies are typically recognised. All cultivated varieties fall into the subspecies Beta vulgaris subsp. vulgaris, while Beta vulgaris subsp. maritima, commonly known as the sea beet, is the wild ancestor of these, and is found throughout the Mediterranean, the Atlantic coast of Europe, the Near East, and India. A second wild subspecies, Beta vulgaris subsp. adanensis, occurs from Greece to Syria. The roots are most commonly deep red-purple in color, but come in a wide variety of other shades, including golden yellow and red-and-white striped. Beta vulgaris is a herbaceous biennial or, rarely, perennial plant with leafy stems growing to 1–2 m tall. The leaves are heart-shaped, 5–20 cm long on wild plants (often much larger in cultivated plants). The flowers are produced in dense spikes; each flower is very small, 3–5 mm diameter, green or tinged reddish, with five petals; they are wind pollinated. The fruit is a cluster of hard nutlets." }');

上述插入的数据可以用SELECT 查询出来:

SELECT "name", "group", "subgroup", "nutrients", "description" FROM food_collection;

指定where条件以获得更小的数据集:

SELECT "name", "group", "subgroup", "nutrients", "description" FROM food_collection WHERE "group" = 'Vegetables';

hana数据库导入mysql_在SAP HANA Express Edition里创建数据库表相关推荐

  1. 在SAP HANA Express Edition里创建数据库表

    使用命令行访问hdbsql: hdbsql -u SYSTEM -d SYSTEMDB -i 90 输入SYSTEM用户的密码. 在默认的HXE database tenant上启用document ...

  2. hana数据库导入mysql_【SAP HANA】新建表以及操作数据(3)

    账号和数据库都创建好之后,接下来就可以创建表了.来见识一下这个所谓"列式"存储方式的表是长啥样的! 一.可视化新建表 然后输入所需栏位,设置好类型和长度: 上图右上角可以看到类型是 ...

  3. hana数据库导入到oracle,SAP HANA SLT 将Oracle表 数据同步到HANA数据库

    简单介绍SLT 同步数据的整个配置过程: 在SLT系统中创建与Oracle的链接 在HANA监控平台上,创建Configuration 创建表的同步作业 --------------BEGIN---- ...

  4. 在SAP HANA Express Edition里进行文本分析

    这个练习会使用SAP HANA Express Edition的文本语义分析引擎对JSON格式的documents进行语义分析. 首先创建一个column table,对其index开启fuzzy t ...

  5. 使用PHP应用查询SAP HANA Express Edition里的数据

    前提:64位的PHP runtime和64位的Apache Web server已经安装完毕. 我们需要使用SAP HANA ODBC database drivers将PHP runtime和SAP ...

  6. 【SAP Hana】X档案:SAP HANA SQL 进阶教程

    SAP HANA SQL 进阶教程 5.HANA SQL 进阶教程 (1)Databases (2)User & Role (3)Schemas (4)Tables (5)Table Inde ...

  7. 使用nodejs应用查询SAP HANA Express Edition里的数据

    其实我们使用的是SAP针对SAP HANA Express Editor发布的nodejs SDK. npm init创建一个新的nodejs应用: 执行下列命令行,从SAP的nodejs regis ...

  8. 【SAP Hana】X档案:SAP HANA 数据库基础知识

    SAP HANA 数据库基础知识 1.基本规则 (1)注释 (2)标识符 (3)引号 (4)保留字 2.数据类型 (1)日期时间类型 (2)数字类型 (3)字符串类型 (4)二进制类型 (5)大对象类 ...

  9. [Step By Step]使用SLT工具从SAP导入数据到SAP HANA

    在配置完备的情况下,SLT工具的Replicate 工作是在SAP HANA Data Provisioning中完成的 1. Log on to the SAP HANA Studio 2. Cal ...

  10. 【SAP Hana】X档案:SAP HANA SQL 基础教程

    SAP HANA SQL 基础教程 1.SQL 标准简介 2.HANA STUDIO 的安装 3.HANA STUDIO 的设置 4.HANA SQL 基础教程 (1)查看表数据 (2)查看表结构 ( ...

最新文章

  1. mysql双机热备 读写分离_MySQL——主从复制与读写分离
  2. 从原理上搞懂如何设置线程池参数大小?
  3. Android5.0源码分析—— Zygote进程分析
  4. 《线程管理:线程基本操作》
  5. js声明php变量,vue.js怎样声明变量
  6. Hibernate(7)关联关系_单向1对n
  7. 原根(扩展欧几里得+欧拉函数)
  8. Javascript+css 实现网页换肤功能
  9. 获取p12证书详情,返回证书详情实体
  10. Python安装pygame教程
  11. Cadence Allegro PCB设计88问解析(十二) 之 Allegro中两种单位显示设置
  12. 谷歌浏览器实现按下按键的脚本_谷歌浏览器快捷键设置方法详解
  13. 行人重识别论文阅读7-基于图卷积的行人骨架识别
  14. linux 下的字体引擎(xtt freetype xfs xft)
  15. 二分+秦九韶算法 求凸点
  16. Unity笔记-29-ARPG游戏项目-03-攀爬系统
  17. 终生学习者,永远劳苦命!
  18. 编译安装php8,[PHP] 最新抢先编译安装PHP8.0.0 alph1以及FPM
  19. 离散数学笔记_第一章:逻辑和证明(1)
  20. 5G/NR 5G核心网(5GC)之网络功能服务通信

热门文章

  1. 暮光之城破晓 - 看看会发生什么
  2. 计算机是好是坏英语作文,电脑游戏是好还是坏英语作文
  3. css本文在背景之上,css实现文字在背景图片之上
  4. 【FinE】资本市场理论(1) CAPM模型
  5. table总结insertRow、deleteRow
  6. 闯关H5小游戏制作推荐,教你快速上手TOM闯关游戏H5
  7. 结构光三维重建(二)线结构光三维重建
  8. 服务器修改密码次数过多提示被锁定,路由器密码错误次数过多锁死了怎么办?...
  9. 近期一些我寨采用的新芯片资料汇总(更新Rk3066)
  10. Google ProtoBuf简介