Use Flexible Seach For Jasper Report has problems in Hybris - sap-commerce-cloud

I try to connect Visual JDBC to Database (MySQL).
Everything looks good.
But when I using Flexible Query or plain SQL syntax have different results.
Reality, The table has a number of records (2 records).
When plain SQL syntax => 2 records => correct.
But Flexible Query => 0 records => false.
Example: Flexible Searchplain vs SQL syntax
Flexible Search Query
Plain SQL Query

May be orders already deleted. Can you check them in backoffice?
Not: your screenshot and images not match.

Related

how to use a stored log analytics query as a datasource in excel?

In our project we created several useful queries on log analytics that we deploy as a "savedSearch" (Microsoft.OperationalInsights/workspaces/savedSearches#2020-08-01).
Now when we load the query in the editor we can export it to excel, which can be nicely refreshed to view current data.
However this link is created to the query that is in the editor and not the stored/deployed query. The alternative is to export to Power Bi (M query) which generates a script that you can then use in excel.
In both cases the query itself seems to be in the connection, so it does not get updated when we deploy a new version. Does anyone know of a way to make this connection to a stored/deployed query?
I feel like this should be as straightforward as a connection to resource so that not only the data, but also the query itself gets updated.... I must be missing something
One way I can think of is to leverage Functions in log queries.
You can first save your query as a function, then export it to excel that would create a connection but execute the function, instead of the raw query.
You can tweak your query later if needed and save/overwrite to the same function, and the refresh should still be able to pull in the latest results since the changes are now neatly abstracted away via the function. :)

How to convert user natural query into SQL query?

I am trying to build a chatbot in Rasa/Dialogflow, the problem i ham facing is to convert English to SQL query so that what user write in English can be converted into SQL fetch data from MYSQL database and display result to use.
Can someone suggest me how to do it?
Ideally this is only possible through solutions like SEQ2SQL(Link here for reference).
But I implemented it in a workaround fashion:-
I got the json using tracker.latest_message .
After which I processed the json to make our own structured json like:
[{'column_name':'a',
'operator': '=',
'value':'100'},
{'column_name':'b',
'operator': '>',
'value':'100'}]
Above structure was used to form the where clause of the query.
Same way I made a custom json for Select Part as well :-
[{sum:column1},{count:column2}]
5.Then I looped through the json I had created and made our queries.
Note:- This json Structure will not be able to cover all possible scenarios but worked decently for me.

How Can I see the Sql query of the excel file I uploaded Oracle DB

I am learning pl/sql. I want to ask a question for importing excel files.
I create a table after that import data from excel nearly 100 rows.
I wonder how can i see this query basic like;
insert into table_name (column1,colum2,...,columnn )
values (value1, value2, ... , value n); and other 100 rows..
Sincerely
I'm not sure whether there is a feature within Oracle engine itself, but I can think of two ways to get those queries:
1. Use Oracle SQL Developer (Or another GUI with the same features) :
Oracle SQL Developer (Download link here) is a free tool developed by Oracle to interact with the database. Add the connection for your database and connect to it, then follow these guidelines carefully to generate your insert script.
2. Use v$sql (Experimental) :
Right now I have no access to an Oracle database to check this, but theoretically, if the database is a development/training one, there should not be a lot of activities and queries inside, so you can query the v$sql table to find the last 100 (or whatsoever) queries:
SELECT SQL_FULLTEXT FROM V$SQL WHERE ROWNUM < 1000 ORDER BY FIRST_LOAD_TIME desc;
Check for the ones starting with INSERT INTO {THE_TABLE_WHICH_HAS_IMPORTED_DATA} to find your insert lines.
As I mentioned, this method is quite experimental and might confuse you, so I strongly suggest using Oracle SQL Developer.

Order By not working in Azure Web Document Explorer

I am trying to query documentdb inside the Azure Web Document Explorer. The problem is Order By doesn't seem to work anymore.
For instance the following query:
SELECT * FROM c
WHERE c.type="myType" ORDER BY c.createdDate
When queried I get a red alert stating:
Failed to get documents. Please try again.
If I remove Order By it works fine.
Any idea why it doesn't work anymore to query with Order By?
Any idea why it doesn't work anymore to query with Order By?
Order By can be specified only against a property, either numeric or String when it is range indexed with the Maximum Precision (-1). More detail please refer to document
You also cannot perform the following:
Order By with internal string properties like id, _rid, and _self (coming soon).
Order By with properties derived from the result of an intra-document join (coming soon).
Order By multiple properties (coming soon).
Order By with queries on databases, collections, users, permissions or attachments (coming soon).
Order By with computed properties e.g. the result of an expression or a UDF/built-in function

how to filter the child entities but get all with eager loading?

I have two tables in my database in a 1:N relation and I would like to do a left join query with eager loading.
My tables are:
Videos (IDVIdeo, Name... )
Versions (IDVersion, IDVideo, Name, Avaliable...)
Well, in a video I can have many versions (DVD, Blu-Ray... etc) and a version only can belong to a video.
I would like to get all the videos which I have at least one available version (perhaps some version are in possession of one friend).
I would like to get all the videos that have at least avaliable version, but of this videos I want all the versions, avaliable and not avaliable.
So the first step is to know all the videos that have at least ona avaliable version and the second step is to get all the videos and all their versions (avaliable and not avaliable).
I would like to that with raw sql but how it is not possible to use eager loading with raw sql, I would like to use linq.
I want to use eager loading to use only one query to the database and not many, and because I would like to populate the collection versions in the video entity with its versions.
Thanks.
The solution using LINQ is rather straight-forward and would be:
var videos = context.Videos
.Include(v => v.Versions)
.Where(v => v.Versions.Any(vers => vers.Available))
.ToList();
If you really prefer raw SQL for this you can extract the SQL from this LINQ query:
var sql = context.Videos
.Include(v => v.Versions)
.Where(v => v.Versions.Any(vers => vers.Available))
.ToString();
Edit
Most likely a query with raw sql won't populate navigation properties, so it doesn't seem to be possible to use it for eager loading. See the discussion here, in the answer and its comments.

Resources