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
1
vote
0 answers

Multiple Criteria Where in Spring Data MongoDb

I want using @Query in Spring Data Mongodb What is an equal for Spring Data MongoDb Query to this method? I want to make a method to search based on the field and value that send by the someone when invoked method. public List < Party >…
1
vote
1 answer

Dynamic SQL query giving an error (syntax to use near ' ) in PhpMyAdmin other versions except (5.2.0, 5.1.1, 5.0.0)

I want to transpose mysql rows to columns using Dynamic query i accomplished the query with expected results. the Query is working in my localhost PhpMyAdmin version 5.2.0 without any error but I'am getting a syntax error in other PhpMyAdmin…
1
vote
1 answer

ADF Dynamic Query: Insert the outcome of an activity into a table

I'm new to ADF and I'm trying to use the dynamic query to build a script where the outcome of one activity is inserted into another table. On the "Reading Data" activity, I have a simple script that is reading few records off a table from Synapse…
SusanD
  • 143
  • 9
1
vote
1 answer

Add Column to Result of Postgres Dynamic Query

I have a table that looks like this: | Scenario| Date | System | Result | | ------- | ------ | ------ | ------ | | Proj1 | 07-01 | A | PASS | | Proj1 | 07-01 | B | PASS | | Proj1 | 07-01 | C | PASS | | Proj1 |…
1
vote
1 answer

Crafting a Subquery-able UNION ALL based on the results of a query

Data I have a couple of tables like so: CREATE TABLE cycles ( `cycle` varchar(6) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `cycle_type` varchar(140) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `start` date DEFAULT NULL, `end` date DEFAULT…
1
vote
2 answers

how to dynamically unpivot only those columns with a specific suffix in bigquery

I have a table with a large number of columns (around 900 columns, which makes it unfeasible to individually write all the column names). How can I dynamically unpivot only the columns with the suffix '_next' & '_last' (there are hundreds of such…
Sanjana
  • 35
  • 6
1
vote
3 answers

Mule 4 dynamic queries in the Database Connector

In my flow in Mule 4 I am trying to query a database for specific data. For example I want to run a query like this: SELECT * FROM mulesoft WHERE plant = CCCNNB; The thing is both plant and CCNNB need to be dynamic. They will come through an API…
davidb
  • 1,503
  • 4
  • 30
  • 49
1
vote
1 answer

Dynamic queries and JpaSpecificationExecutor in Spring

I am trying to create a simple Spring project where restaurants can add menu items to shared database and users can use a html form to search the dishes based on a range of criteria- especially dietary requirements Form example: Restaurant Name:…
1
vote
0 answers

Execute SQL by string dynamic in stored procedure in Sybase

I've tried this: AS DECLARE @sql nvarchar(15000) BEGIN IF @X=1 BEGIN SELECT * FROM X_TABLE_NAME return END ELSE IF @X=2 BEGIN SET @sql = N'SELECT '+@COLUMNS + ' FROM X_TABLE_NAME ' EXEC (@sql) …
Karen
  • 11
  • 2
1
vote
1 answer

Dynamic SQL query which calculates the revenue generated for first X days since the onboarded Date

Consider the following datatables. 1. Customer Table id name onboarded_date 1 xxxx 2021-10-01 2 yyyy 2021-10-02 3 zzzz 2021-10-05 2. Revenue…
1
vote
1 answer

Linq.Dynamic.Core failing for DateTime condition

I am trying to build a dynamic query using Linq.Dynamic.Core. So the idea is that the query needs to execute based on various conditions like Contains,AND,OR. All of those are working fine but greater than and less than a date value is failing. I…
TheFallenOne
  • 1,598
  • 2
  • 23
  • 57
1
vote
1 answer

Dynamic linq query for date comparison asp.net core

I have a simplified version of dynamic main query as follows : var items = context.itemsGalore.Where(where).ToList(); The where for the Where condition is built dynamically as below. if(compare == "Greater") { where = String.Format("{0} > {1}",…
The_Outsider
  • 1,875
  • 2
  • 24
  • 42
1
vote
1 answer

Save dynamic query to variable in postgres stored procedure

I have the following postgres stored procedure: CREATE OR REPLACE PROCEDURE schema.MyProcedure() AS $$ DECLARE RowCount int; BEGIN SELECT cnt INTO RowCount FROM ( SELECT COUNT(*) AS cnt FROM MySchema.MyTable …
1
vote
1 answer

SQL Take filter from a value from a column in a table

I have a table with different columns. Each column contains a filter. Course Filter1 Filter2 First and startdate > '20200101' and active = 0 Second and startdate > '20210101' and active = -1 I want to dynamically create a SQL with…
Nikka
  • 11
  • 1
1
vote
2 answers

Use MySQL Query Execution Plan for Detecting SQL Injections

I have a project that requires we allow users to create custom columns, enter custom values, and use these custom values to execute user defined functions. Similar Functionality In Google Data Studio We have exhausted all implementation strategies…