Solved

Teradata SQL - need to import txt document to filter

Posted on 2006-06-23
1
809 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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Calculating percentages per course - Oracle Query 3 41
query returning everything 11 91
SQL Query 34 82
su - oracle could not open session 6 53
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

895 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

14 Experts available now in Live!

Get 1:1 Help Now