从shell中的存储过程卸载数据

从shell中的存储过程卸载数据,shell,informix,Shell,Informix,我试图在shell中从informix中的存储过程卸载数据,但在执行shell脚本时出现错误 我的Shell文件 FILE="customer_report" PATH="/home/usrrep/DIR_1/DIR_2/" EXT=".txt" dbaccess dataBase <<eof unload to $PATH$FILE$1$EXT delimiter ',' execute procedure database:customerReports(); eof

我试图在shell中从informix中的存储过程卸载数据,但在执行shell脚本时出现错误

我的Shell文件

FILE="customer_report" 
PATH="/home/usrrep/DIR_1/DIR_2/" 
EXT=".txt"


dbaccess dataBase <<eof

unload to $PATH$FILE$1$EXT delimiter ','
execute procedure database:customerReports();
eof

echo Serial Number,Name,Office,Status,Product,Date,Phone1,Phone2,Email,Final Reult> $PATH$FILE$1.csv
cat $PATH$FILE$1$EXT >> $PATH$FILE$1.csv
exit 0
错误很明显,但我不知道发生了什么


提前感谢

卸载到。。。执行过程。。。似乎不存在,除非没有记录。 一种可能是在customerReports()中使用


在shell脚本中。

卸载到。。。执行过程。。。似乎不存在,除非没有记录。 一种可能是在customerReports()中使用


在shell脚本中。

您可以尝试使用from table()。有点像这样:

> create procedure p2(c1 int) returning int,char(10)
 return 1,'aaa' with resume;
 return 2,'bbb' with resume;
 end procedure;

Routine created.

> execute procedure p2(1);


(expression) (expression)

           1 aaa
           2 bbb

2 row(s) retrieved.

> unload to x.unl select * from table(p2(1));

2 row(s) unloaded.

> !cat x.unl
1|aaa|
2|bbb|
>

您可以尝试使用from table()。有点像这样:

> create procedure p2(c1 int) returning int,char(10)
 return 1,'aaa' with resume;
 return 2,'bbb' with resume;
 end procedure;

Routine created.

> execute procedure p2(1);


(expression) (expression)

           1 aaa
           2 bbb

2 row(s) retrieved.

> unload to x.unl select * from table(p2(1));

2 row(s) unloaded.

> !cat x.unl
1|aaa|
2|bbb|
>

$1中有什么?使用
sh-x
(或您选择的替代shell)运行shell脚本时,您会看到什么?DB Access脚本(UNLOAD语句)在shell脚本之外工作正常吗?在
$1
中有什么?使用
sh-x
(或您选择的替代shell)运行shell脚本时,您会看到什么?DB Access脚本(UNLOAD语句)在shell脚本之外工作正常吗?
unload to ... select * from mytemptable 
> create procedure p2(c1 int) returning int,char(10)
 return 1,'aaa' with resume;
 return 2,'bbb' with resume;
 end procedure;

Routine created.

> execute procedure p2(1);


(expression) (expression)

           1 aaa
           2 bbb

2 row(s) retrieved.

> unload to x.unl select * from table(p2(1));

2 row(s) unloaded.

> !cat x.unl
1|aaa|
2|bbb|
>