All Questions
Tagged with parameterized-query or prepared-statement
6,648 questions
3
votes
1
answer
148
views
postgres: parameterized query with pattern matching
in node, i'm creating the following query:
let sql_query = "\
SELECT \
... \
WHERE \
FACILITY_ID = $1 \
AND (EVENT_START_TIME_UNIX_MS < $2) \
AND (...
0
votes
0
answers
158
views
Spring Boot with mariadb-java-client, AWS JDBC Wrapper, and HikariCP: PreparedStatement executeBatch Only Works with Single Statement in Batch
I have a Spring Boot application that connects to an Amazon Aurora MySQL-compatible database. The setup uses the MariaDB JDBC driver, the AWS JDBC wrapper, and HikariCP for connection pooling.
My code ...
0
votes
1
answer
101
views
Shortcut for Question marks in preparedStatement for parameterized query [duplicate]
I have a table with 200 columns. I am trying to prepare an "insert into this table" from excel file to a database table. I should put 190 question marks more.
ps = con.prepareStatement("...
2
votes
3
answers
403
views
What's the benefit to using execute over query in mysql2?
When using the NodeJS mysql2 library, I am trying to understand the differences between Connection.execute and Connection.query.
As I understand it, query prepares the statement locally and then makes ...
1
vote
1
answer
84
views
How to perform a multi row insert in postgres with a prepared statement
I'm trying to use the multi row insert with postgres
INSERT INTO table_name (column_list)
VALUES
(value_list_1),
(value_list_2),
...
(value_list_n);
on a list of Strings that can of course be of ...
0
votes
0
answers
32
views
In PHP I don't get the result I have in PHPmyAdmin [duplicate]
I am trying to use MySQL CONCAT_WS in a PDO Prepared Statement. I tested the query inside of phpMyAdmin and it works perfectly but not in a PDO Prepared Statement.
Here is the phpMyAdmin query which ...
0
votes
0
answers
28
views
Goland PSQL prepared statement always throwing error when updating JSONB value for a key
I'm getting myself confused I think, but I am trying to update a value in a JSON object (jsonb column) of a psql database like so
func updateProfileLessonProgress(userID string, lessonID, currentSlide ...
0
votes
1
answer
58
views
Transaction JDBC Java Insert does not Insert/Update entrys in table
For my work i need to create several PrepareStatements which are inserted in my table. Normally i have no problem with this, but this problem don't make any sense to me.
I work in a give environment ...
0
votes
1
answer
77
views
Python tkinter treeview and MySQL queries [closed]
How to populate a treeview with results from many tables?
I've a set of tables: athletes, grades, categories, rel_ath_grad_cath.
athletes
grades
categories
rel_ath_grad_cath
id_ath
id_grad
id_cat
...
1
vote
1
answer
308
views
Execute Prepared Statement in a Stored Procedure in Informix
I am using Informix 12.10 on most of my systems, and I am trying to run this using dbaccess on a Windows server. I am trying to understand how to work with stored procedures and prepared statements. ...
0
votes
1
answer
28
views
How to Execute Parameterized Queries in GridDB Using the Python Client?
I'm using the GridDB Python client to interact with my time-series data. I want to execute a parameterized query to prevent SQL injection and handle dynamic values efficiently.
When I run the code I ...
0
votes
3
answers
215
views
Add a limit parameter
In Oracle I can have an SQL string like this
select * from table where rownum <= ?
Then in a PreparedStatement I can set the rownum as a parameter.
How does it work with PostgreSQL JDBC (Java) ...
1
vote
1
answer
52
views
How to batch modify plenty of mysqli procedural queries to prepared statements?
I would like to modify once for all my old styles queries to prepared statements and get rid of the care for mysqli escaping etc.
After analysis, I decided to stick with mysqli prepared statements.
I ...
0
votes
2
answers
52
views
Handling individual Java batch statement's execution status
I have thousands of statements to be executed as batches, and if one of them fails due to a UNIQUE constraints, then how do I detect them separately (one with success and the rest with failures) and ...
2
votes
1
answer
74
views
Using LIKE with % when executing SQL queries with placeholders for parameters
I have a project with PostgreSQL database where queries are stored in SQL files and executed using namedParameterJdbcTemplate#queryForList method. Meaning that parameters are stored in the queries ...
1
vote
1
answer
80
views
Use JDBC placeholder into string literal
looking for a way to submit parameterized queries through dblink (PostgreSQL) using JDBC (PreparedStatement).
This is a sample query I want to use:
select * from dblink('host=localhost user=*** ...
0
votes
0
answers
103
views
Avoid casting to string in parameterized query on JSON column, MySQL
To avoid SQL injection, we use a parameterized query with ActiveRecord, such as:
House.where("year_built > ?", 2000)
which works great (the example above is not optimal, because it could ...
0
votes
2
answers
236
views
Bulk insert into a postgres table that has an array column with parameterized query
I have the following table:
┌────────────────┬─────────────────────────────┬───────────┬──────────┬──────────────────────────────────────────────────────────────────┐
│ Column │ ...
1
vote
1
answer
63
views
PHP PDO error - SQLSTATE[HY093]: Invalid parameter number
could someone have a look at my code and help me figure out what is causing the error in my PDO query.
The query works fine when I search by "Department", "Datarange", "...
0
votes
0
answers
97
views
Trying to update table using PreparadStatement, But parameters are generated inside a Parentheses
Using JDBC connection in Java framework, Am updating column values my lfvadd table.
this is my sample code :
PreparedStatement pst = null;
String sql = ("UPDATE lfvadd SET recipe_name = ? WHERE ...
3
votes
2
answers
1k
views
DuckDB - Filename as a parameter in COPY TO statement
Python & DuckDB 1.0
I'm trying to copy a table to a parquet file with the filename passed as a parameter in a prepared statement.
Using a fixed filename works:
def table2parquet(con):
con....
0
votes
1
answer
34
views
executing an mysql update statement held on a table
I am trying to execute update statements that are stored on a table. I must first select the row that the update statement is on to get the statement, then I need to execute that update statement.
I ...
-1
votes
1
answer
615
views
Need variables in parameterized view in clikhouse
I need variable in parametrized view.
CREATE VIEW my_new_view AS
SELECT
CampaignName,
sentiment, -- **CASE WHEN variable** = sentiment THEN sentiment ELSE NULL END AS sentiment_match
COUNT(CASE ...
2
votes
1
answer
211
views
Informix PrepareStatement throws error - "A character to numeric conversion process failed" when LIMIT clause is added to query
I have a sql query which works fine until a LIMIT clause is added to the end of the query.Below is the query:
String query = SELECT * FROM customer
WHERE acct = ?
AND cust_id = ?
AND call_status ...
-1
votes
2
answers
86
views
How to perform a select by sections since it contains many records using Java?
I have a table which contains approximately 100,000 records, I did a SELECT to obtain the total number of records because it can vary, I need to consult the table and obtain all the records of 4 ...