Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 在STATISTICA查询节点中从双精度转换为字符串_Sql_Oracle_Casting - Fatal编程技术网

Sql 在STATISTICA查询节点中从双精度转换为字符串

Sql 在STATISTICA查询节点中从双精度转换为字符串,sql,oracle,casting,Sql,Oracle,Casting,编辑:我们已经决定,这可能是一个bug,而不是语法问题。现在我通过在连接到查询节点的数据转换节点中使用ToString(x)解决了这个问题 我需要将STATISTICA查询节点中的变量从double转换为string(或者,如果某个文本数据类型失败),您可以在工作区中使用该节点来查询其他工作区节点。 很明显,这是Oracle SQL,但我在网上发现/猜测的任何东西都不起作用: char(x), string(x), text(x), cast(x as char), cast(x as

编辑:我们已经决定,这可能是一个bug,而不是语法问题。现在我通过在连接到查询节点的数据转换节点中使用ToString(x)解决了这个问题

我需要将STATISTICA查询节点中的变量从double转换为string(或者,如果某个文本数据类型失败),您可以在工作区中使用该节点来查询其他工作区节点。 很明显,这是Oracle SQL,但我在网上发现/猜测的任何东西都不起作用:

char(x),

string(x),

text(x),

cast(x as char),

cast(x as string),

cast(x as text),

to_char(x),

to_string(x),

to_text(x),
以下是原始SQL(已编辑的b/c安全性):

在这里,我尝试对批号变量使用上面的一个:

SELECT tbl1.var,cast(tbl2.Lot_Number_1 as string),tbl3.var2,tbl4.Lot_Number_2,tbl5.var2,tbl6.Lot_No_3,tbl7.var2,tbl8.Lot_No_4,tbl9.var2,tbl10.Lot_Number_5,tbl11.var2,tbl12.Lot_Number_6,tbl13.Lot_Number_7,tbl14.var2
FROM [All the tables; inner joins--is working fine]
这是我收到的错误消息:

"Error with node '[Node name]':Parse error

Expected tokens: < COMMA > , < FROM >

Last token: '('(L), 'to_string'(P)

Last node: 'ColumnName: TableName.{Identifier or *}'

-------Parse trace-------

SELECT

IDENTIFIER -> TableName

DOT > IDENTIFIER

IDENTIFIER -> Identifier

Identifier -> Identifier_QuotesAllowed

Identifier_QuotesAllowed -> Identifier_QuotesAllowedOrStar

TableName DOT Identifier_QuotesAllowedOrStar -> ColName

ColName -> ValueOrColName

ValueOrColName -> SelectExpressio"
“节点“[node name]”错误:分析错误
应为标记:<逗号>,
最后一个标记:'('(L),'to_string'(P)
最后一个节点:'ColumnName:TableName.{Identifier or*}'
-------解析跟踪-------
选择
标识符->表名
点>标识符
标识符->标识符
标识符->标识符“允许
标识符“允许->标识符”允许或禁用
TableName点标识符“U QuotesAllowedOrStar->ColName
ColName->ValueOrColName
值或名称->选择表达式“
(SelectExpressio不是打字错误)


谢谢!

你能添加SQL语句吗?你可以使用
CAST()
或者你可以使用
TO_CHAR()
@DavidFaber我已经尝试了这两种方法——它们不起作用的事实是否表明我出了问题?@Koen添加了SQL;谢谢你的建议
CAST(tbl2.Lot\u Number\u 1作为字符串)
-您应该使用
CAST(tbl2.lot\u编号\u 1作为VARCHAR2)
"Error with node '[Node name]':Parse error

Expected tokens: < COMMA > , < FROM >

Last token: '('(L), 'to_string'(P)

Last node: 'ColumnName: TableName.{Identifier or *}'

-------Parse trace-------

SELECT

IDENTIFIER -> TableName

DOT > IDENTIFIER

IDENTIFIER -> Identifier

Identifier -> Identifier_QuotesAllowed

Identifier_QuotesAllowed -> Identifier_QuotesAllowedOrStar

TableName DOT Identifier_QuotesAllowedOrStar -> ColName

ColName -> ValueOrColName

ValueOrColName -> SelectExpressio"