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
2
votes
1 answer

SSIS Dynamic Query

I am trying to execute the dynamic query in SSIS. When I try the following statement EXECUTE(@dynamicquery) It throws error and suggests to use WITH RESULT SETS But in my case the result schema also dynamic EXECUTE(@query) WITH RESULT SETS…
Jana
  • 137
  • 2
  • 11
2
votes
3 answers

Dynamic column in where condition

In my scenario, i want to query a table with a user selected column name. So every time column name for where condition will change, so I am trying to query on a query with lambda. I exactly don't know how to do this, Please help me out of this. Or…
Anup
  • 9,396
  • 16
  • 74
  • 138
2
votes
0 answers

Nested SelectMany/Select LINQ DynamicQueryable

How do I convert this LINQ query to a dynamic query? var resultList = itemList.SelectMany(b => b.SubItemList.Select(x => new {b.Supplier, b.Customer, x.ProductCode, x.ProductPrice})); I have this method: public static IQueryable SelectMany(this…
yawanur03
  • 21
  • 4
2
votes
1 answer

Arrange columns of one table according to positions as rows in other table in microsoft sql server

In my first table A, I am having data which i need to display, but displaying order would be differnt from the one here . Display order depends on position in the second table B. I want the field having lowest position comes first and with name…
Ke7in
  • 917
  • 2
  • 7
  • 16
2
votes
1 answer

PLS-00382: expression is of wrong type in Oracle cursor

I have written a cursor in oracle 11g as follows: DECLARE CURSOR QnA_cursor IS SELECT activity_id, question, answer FROM TABLE1 WHERE question != 'surveyText' ORDER BY activity_id, question; cur_count …
keenUser
  • 1,279
  • 3
  • 16
  • 33
2
votes
1 answer

Creating a Crosstab query with mysql

I am new to php and mysql and I am trying to create a crosstab query using the code below: SET @sql = NULL; SELECT GROUP_CONCAT(DISTINCT CONCAT('SUM(IF(category = ''',category,''', duration,NULL))AS ',category)) INTO @sql FROM…
Wien Ambali
  • 37
  • 1
  • 6
2
votes
1 answer

Max by primary key in EF

Is it possible to get max value of a pk column using EF? I mean something like find method which gets an entity based on pk values, we already have this: public TEntity Find(params object[] keyValues); I'm looking for something like : public object…
VahidNaderi
  • 2,448
  • 1
  • 23
  • 35
2
votes
1 answer

Dynamic Query of a SQL table in Excel

So I've been stuck working on this problem for the last several days, and would really like a solution to it. What I am doing is going into the data tab in excel and getting external data from my SQL server (I will provide a link to my database).…
Mitchell Walker
  • 211
  • 3
  • 8
  • 18
2
votes
2 answers

Problems with a very advanced sql query

I need to do an advanced selection in SQL, but I'm stuck. I have the following table: id | user_id | position | value 1 | 1 | 1 | 1 1 | 1 | 2 | 1 1 | 1 | 3 | 3 1 | 2 | 1 | 2 1 | 2 …
peltors
  • 43
  • 4
2
votes
2 answers

"Unsupported overload used for query operator 'Where'

I was using the same query before it was working fine. Then I decided to use complied query. So I had to make few changes to the code. Now when I try to execute the code, I get the error message "Unsupported overload used for query operator 'Where'.…
AJ17
  • 308
  • 5
  • 17
2
votes
2 answers

Enhanced DynamicQuery?

I've recently started using the DynamicQuery API, and it quickly became apparent that it has numerous limitations. I've found at least one improvement online: support for enum arguments, but it's pretty clear that this API is not actively maintained…
Roman Starkov
  • 59,298
  • 38
  • 251
  • 324
1
vote
2 answers

Multirow subselect as parameter to `execute using`

The multirow subselect will be used in the right hand side of the in operator in the where clause: create table t (a integer); insert into t (a) values (1), (9); drop function if exists f(); create function f() returns void as $$ begin execute ' …
Clodoaldo Neto
  • 118,695
  • 26
  • 233
  • 260
1
vote
1 answer

Drupal 7 theme(''pager') -> table get's rendered but without Pager?

I have a table with data from the database, I would like it to have a Pager, I have all the code from an example (of buildamodule.com) among other sites, and my table get's rendered, but it doesn't generate a pager, although I have more rows then…
1
vote
2 answers

SQL Query (Dynamic?) to Verify Each History Entry Has a Match

I have a stored procedure that is generating a random float number as an ID marker, and as soon as it is called it stores the random number + .1 into a history/logging table, and then the end result is stored with the same random number +.2 (as a…
Saint Ronin
  • 271
  • 1
  • 4
  • 11
1
vote
2 answers

Dynamically selecting table column

I'm using JAVA JPA in spring boot. The scenario is my table is having around 8 columns (suppose id, A,B,C,D,E,F,G,H) from these I want 5 column as result E,F,G,H and only one from A,B,C,D which will be not fixed for every execution. I have written…