Solved

Teradata SQL - need to import txt document to filter

Posted on 2006-06-23
1
806 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
1 Comment
 
LVL 8

Accepted Solution

by:
sapnam earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now