Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

namedparameterjdbctemplate issue [DATAJDBC-117] #351

Closed
spring-projects-issues opened this issue Jul 20, 2017 · 4 comments
Closed

namedparameterjdbctemplate issue [DATAJDBC-117] #351

spring-projects-issues opened this issue Jul 20, 2017 · 4 comments
Assignees
Labels
in: repository status: declined type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jul 20, 2017

rajashekar opened DATAJDBC-117 and commented

hi,
i am using the namedparameterjdbctemplate in my DAO for reading one table data and insert into another table.suppose here two student and student_details.
"insert into student_details (id,name,age,fees)"+
"select * from student(id,name,age where name=:name order by studentid ASC)

the problem here when I run query this in the database it is saving

id
1
10
11
12
2
20
21
but expected output:
id
1
2
3
4
5

"select * from student(id,name,age where name=:name order by studentid ASC)
the above query successfully working in Oracle database.

can you please help me to understand how to write the query to get the expected result


No further details from DATAJDBC-117

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 21, 2017

rajashekar commented

please give any suggestions on this

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 21, 2017

Jens Schauder commented

NamedParameterJdbcTemplate is part of the Spring Framework proper, so any issues should be reported there: https://jira.spring.io/browse/SPR

But this isn't an issue with NamedParameterJdbcTemplate, since your statement is executed just fine and I'm sure that you'll get the same order of results if you execute that statement against your database using JDBC directly (or any tool able to execute select statements).

So this is really more a question about how to use NamedParameterJdbcTemplate or SQL in general. The recommended place to ask such questions is https://stackoverflow.com/ And it looks like someone already did: https://stackoverflow.com/questions/16519648/sql-for-ordering-by-number-1-2-3-4-etc-instead-of-1-10-11-12

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 21, 2017

rajashekar commented

Thank you very much jens for providing the valuable suggestion

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 22, 2019

Jens Schauder commented

Batch closing resolved issues without a fix version and a resolution that indicates there is nothing to be released (Won't Do, Won't Fix, Invalid ...)

@spring-projects-issues spring-projects-issues added type: bug status: declined in: repository labels Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: repository status: declined type: bug
Projects
None yet
Development

No branches or pull requests

2 participants