User PROMPT

Database
Enthusiast

User PROMPT

Hi,

Can any one please let me know how user input can be taken in teradata?

Example of which is &variable / :variable in Oracle. What is the equivalent of it in Teradata.

Thanks in Advance,
Koushik
4 REPLIES
Teradata Employee

Re: User PROMPT

Hello,

In SQL Assistant, you can use following:

SELECT * FROM Table1 WHERE Col1 = ?InputVar1;

When run, it will ask for the value of input variable.

HTH.

Regards,

Adeel

Re: User PROMPT

Hello Adeel, I ran my SQL statement designed exactly as  you have mentioned in your post, it goes through but doesn't prompt me for the input value.

When I run my SQL it will only generate the titles of the column without any data in it.

Please help me with this.

Bibek

mjj
Teradata Employee

Re: User PROMPT

Hi,

I tried the statement given by Adeel on my table.

select * from T_test

where dtmid = ?inputvalue1

It did prompt for inputvalue and returned rows.

If for given input value you don't have data present in table then it will return no rows.

Regards, 

Enthusiast

Re: User PROMPT

Hi Bibek, Are you using SQLA tool, in sqla tool you have option in tools>options>query> check , allow parameterized queries. It should ask for value when run.

Harpreet