All Forums Tools
davidtzoor 5 posts Joined 06/14
05 Sep 2016
Passing parameter in Teradata Rest Service

I am using Teradata Rest Service and trying to pass a parameter for my query:

select ? as ip_address
from my_database.ip_table as g
where internallib.ip2ip3(ip_address) between g.start_ip and g.end_ip

This is how my request looks like:

{ url: 'http://my_server:1080/tdrest/systems/service_name/ queries',
  gzip: true,
  json: true,
   { Authorization: 'Base 64 auth',
     Accept: 'application/',
     'Accept-Encoding': 'gzip',
     'Content-Type': 'application/json' },
   { query: 'my query (see above)',
     params: [ [ '' ], [ '' ] ],
     format: 'array',
     includeColumns: true } }

But I get a Bad Request error. 
How can I use parameters in my query? What am I doing wrong?

You must sign in to leave a comment.