Solved

Teradata SQL - need to import txt document to filter

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle encryption 12 72
Field name with special character (Ñ) in Oracle 11 188
add more rows to hierarchy 3 46
Performance Issue in Oracle 3 45
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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 how to recover a database from a user managed backup

734 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