gpt4 book ai didi

mysql - 如何在iReport中获取存储过程的结果?

转载 作者:行者123 更新时间:2023-11-29 14:04:40 24 4
gpt4 key购买 nike

我使用的是 Ubuntu 12.04,iReport-4.7,MySQL,mysql-jdbc 驱动程序

我在MySQL中编写存储过程

DELIMITER //
CREATE PROCEDURE first()
BEGIN
select * from person where id in (11,22,33);
END //
DELIMITER;

返回 idname 作为字段&从 iReport 调用它

select id+1,name from (call first)

给我语法错误,

Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call first)' at line 1

但是当我在查询执行器中运行先调用时,没有错误

我应该如何获得进一步计算所需的字段?这在 MS-SQL 中可能吗?

最佳答案

这是不可能的。

您可能会考虑使用临时表。

请查看此帖子:MySql: Can a stored procedure/function return a table?

问候

关于mysql - 如何在iReport中获取存储过程的结果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14558109/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com