?
Solved

Teradata SQL - need to import txt document to filter

Posted on 2006-06-23
1
Medium Priority
?
820 Views
Last Modified: 2013-12-12
Select cust_acct_nbr, creation_dt, sale_terr_nbr, dup_acct_flg from cf_cust_acct group by 1,2,3,4 order by 1,2,3,4

I am using Teradata SQL Assistant with the above statement.
This statement finds all cust_acct_nbr.
What I need to do is IMPORT (upload) a .txt file that contains one row on numbers (cust_acct_nbr).
I want to only find the data (creation_dt, Sales_terr_nbr, etc.) for those numbers.
I have seen an IN LIST statement before, I think it would be something like that??

Can anyone help me accomplish this? Thanks a MILLION!!! :)
Regards,bethanne
0
Comment
Question by:ba_trainer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
sapnam earned 1500 total points
ID: 16981029
If you need to upload a .txt file, then you can use Oracle SQL Loader which will load the data into a table.  There are some third party products also available.  

I have not worked on Teradata SAL Assistant and would not know if there are any tools available within it to load data.

I can give you the steps for using SQL Loader, if you want to use the same.

Also, let us examine your SQL Statement

Select cust_acct_nbr, creation_dt, sale_terr_nbr, dup_acct_flg
 from cf_cust_acct
group by 1,2,3,4
 order by 1,2,3,4

In SQL, this statement will fail because you cannot use group by 1,2,3,4. You will have to use the actual field names.Again, I do not know abt the product you use, so maybe the statement works in that.

And why are you grouping, You are selecting 4 fields and grouping by all 4. Do you want a count or something ? Then you have to include a count column.

Please respond to the above so that me or others can help you out better

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question