Aster_function GraphGen with JDBC

Aster
Enthusiast

Aster_function GraphGen with JDBC

HI ALL:

              I am trying to call Graphgen funtion with jdbc, it seems not work.but it works in Teradata sql assistant.

             Any one can help?  Thanks!!!

Tags (2)
4 REPLIES
Junior Contributor

Re: Aster_function GraphGen with JDBC

Sorry, but my crystal ball didn't show me any details, so it's your turn:

What did you try and how did it fail?

Dieter

Enthusiast

Re: Aster_function GraphGen with JDBC

Class.forName("com.asterdata.ncluster.Driver");

 con = DriverManager.getConnection(url, "abc", "abc");

stmt=con.createStatement();

             rs=stmt.executeQuery("SELECT path FROM GraphGen"

+"(on aaf.region_shipment_req"

+"PARTITION by 1  "

+"item_format('npath')"     

+"score_col('shipment_cnt')"

+"item1_col('path')"

+"output_format('sankey')"   

+"justify('left')"      

+"width_max(16.0)"           

+"width_min(3.0)"             

+"nodesize_max(32.0)"       

+"nodesize_min(18.0)"       

+"title('DEMO1')"      

+"subtitle('date:2013/03/06')"      

+"edge_labels('true')"       

+"DOMAIN('192.168.100.100'))");

The error show "SQLEXCEPTION:ERROR: syntax error at or near "1", but i did try the mr-sql in sql assistant client, it works!

Junior Contributor

Re: Aster_function GraphGen with JDBC

When you check the resulting SELECT string you will easily see why it fails.

You concat all those parts of the SELECT statement without additional spaces.

It's recommended not to execute a concatenated string directly. When you assign it to a string variable it's easy to inspect the actual string value.

Dieter

Enthusiast

Re: Aster_function GraphGen with JDBC

Dieter ,you are right,it's fixed, Thanks :)