在Teradata中同时运行多个SQL查询 [英] running multiple SQL queries at the same time in Teradata

查看:270
本文介绍了在Teradata中同时运行多个SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在Teradata SQL Assistant中创建了6个不同的SQL查询。为了完成我的项目,我需要运行其中的6个以获得我想要的最终报告。

可以告诉我如何将这6个查询放在简单的SQL语句中来执行他们一次而不是一个一个地跑。



谢谢,

Hi,
I created 6 different SQL queries in Teradata SQL Assistant. In order to complete my project, I need to run 6 of them to get the final report that I want.
Could any body please show me how to put those 6 queries together into simple SQL statements to execute them at one time instead of run one by one.

Thank you,

推荐答案

没有诸如一次性之类的事情。您可以谈论并行,但是,正如您自己解释的那样,您的查询相互依赖(这应该意味着一个语句取决于另一个语句的结果),它们应该按顺序执行。 />


就是这样。



-SA
There is no such thing as "one time" in nature. You can talk about parallelism, but, as you explained yourself that your queries depends on each other (that should mean that one statement depends on the result of another one), they should be executed sequentially.

That's it.

—SA


您好

查看此链接希望这有助于您在Teradata中创建SP



http://readvitamin.com/2007/08/20/how-to-create-a-存储过程在teradata / [ ^ ]



Hi
Check this link hope this will help you to create SP in Teradata

http://readvitamin.com/2007/08/20/how-to-create-a-stored-procedure-in-teradata/[^]

Example:
CREATE PROCEDURE MyFirstProc (IN emp_number INTEGER,
                                             IN dept_number INTEGER,
                                             OUT dept_name CHAR(10),
                                             INOUT errstr VARCHAR(30))
BEGIN
        INSERT INTO Employee (EmpNo, DeptNo )
        VALUES (emp_number, dept_number);
        SELECT DeptName INTO dept_name FROM Department
        WHERE DeptNo = dept_number;
END;
To execute/call the above Stored Procedure:
CALL MyFirstProc (495, 211);


这篇关于在Teradata中同时运行多个SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆