Questions tagged [dynamicquery]

Use this tag for questions related to dynamic queries; queries that are built dynamically rather than provided as an explicit query string.

is usually found in questions related to SQL, C#, Drupal, Java, etc., so if you are about to use this, make sure you accompany it by the corresponding tag of your programming environment.

344 questions
4
votes
2 answers

Rails 3 Retrieving All Great Grandchild Records As ActiveRecord Collection

So I'm trying to perform queries on a models great granchildren. The relationship is as so... Tournament > Competitions > Matches > Players and the Tournament model: class Tournament < ActiveRecord::Base has_many :competitions, :dependent =>…
Noz
  • 6,216
  • 3
  • 47
  • 82
3
votes
0 answers

Oracle, DBMS_SQL not seeing uncommited data

I can not provide any code, so I try to be as precise as I can explaining how code works. There is a process: some inserts, some updates etc. etc.. At some point there is a dbms_sql.execute procedure in use. In this execute there is a statement…
q4za4
  • 630
  • 4
  • 12
3
votes
0 answers

Count() doesn't work after applying IQueryable to Linq Dynamic, throwing 'must be reducible node' error in EF Core

When param.SearchValue == string.Empty Count() works. But in other cases Count() or any other execution doesn't work, throwing the exception: must be reducible node Here's my code : public DataTableReturnValue
3
votes
1 answer

Dynamic query selection on a list contains list

I am trying to make a dynamic filtering mechanism with c#. I have user class with properties like Name, Surname, BirthDate etc. and Also UserInformations list which is a list of a UserInformation object. UserInformation object has attributes Id,…
3
votes
1 answer

PostgresSql - Split aggregated, comma separated values into separate columns iniside query - with Amazon Aws & PostgreSql 9.6

I have the following situation where I need to solve the question of displaying data inside a column, for each data-part of a concatenated string. I'm relatively new to this and the sad thing is I was not able to transfer other already read…
3
votes
3 answers

dynamically Search Query in HQL with optional Parameter?

i am developing an application in which i need search functionality, i want to write HQL query that dynamically create according to parameters. Currently i have 4 parameters, while searching all parameters are required or 1 or 2 or 3 parameters…
Ahmad
  • 1,462
  • 5
  • 17
  • 40
3
votes
3 answers

To call SelectMany dynamically in the way of System.Linq.Dynamic

In System.Linq.Dynamic, there are a few methods to form Select, Where and other Linq statements dynamically. But there is no for SelectMany. The method for Select is as the following: public static IQueryable Select(this IQueryable source,…
Ying
  • 526
  • 4
  • 16
3
votes
2 answers

LINQ - Dynamic Where Clause on "Query Syntax"

I have been searching about how to make dynamic queries and everything that I found was using "Method Syntax". Is it possible create dynamic predicates for "Query syntax" ? I tried to use something like Expression> inside the…
vdefeo
  • 93
  • 1
  • 1
  • 10
3
votes
1 answer

Facing Exception in Liferay: org.hibernate.QueryException: could not resolve property

I am having service entity defined in service.xml as below:
Pankaj Kathiriya
  • 4,210
  • 2
  • 19
  • 26
3
votes
1 answer

Get data from 3 tables using dynamic query

I have 3 tables user_, userTracker, userTrackerPath user_ has userId as Pk. which is Fk in userTracker userTracker has UserTrackerId as pk which is Fk in userTrackerPath and userTrackerPath has userTrackerPathId as Pk. user_ tables has fields…
Jay Trivedi
  • 464
  • 4
  • 15
2
votes
0 answers

Dynamic SQL via jOOQ for paginating joined tables with same-named columns

I'm following a jOOQ blog post about paging metadata, and trying to implement it generally for a project. It demonstrates how to generically take an existing Select and wrap it up to contain information about the current page, and how many other…
Colin Alworth
  • 17,801
  • 2
  • 26
  • 39
2
votes
1 answer

how to dynamically join tables in bigquery to avoid duplication of common columns

I have 2 tables with a large number of columns (each has around 700-800 columns, which makes it not feasible to individually write all the column names). Both the tables have a few common rows. I need to dynamically union both the tables such that…
Sanjana
  • 35
  • 6
2
votes
1 answer

Omitting Scientific Notation in Numeric columns when working with Dynamic SQL returning JSON

The below dynamic query returns the output of the numeric columns in Scientific notation. DECLARE @Cols VARCHAR(MAX) = (SELECT STUFF(( SELECT ',' +'['+ Description + ']' FROM @PermittedColumnIDs DECLARE @Query NVARCHAR(MAX) = 'SELECT TOP 1000 '+…
Harsha W
  • 3,162
  • 5
  • 43
  • 77
2
votes
1 answer

Converting Dynamic SQL Query to a Prepared statement in Java

I'm wanting to write a program that converts a SQL Dynamic Query into a prepared statement in Java. So if given a string like "SELECT * FROM EMPLOYEE_TABLE WHERE FIRST_NAME='BOB';" I'd like to convert that to a java prepared statement using code.…
bsimic
  • 926
  • 7
  • 15
2
votes
1 answer

SQL Server dynamic JSON using within Analysis Services?

I am trying to get my head around which direction to even start with the following.. Imaging a dynamic form (JSON) that I store in SQL Server 2016+. So far, I have seen / tried a couple of dynamic queries to take the dynamic JSON and flatten out as…
Dav.id
  • 2,757
  • 3
  • 45
  • 57
1
2
3
22 23