SQL加载器控制文件

发布于 2024-11-19 15:19:15 字数 551 浏览 5 评论 0原文

我有这个加载程序控制文件。

LOAD DATA
REPLACE
INTO TABLE TEST
WHEN TEST_CD != 'A' AND TEST_CD = 'B' AND TEST_TYPE_CD = 15

目前,当 TEST_CD = 'B' 和 TEST_TYPE_CD = 15 时加载数据,但现在我想修改它,以便当 TEST_CD = 'B' 以及 test_type_cd = 15 时..我不想在 15 时加载所有 Test_type_cd ..我只想在满足这两个条件时才加载..只需将大括号放在它周围就可以了..请有人让我知道我该如何做修改这个..

我想每个人都对我需要的感到困惑..我希望满足第一个条件以及第二个和第三个条件作为第一个条件不要单独行动..例如,如果 test_cd 不等于 A 则加载数据但第二个和第三个条件应该作为一个整体..当 test_cd = B 且 test_type_cd 为 15 时加载数据..我不希望 test_type_cd 申请除B.. 我有 5 个 test_cd ABCD E.. 我只想 B 申请 test_type_cd = 15..

I have this loader control file.

LOAD DATA
REPLACE
INTO TABLE TEST
WHEN TEST_CD != 'A' AND TEST_CD = 'B' AND TEST_TYPE_CD = 15

Currently its loading data when TEST_CD = 'B' AND TEST_TYPE_CD = 15 but now I want to modify it so that when TEST_CD = 'B' as well as test_type_cd = 15 too.. I dont want to load all Test_type_cd when its 15.. i want to load only when it satisfies both condition.. Just keeping the braces around it is going to work.. Plz some one let me know how can I modify this..

I am thinking everyone is confused with what I need.. I want first condition to satisfy as well as 2nd and 3rd condition as 1 condition not to act seperately.. For example if test_cd is not equal A than load the data but 2nd and 3rd condition should act as one piece..when test_cd = B and test_type_cd is 15 than load the data.. i dont want test_type_cd to apply for any other test_cd other than B.. I have 5 of those test_cd A B C D E.. i want only B to apply test_type_cd = 15..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦言归人 2024-11-26 15:19:15

尝试

LOAD DATA
REPLACE
INTO TABLE TEST
WHEN TEST_CD = 'B' AND TEST_TYPE_CD = 15 -- load everything that is b and 15
INTO TABLE TEST
WHEN TEST_CD != 'A' AND TEST_CD != B -- load everything that is not a and not b (because it is loaded above)

Try

LOAD DATA
REPLACE
INTO TABLE TEST
WHEN TEST_CD = 'B' AND TEST_TYPE_CD = 15 -- load everything that is b and 15
INTO TABLE TEST
WHEN TEST_CD != 'A' AND TEST_CD != B -- load everything that is not a and not b (because it is loaded above)
鹊巢 2024-11-26 15:19:15

那么,您希望它在任一条件为真时加载,而不是两个条件都为真时加载?

WHEN TEST_CD != 'A' AND (TEST_CD = 'B' OR TEST_TYPE_CD = 15)

可能会满足您最初问题的支离破碎的英语。

So, you want it to load in when EITHER condition is true, not necessarily BOTH conditions?

WHEN TEST_CD != 'A' AND (TEST_CD = 'B' OR TEST_TYPE_CD = 15)

may satisfy the fractured English of your initial question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文