question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SELECT TOP @size fails with R2dbcException

See original GitHub issue

Parameter binding is not working at all on the latest snapshot or 1.0.0.M7.

Depending on what you do it says

Binding parameters is not supported for the statement [SELECT TOP $1 * FROM metadata
Binding parameters is not supported for the statement [SELECT TOP :size * FROM metadata
executeMany; uncategorized R2dbcException for SQL [SELECT TOP @size * FROM metadata]; Incorrect syntax near '@size'.; nested exception is R2dbcException{errorCode=102, sqlState='S0001'} io.r2dbc.mssql.MssqlException: Incorrect syntax near '@size'.

A prepared statement is recognized when it contains an @ but parameters which such a character cannot be bound. The documentation says named parameters start with : and indexed with $.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mp911decommented, Mar 18, 2019

You need to pass in a valid SQL statement into the statement creation method via "SELECT TOP " + count + " * FROM metadata".

The exception on OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY is a bug in Spring Data R2DBC that will be adressed with spring-projects/spring-data-r2dbc#55 and spring-projects/spring-data-jdbc#125.

0reactions
stdreyercommented, Mar 18, 2019

I still don’t get the vibe how this is supposed to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reactive Relational Database Connectivity - R2DBC
Drivers throw an instance of R2dbcException when an error occurs during an interaction with a data source. The exception contains the following ...
Read more >
SQL Server Select TOP N rows per group where size less than X
My understanding of your problem: for every date, I want to get all the rows that are, ordered by ID, prior to the...
Read more >
Spring Data R2DBC - Reference Documentation
Limiting the result size of a query with Top and First ... Alternatively, query methods can choose not to use a wrapper type...
Read more >
SQL Server TOP clause performance problem with parallelism
The TOP keyword in SQL Server is a non-ANSI standard expression to limit query results to some set of pre-specified rows.
Read more >
SQL error messages and exceptions - Oracle Help Center
The position argument ' <positionArgument> ' exceeds the size of the BLOB/CLOB. XJ077, Got an exception when trying to read the first byte/character...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found