A
A
Anton2016-12-13 23:07:13
SQL
Anton, 2016-12-13 23:07:13

How to write a correct request?

Good day!
I am learning Teradata DBMS syntax. And recently I came across a rather interesting script option for writing a script - bteq (this is something like a shell for writing SQL scripts that can be executed on any environment where this subd is located). I decided to write a script, everything seems to be fine (it works). But then I decided to complicate the task a little for myself and write a script that will select data from a table that does not have a specific field. When executing this script, it crashes with an error. I tried to catch the error through the ERRORCODE and ACTIVITYCOUNT constructs, but to no avail. Has anyone come across this situation, how can I get around it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2016-12-16
@MoonMaster

I solved the problem as follows: I
wrote a script that compares two tables (an existing one and from which I am going to insert data). If the structure is different, then I do nothing and go to the exit, if it is the same, then I insert the data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question