6,646 questions
3 votes
1 answer
149 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
2 answers
183 views
Does $dbh->prepare() provide any performance benefits for MySQL access?
The DBI docs on prepare() state that it's behaviour differ for various drivers: Drivers for engines without the concept of preparing a statement will typically just store the statement in the ...
0 votes
0 answers
164 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 ...
1 vote
0 answers
83 views
Is this code already SQL injection proof or should I use prepared statements? [duplicate]
I was asked to make this code SQL Injection proof: <?php $connection = mysqli_connect("localhost", "root", "password", "users_db"); $query = "SELECT * ...
0 votes
1 answer
102 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("...
-1 votes
2 answers
102 views
With PHP prepared statements, is there a way to bind a query and have that query executed?
I have the following prepared statement functionality: $stmt = $db->prepare("REPLACE INTO devices (id, type, labels, graphical, technical) values (:id, :type, :label, :graphical, :...
2 votes
3 answers
421 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 ...
0 votes
0 answers
35 views
Why is PgBouncer v1.21 Assigning Different Names to the Same Prepared Statement?
I'm trying to use prepared statements with PgBouncer v1.21 in transaction mode for PostgreSQL 14.3. While enabling prepared statements via PgBouncer, I followed this blog and used the sample code ...
1 vote
1 answer
85 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
265 views
Why is max_prepared_statements = 1 allowing multiple prepared statements in PgBouncer?
I set max_prepared_statements = 1 in PgBouncer and attempted to create multiple prepared statements within a single transaction. Expected Behavior: PgBouncer should either prevent more than one ...
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
356 views
MySQL error with prepared statements: Can't create more than max prepared_stmt_count statements
I'm encountering an issue with my backend database operations resulting in the following error: execute error: Error: Can't create more than max_prepared_stmt_count statements (current value: 16382) ...
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
267 views
Error `bind message supplies 1 parameters, but prepared statement "" requires 0`
I have prepared the query as await db.runSql( `PREPARE fetchDashboards (text, text, text) AS SELECT \* FROM dashboards WHERE tenant_id = $1 AND user_id = $2 AND name = $3`, ); and when I try to ...
0 votes
1 answer
63 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 ...