Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 100

Passing parameter in Teradata Rest Service - forum topic by davidtzoor

$
0
0

Hi,
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,
  headers:
   { Authorization: 'Base 64 auth',
     Accept: 'application/vnd.com.teradata.rest-v1.0+json',
     'Accept-Encoding': 'gzip',
     'Content-Type': 'application/json' },
  body:
   { query: 'my query (see above)',
     params: [ [ '10.244.200.50' ], [ '10.5.4.1' ] ],
     format: 'array',
     includeColumns: true } }

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

Forums: 

Viewing all articles
Browse latest Browse all 100

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>