DolphinDB syntax error: expected to close the function call sum - eval

Can someone help me out? I have tried the code below and it doesn’t work.
t=table(rand(2017.08.07..2017.08.11,20) as date,rand(`a1`a2`a3`a4,20) as ts_code,rand(10.0,20) as price)
colname="price"
eval(sql(select=sqlColAlias(<sum(colname>, `y),from=t, groupBy=sqlCol(`ts_code`)))
Syntax Error: expected to close the function call sum
Why it does not work? Can anyone point me to the right direction?
I have the DolphinDB Server 1.20.9 version.

Try this:
sql(select=sqlColAlias(makeCall(sum,sqlCol(colname)), `y),from=t).eval()

Related

(Laravel) Get the difference of current date and given date in DB::raw

I tried the code below, but didn't work.
$susbcribers = DB::table('subscribers')
->select(
DB::raw("DATE_FORMAT(Carbon::now()->subDate(subscribers.expired_at), '%d') as days_left"),
)->get();
I just want to get the days left, but now I'm stuck with this. I am just beginner of Laravel, somebody help me of this, would appreciate any suggestion/advice, thanks in adv..
I think this should do the trick.
$susbcribers = DB::table('subscribers')
->select(DB::raw("DATEDIFF(now(), expired_at) as days_left"))
->get();

VO query not getting executing

Following is the code in my AM implementation
public void edit(){`testVO().setWhereClause(null);
testVO().setWhereClauseParams(null);
testVO().applyViewCriteria(testVO().getViewCriteria("SearchCriteria"));
testVO().setNamedWhereClauseParam("a",method.getContentOwnerId());
testVO().setNamedWhereClauseParam("b",method.getTaxSrch());
testVO().setNamedWhereClauseParam("c",method.getTaxRgmCodeSrch());
testVO().setNamedWhereClauseParam("d",method.getTaxStatCodeSrch());
testVO().setNamedWhereClauseParam("e",method.getTaxRateCodeSrch());
testVO().setNamedWhereClauseParam("f",method.getRateTypeCode());
testVO().setNamedWhereClauseParam("g",method.getTaxJurisCodeSrch());
testVO().executeQuery();}`
testVO() method returns the TestVO. Bind variables are being picked up (can tell from the log) but when the line
testVO().executeQuery()
is encountered, the query is not getting executed.
Any ideas why this might happen or how to debug this.
Thanks.
Can you see your VO executing when you open it from BC Tester?

Property 'sharedFileUtils' not found on object of type 'CCFileUtils'

I'm just getting started running Cocos3d and right out of the box trying to run the demo file I'm getting a compile error. Here's the error in the log:
/Users/user/Developer/Tutorials/Cocos3dInitialTest/Cocos3dInitialTest/cocos3d/cocos3d/Nodes/CC3BitmapLabelNode.m:140:36: error: property 'sharedFileUtils' not found on object of type 'CCFileUtils'
NSString *fullpath = [CCFileUtils.sharedFileUtils fullPathFromRelativePath: fontFile];
I'm sure it's a simple fix but, ah, so much initial code to get through. Don't want to overheat my brain right of the bat if possible.
sharedFileUtils is a method, not a property.
Try this way:
[CCFileUtils sharedFileUtils]
Your code should look like this:
NSString *fullpath = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath: fontFile];

Display result GeoQuerySet

I'm trying to query my PostGis database thanks to geoDjango but I have an error where I found no solution on the internet.
close_loc=PlanetOsmPoint.objects.get(way__distance_lte=(lePoint, D(**distance_from_point)))
Whatever I try on the result (close_loc) with a print, I have this error :
django.db.utils.DatabaseError: Only lon/lat coordinate systems are supported in geography.
I tried to convert it to a correct format thanks to transform(SRID) but nothing was solved, still the same problem.
Here's some informations :
Transformation :
sr1=SpatialReference('54004')
sr2=SpatialReference('NAD83')
ct=CoordTransform(sr1, sr2)
What I'm doing after getting the close_loc :
close_loc.transform(ct)
print close_loc[0]
close_loc type is GeoQuerySet.
How can I exploit this result ?
The transform() function expects an integer, not a string. The correct syntax is:
close_loc.transform( new_srid_number )
In your case, something like this:
close_loc.transform(54004)
Hope it'll work !

Problem while performing Insert statement

HI..
I have a database created and having a table inside it..
now when i am inserting a value in my table it doesnot work...
And please tell me how to see the error if occurs in the eclipse plug in . I am very new to blackberry.
now the snippet code for inserting the value is
Database d;
URI myUri = URI.create("file:///SDCard/Databases/SQLite_Guide/", "Mynewdatabase1.db");
d= DatabaseFactory.create(myUri);
d.close;
Statement s1=d.createStatement("INSERT INTO People(Name,Age)VALUES ('uttam',23)");
s1.prepare();
s1.execute();
s1.close();
d.close();
You're closing the data base before calling createStatement? That isn't going to work. Is this the actual code, because the first you're missing the parens on the first call: d.close;

Resources