我是 SAP HANA 的新手,并试图通过具有以下 url 的 web 浏览器公开 .xsjs 文件数据:
hostname:80<instance#>/workspace/session/a00/data/services/retrieveData.xsjs
但是,当我尝试访问它时出现以下错误:
此链接似乎已损坏 我们找不到您要访问的资源。它可能拼写错误或当前不可用
这些是我在项目资源管理器中创建的文件:
MYSCHEMA.hdbschema
schema_name="MYSCHEMA"
趋势数据.hdbtable
table.schemaName = "MYSCHEMA";
table.tableType = COLUMNSTORE;
table.description = "NewDataSet Order trendsData";
table.columns = [
{name= "C"; sqlType = NVARCHAR; nullable = true; length=10; },
{name= "D"; sqlType = VARCHAR; nullable = true; length=5; },
{name= "DU"; sqlType = NVARCHAR; nullable = true; length=20; },
{name= "SA"; sqlType = DECIMAL; nullable = true; length=30; },
{name= "I"; sqlType = DECIMAL; nullable = true; length=30; },
{name= "G"; sqlType = DECIMAL; nullable = true; length=30; },
{name= "G"; sqlType = DECIMAL; nullable = true; length=20; },
{name= "STR"; sqlType = DECIMAL; nullable = true; length=30; }
];
table.primaryKey.pkcolumns = ["INVENTORY"];
orderId.hdbsequence
schema="MYSCHEMA";
start_with=2000000;
cycles=false;
depends_on_table="workspace.session.a00.data::trendData";
检索数据.xsjs
$.response.contentType="text/html";
var output = "Helloworld";
var conn = $.db.getConnection();
var pstmt = conn.prepareStatement("select * from trendData");
var rs = pstmt.executeQuery();
if (!rs.next())
{
$.response.setBody( "Failed to retrieve data");
$.response.status = $.net.http.INTERNAL_SERVER_ERROR;
}
else
{
output=output + "This is the respose from my SQL: "
+ rs.getString(1);
}
rs.close();
pstmt.close();
conn.close();
$.response.setBody(output);
以上所有文件均已成功提交并激活,没有任何错误。尽管如此,错误仍然发生在网络浏览器中。