Questions tagged [sqlbuilder]

SqlBuilder is designed to make dynamic SQL tasks easier.

DbExtensions: https://maxtoroq.github.io/DbExtensions/docs/SqlBuilder.html

Laravel 4: https://www.npmjs.com/package/sqlbuilder

Open HMS: https://openhms.sourceforge.io/sqlbuilder/

44 questions
0
votes
1 answer

how to use the cast () function using Sql Builder

I have a query like this, which needs a cast : FROM w.a_w WTable INNER JOIN w.u WuTable ON (WTable.CD = CAST(WuTable.CD AS INTEGER)) But i am not getting how to make this query using SQL Builder as I don't get any Cast() or…
CoderBeginner
  • 717
  • 1
  • 12
  • 39
0
votes
1 answer

Issue related to subquery using sqlbuilder

I need a query like this, which is being generated using sqlbuilder Java functions: SELECT Sum(prod) / Sum( total_prod) AS PROD, Max(year) AS YEAR FROM b.sum SumTable WHERE ( SumTable.bg IN …
CoderBeginner
  • 717
  • 1
  • 12
  • 39
0
votes
0 answers

How to add "WITH" clause to SELECT query with sqlbuilder

I am using Java and SQLBuilder from healthmarketscience.sqlbuilder and I am trying to add WITH clause to my SELECT query dynamiclly. My current query build with: selectQuery.addJoins(SelectQuery.JoinType.LEFT_OUTER, Table.joinToQuery); The expected…
omer blechman
  • 277
  • 2
  • 16
0
votes
1 answer

Problem to convert a SQL query to an Laravel Query Builder

I want to convert this SQL Query to LAravel SQL Builder but i don't know why I already read the laravel documentation but I can't find the answer SQL Query: SELECT CONTRATO, CASE WHEN RAZONSOCIAL IS NULL OR RAZONSOCIAL = '' THEN…
0
votes
0 answers

SQL Builder in Talend

I have to perform incremental load thorough Talend, for that i have to write query in SQL Builder, but it is not returning more than 10 records. For Oracle code i have Tried below 1. Checked SQL -Limit number of row - not working 2. ROWNUM < = 100…
0
votes
1 answer

SQLBuider how to create dynamic query with Talend Open Studio

I have data in excel file which I want to insert into database table. One of the column (name) is connected with another table from db. I would like to make a simple query according to value from excel and put into table only id. Sample of excel…
kek
  • 1
  • 2
0
votes
1 answer

Python smartsql compile insert statement

I want to use sqlbuilder (https://sqlbuilder.readthedocs.io/en/latest/) library for building native queries to sqlite. There is my code for inserting data: import sqlite3 from sqlbuilder.smartsql import Q, T from sqlbuilder.smartsql.dialects.sqlite…
Alexey Nikitin
  • 604
  • 7
  • 22
0
votes
0 answers

DbExtensions SqlBuilder raw query does not make sense

I've been trying to use DbExtensions.SqlBuilder and have encountered a strange behaviour similar to the one in this question Basically when I do var query = SQL .SELECT("ID") .FROM("TABLE") .WHERE("Column1 = {0}", 1); Rather than getting…
Kakalokia
  • 3,191
  • 3
  • 24
  • 42
0
votes
1 answer

Handling data return types with Mybatis SQL Builder

I am relatively new to Java MyBatis. I came across SQL Builder class in MyBatis. However, I don't understand how to handle the result of the SELECT SQL query, especially if the columns are going to be different in each case while using SQL Builder.…
varadark
  • 43
  • 8
0
votes
1 answer

C# SqlBuilder -- How to use Convert dynamically

I have a SQL query: SELECT relationId , CONVERT(date, receivedDate, 10) AS [Date] , matDesc , SUM(amount) , SKU FROM tableName WHERE relationId = 1000 GROUP BY convert(date, receivedDate, 10) , relationId …
Paramone
  • 2,634
  • 4
  • 31
  • 58
0
votes
2 answers

Get raw sql statement with DbExtensions SqlBuilder

I'm using the SqlBuilder to build a dynamic sql statement where the SELECT and WHERE clauses vary. The query is built like this: SqlBuilder sb = new SqlBuilder(); sb.SELECT("id, name"); sb.FROM("products"); sb.WHERE("name LIKE {0}", new…
Ivan-Mark Debono
  • 15,500
  • 29
  • 132
  • 263
0
votes
1 answer

How to insert a java ArrayList in postgresql Array (integer[] ) type column using @InsertProvider

I Have a mapper method which is defined as following @InsertProvider(type = ActivityMapperSQLBuilder.class, method = "insertIntoActivityComment") public int insertIntoActivityComment(@Param("activityComment")ActivityComment…
kenthewala
  • 544
  • 3
  • 8
  • 17
0
votes
1 answer

Update multiple rows using PHP SQLBuilder

I need to edit some PHP that wasn't written by me, I've gotten most of it done but there's a bit I can't figure out the correct syntax for. Basically we grab data from a Google Fusion Table and populate a table with it, once we've edited the data in…
Matthew Paxman
  • 247
  • 2
  • 4
  • 13
-1
votes
1 answer

Dynamic WHERE clause for BETWEEN with Dapper SQL Builder

I am trying to build dynamic WHERE clause with Dapper SQL builder. This works very well for all cases except BETWEEN. Have tried the below approach with BETWEEN (just like IN clause) SqlBuilder sqlBuilder = new SqlBuilder(); var sqlTemplate =…
MahPa
  • 1
1 2
3