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

C#: Generating Runtime Query and Executing

I have been working on a project where the requirements of the customer is to provide the configuration access of parsing the RSS Feed in XML Format to user according to his requirement. After selecting the different parameters, a query is generated…
Jibran Khan
  • 3,236
  • 4
  • 37
  • 50
0
votes
1 answer

Express Complex Sub-Select With Dynamic Query

How would you replicate this SQL ( Sub-select ) with an equivalent Liferay DynamicQuery expression within a ServiceImpl Class: SELECT * FROM journalarticle WHERE (urlTitle,version) IN ( SELECT urlTitle,MAX(version) FROM journalarticle WHERE…
Olaseni
  • 7,698
  • 16
  • 44
  • 68
0
votes
2 answers

Pre Populating a PHP Dynamic Select Option with Stored Session Variable

Im scratching my head once again and need your help. What I have is a form that submits to a second page, with sessions enabled, i am storing the name value 2 fields on the form and setting their value names in the session so that if a user returns…
Tazzy
  • 17
  • 6
0
votes
1 answer

How to create temp table from a dynamic query?

I want to create dynamic query for paging [Main Motive], here is my code: Alter proc proc_GetData ( @TableName varchar(500)='tblPropertyType', @PrimaryKey varchar(500)='Id', @Columns varchar(max)='PropertyType', @WhereCondition…
Ram Singh
  • 6,664
  • 35
  • 100
  • 166
0
votes
1 answer

Dynamic "INSERT INTO" Query with User Defined Type

I have got a SQL-Table were eache line consists a singel Value of some kind of Virtuel-Tabel - means the real existig SQL-Table looks like this: ----------------------------------------- |DataRecordset | DataField | DataValue …
0
votes
1 answer

Dynamic Query w/ Quotes issue

I'm trying to write a dynamic query that produces the same results as the following, but replaces the fixed tablename with a variable. SELECT * WHERE tableName = 'Table2A' works fine but DECLARE @tablename AS NVARCHAR(100) SET…
Steve Wash
  • 986
  • 4
  • 23
  • 50
0
votes
3 answers

PHP+MongoDB dynamic queries - adding conditional operators

I am making use of dynamic queries in mongoDB, by using them this way: $query['clicks'] = array('$gt' => 6); $query['lang'] = "de"; $cursor = $collection->find($query); The question is pretty simple and straightforward: how can one add 'OR'…
john smith
  • 1,963
  • 2
  • 17
  • 16
0
votes
1 answer

Liferay 6.1: Class not found with DynamicQuery

I have a portlet project that needs to do some Group querying. I've not created the project but it was made with the Eclipse Liferay SDK plugin. I've added a DynamicQueryFactoryUtil.forClass(Group.class) but it fails in runtime. It complains about…
helios
  • 13,574
  • 2
  • 45
  • 55
0
votes
2 answers

How to execute a dynamic query (create trigger) from a function?

I am new to PostgreSql, I am using version 8.3. I need to create a function which checks if a table has a specific trigger or not. If the trigger exists, I need drop it. I am generating the drop query as given below: var_DropTriggerSqlPart = 'drop…
Arun
  • 2,217
  • 3
  • 17
  • 18
0
votes
2 answers

Liferay DynamicQuery - xPath and Array comparison

My final goal is I want to get plid and portletId that can be display my article(or entry with any type if it is possible). I have sql query that return me any portlet availble for display my article. But when I have to use dynamicQuery to get the…
user1487380
  • 362
  • 2
  • 9
  • 26
0
votes
2 answers

transforming a SQL query to dynamic query with joins or subquery

I've a SQL query (2 variants) and I need to use it with dynamic queries. In SQL it looks so (Variant 1 // via subquery): SELECT AssetEntry.entryId , ( SELECT COUNT(*) FROM `MBMessage` WHERE classPK =…
appsthatmatter
  • 6,347
  • 3
  • 36
  • 40
0
votes
3 answers

Order by another table with Liferay's DynamicQuery

I have a problem while I'm making a Dynamic Query in Liferay 6. I'm trying to make a query to order JournalArticles based on their view count. The view count is specified in another table (AssetEntry). I'm stuck with this: DynamicQuery query =…
user1537617
  • 1
  • 1
  • 1
0
votes
2 answers

Access 2010: Display contents of multiple records to unbound controls in datasheet

I'm using a dynamic pass-through query in Access 2010 to retrieve one or more records from a back-end database. After much trial and error, I plagiarized enough of the right code to retrieve the appropriate records and assign them to unbound…
DUHdley d'Urite
  • 187
  • 3
  • 15
0
votes
1 answer

What is the best way to get rows from different databases?

I have 10 identical databases. I get the database names at runtime. I want to store rows into a collection of objects. I also only want one hit on the database server. My current approach:- In a query (no stored procedures for X reason) I get…
om471987
  • 5,398
  • 5
  • 32
  • 40
-1
votes
2 answers

SQL SERVER execute user define function using Table Type value as parameter + dynamic query execution

I have issue with dynamic query execution in sql server. I have a sql function FUNC_STOCK_VALUATION_COST_TTYPE which gives me result. I am calling this function. using below method: DECLARE @DynamicParameterValue AS Nvarchar(MAX)= '''2023-07-04'',…
Parth M. Dave
  • 853
  • 1
  • 5
  • 16
1 2 3
22
23