Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query from ProvideX (unix) to Teradata (unix)

Status
Not open for further replies.

Lysen

Programmer
Apr 9, 2002
87
NL
Hi, I've some questions again...! :)

We have a in-house developed software suite programmed on ProvideX. This software needs to search for certain keywords very fast. We have a large database of images, and these are grouped by keywords. We want to give users the ability to search for these, for example, they enter: swimming pool, and all the pictures with a keyword "simming pool" should be returned.

We thought to let Teradata handle this search... ProvideX is on Unix, Teradata is on Unix, but how do we connect to and pass the query to Teradata, and how do we get the results back in the fastest way possible?

I've already done some research, but further than using BTEQ with a script and writing the results back to a file I didnt come, and I guess this isn't really fast (opening and closing files, reading them...)

Can teradata 'talk' to another unix program and for example pass the results of the query back to that program which then on his turn parses it in a variable or something?

Or are there any other ways to do this?

 


if ProviderX can communicate directly with a Database vendor using the OPEN STANDARD ODBC or JDBC you could write you queries directly there.

Teradata also provides its own Call Level Interface (CLI) API to allow programs to directly talk to the database as well.


There is a program that comes installed with BTEQ called CLISAMP.C that is a sample CLI program.

It comes with several wrapper functions which basically simplify the program interaction with the actual CLI layer to.....


initialize_dbcarea();
set_options();

/* logon String was passed in from the user */
logon_to_dbc(psLogon);
fetch_request(dbc.o_req_id,dbc.o_sess_id);
close_request(dbc.o_req_id,dbc.o_sess_id);

/* put your query here */
open_request("select * from dbc.sessioninfo;");
fetch_request(dbc.o_req_id,dbc.o_sess_id);
close_request(dbc.o_req_id,dbc.o_sess_id);
exitout(CONNECTED);



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top