All Forums Aster
QI.YOU 13 posts Joined 03/13
26 Jul 2013
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:
dnoeth 4628 posts Joined 11/04
26 Jul 2013

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

Dieter

QI.YOU 13 posts Joined 03/13
26 Jul 2013

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!
 

dnoeth 4628 posts Joined 11/04
27 Jul 2013

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

Dieter

QI.YOU 13 posts Joined 03/13
01 Aug 2013

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

You must sign in to leave a comment.