Can a teradata database trigger/stored procedure call a java program or Executable?
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Can a teradata database trigger/stored... Expand / Collapse
Author
Message
Posted 1/19/2006 4:05:00 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/23/2006 10:58:00 AM
Posts: 4, Visits: 1
Hi,

My project requirement is that a Teradata database trigger/stored procedure needs to call java program to put data in a JMS queue. I wanted to know if it is possible to call executable or java program from stored procedure/trigger?

Is java stored procedure supported in Teredata database?

Note: I dont want to write a polling job or program to monitor changes in the tables and then put data in a JMS queue.

Appreciate your help in advance!

Thanks,
Mustaq
Post #3376
Posted 1/19/2006 10:57:14 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 6/16/2007 11:57:00 AM
Posts: 293, Visits: 1

UDF or Stored procedure? Teradata Stored procedures follow the ANSI standard and have a specific language as per the ANSI standard. Not C, Not Java, it is called Stored Procedure Language. It is very limited in what it can do.

You would probably want to Equate what other vendors call Stored procedure With User Defined Functions. For example In some other RDBMS even simple Teradata Macros are called Stored procedures. I even found an example of a Stored Procedure that could Format a Disk.
What does formatting a Disk have to do with Relational Databases.

Anyway as of V2r5.1 Teradata supports User defined functions. They must be written in C. In V2r6 they can be written in in C or C++, Java support will come later.

However someone offered a suggestion somewhere, if not this Forum maybe TeradataForum.com, where as you write a C Wrapper function to call your Java function. Never tried this.

Obviously this wouldn't be supported on a production system from Teradata's Support Contract point of view ( if it crashes your box ) but It might work.

Post #3380
Posted 1/20/2006 9:47:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/23/2006 10:58:00 AM
Posts: 4, Visits: 1
Hi,

Thanks for your prompt response! Would appreciate your comments on these as well:

Here are my project requirements:

1. From a teradata database trigger I need to update different vendor database(SQL server or Sybase) table. Wanted to created something like database link with other vendor database, and manipulate/retreive data.
Note: I dont want to do this by replication and I need something like database link or create something like Oracle java stored procedure.

2. Yes it possible to call java or java webservice from C program. Have couple of questions on macros.
a)Can I call teradata macros from teradata database trigger? Is it possible to make this call asynchronous?

b) Can I set macros on a table that will trigger the macros statements on updation/deletion/insertion of a row in a table?

c) Can I call teradata stored procedure from teradata macros or vice versa?

Thanks for your help!
Post #3394
Posted 1/20/2006 12:04:19 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 6/16/2007 11:57:00 AM
Posts: 293, Visits: 1
Sorry We don't support native Java functions. Can you re write the Java function in 'C' using ODBC or something?

V2r6 allows you to write TABLE UDFS where your UDF can return a set of ROWS one at a time to a query that invokes it.

---
Post #3397
Posted 1/20/2006 1:11:14 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/23/2006 10:58:00 AM
Posts: 4, Visits: 1

First, my code will run on unix env, so I cannot go with ODBC.
Second, To write a code to access messaging server or database server in C will take lot development effort and time
Third, most my existing business logic is in java and I want to reuse the code.

My sincere thanks for help!
Post #3400
Posted 1/20/2006 9:20:51 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 6/16/2007 11:57:00 AM
Posts: 293, Visits: 1

But ODBC runs on UNIX.

You can download the ODBC driver for Teradata for SOLARIS, LINUX, HPUX, AIX from

http://www.teradata.com/t/page/130536

Like I said you can try writing C Wrapper functions to call into you JAVA DLL .


Post #3402
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 1 ( 1 guest, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 9:00pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.031. 4 queries. Compression Disabled.