Other keywords are not allowed when the 'Name' keyword is specified - linqpad

I get the error in the title when I try to run a query in Linqpad, v4.43.06
Why is that?

mmm nevermind, this has to do with the EF context definition in the DLL I am connecting to.

Related

Navigation record searches specified with a missing keys or terms or both

error=Navigation record searches specified with a missing keys or terms or both
How to solve the above Oracle Endeca query error ?
This error is coming as Ntt and Ntx parameters are having the blank value.Since this is navigation query than no need to pass these parameters, NTK, Ntt and Ntx.
I tried at my end and looks like query passed to MDEX engine is not parsed properly and gives Failed to Parse URL
I hope this helps.
Thanks,
Ajay Agrawal

Softlayer API: filter image by OS referenceCode

I am trying to filter out my list of images by OS reference code. Here is the url I am trying:
https://api.softlayer.com/rest/v3/SoftLayer_Account/getBlockDeviceTemplateGroups.json?objectMask=mask[flexImageFlag]&objectFilter={'children': {'blockDevices': {'diskImage': {'softwareReferences': {'softwareDescription': {'referenceCode': {'operation': 'REDHAT_6_64'}}}}}}}
But I am kept getting the following error msg:
{"error":"Unable to parse object filter.","code":"SoftLayer_Exception_Public"}
Can anyone help me see what is wrong? Thanks in advance!
Q.Z.
The filter is wrong, but in my tests the filter is not working with the "referenceCode" property; you need to use another property such as name, version or both. See below the examples:
using name and version property
https://api.softlayer.com/rest/v3/SoftLayer_Account/getBlockDeviceTemplateGroups?objectMask=mask[flexImageFlag]&objectFilter={"blockDeviceTemplateGroups": {"children":{"blockDevices":{"diskImage":{"softwareReferences":{"softwareDescription":{"name":{"operation":"CentOS"}, "version":{"operation":"6.3-32"}}}}}}}}
Using only a property (name in this case)
https://api.softlayer.com/rest/v3/SoftLayer_Account/getBlockDeviceTemplateGroups?objectMask=mask[flexImageFlag]&objectFilter={"blockDeviceTemplateGroups": {"children":{"blockDevices":{"diskImage":{"softwareReferences":{"softwareDescription":{"name":{"operation":"CentOS"}}}}}}}}
Regards
Looks like you are using the REST api. The example in the
API reference, suggests that this parameter should be in JSON format:
https://api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests?objectMask=mask[id,hostname]&objectFilter={"datacenter":{"name":{"operation":"dal05"}}}
Your error says "Unable to parse object filter.", so the error is probably just be that your parameter is invalid JSON: The JSON standard only accepts double quotes.
Try replacing
{'children': {'blockDevices': {'diskImage': {'softwareReferences': {'softwareDescription': {'referenceCode': {'operation': 'REDHAT_6_64'}}}}}}}
with the corresponding valid json:
{"children": {"blockDevices": {"diskImage": {"softwareReferences": {"softwareDescription": {"referenceCode": {"operation": "REDHAT_6_64"}}}}}}}

How to ignore "cannot resolve query parameter" error in IntelliJ

I have a query:
Date dDateFrom;
...
String sql = "select a from tblA where timestamp > ?";
ps = this.connection.prepareStatement(sql);
ps.setTimestamp(1, java.sql.Timestamp(dDateFrom.getTime()));
And the IntelliJ IDE warn an Error: cannot resolve query parameter, I believe it's because the column "timestamp", (I know it's a bad name, but it's defined decade ago, I can not change it).
Anyway I can ignore this error?
Navigate over the part of the code where the error is highlighted, hit ALT+ENTER and select Inspection 'Unresolved queries and query parameter' options -> Edit inspection profile settings. This will open settings dialog where you can uncheck this inspection so that future "errors" of this kind will be ignored.
You can also change it directly from Settings. Just search for Unresolved query.
Btw: this inspection is shown as a JPA inspection, but clearly it works for plain JDBC too.
You might be able to avoid the warning by quoting the column name with double-quotes, backticks, or brackets. This is the usual SQL mechanism for allowing unusual column names such as spaces or reserved words, and could help IntelliJ parse it better.
String sql = "select a from tblA where \"timestamp\" > ?";
Here is a screen of Preferences from IntelliJ IDEA 2017.3.4 where you can find the setting.

Use Xpcom.CreateInstance<IType>(String); in VB.NET

I want to use such a CreateInstance-Function as the following one for GeckoFx in VB.NET.
Xpcom.CreateInstance<nsILoginManager>("#mozilla.org/login-manager;1");
The code above works fine for C-Sharp but not for VB.NET, what should I use instead?
If I try Xpcom.CreateInstance(nsILoginManager)("#mozilla.org/login-manager;1") I get an Error for as the following one :
"This [nsILoginManager] is a type and cannot be used as Expression"
What else should I write/use?
The reason why I try this is to activate the historisation for fields in the webbrowser-component.
VB.NET uses of keyword to specify type.
Try this:
Xpcom.CreateInstance(Of nsILoginManager)("#mozilla.org/login-manager;1")

SQL Anywhere 12 Problem with sentence CREATE DOMAIN

This produce an syntax ERROR:-131.
CREATE DOMAIN dom CHAR(35);
Anyone knows why?
Thank you!
Try this:
CREATE DOMAIN "dom" CHAR(35);
Perhaps dom is a keyword. Or - more probably - there already exists something named dom. Did you run the command twice?
If yes, the first time you run it, it created the domain "dom". The second time, it's typical to "answer" that you can't create another domain with the same name, using the obvious error code of -131 .