This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!

Stefan Jankovic

Ranch Hand
+ Follow
since Mar 31, 2021
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
4
Received in last 30 days
0
Total given
27
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Stefan Jankovic

@TimMoores Yes, I could do that but I would like to do it from a data layer

@TimHolloway Thanks for the detailed answer. I don't want row numbers. I want an incrementing value from my own variable (like a for loop). I wanted to know if that is possible in SQL language.
Hello,

Is there any way I can actually increment an integer variable and show its value for each record in my table?

Let's say my table Student has columns fname, lname. I would like to have a result set as (3 columns & more rows):


Note that 1,2 and 3 are not indexes, but generated values for each result set that keeps incrementing starting numbers from value 1.
We all know what enums in MySql are. But what data type does it use behind the curtains? How can I find that out? Is it varchar or what?
Does anyone have a reference on which I can find it out? Thanks!
Hahaha yeah I would like to see generated SQL query that Hibernate does for us It would solve our problems I think hehe. Any chance it exists, I mean have you even encountered someone doing it?
2 months ago
I used queries like:

, which worked fine.

Yep, I noticed that - it indeed came from JDBC. Is there any chance I can see the full generated query command as this is the only thing I am shown (except long stack trace that doesn't help)?
2 months ago
Yes, I had the same thought - "order" being a reserved word. But as I mentioned, queries worked fine in Workbench which makes this confusing for me.
2 months ago
I have a table called "order" in MySQL that is populated with columns and rows. Every query works fine when I run native SQL queries in Workbench.

Problem arrises when I use Spring data JPA and call method findAll(). What I get is:


I renamed table to "order_test" with same columns and rows and it worked fine. Can someone tell me why it didn't work? What went wrong?
2 months ago
I had both MySql Server and Workbench with the same version -8.0.26 which worked smoothly. Then I needed to downgrade the Server to 5.7 for my work.

After I uninstalled everything, I installed MySql Server 5.7, but I noticed the versions for Workbench are only 8+. So I installed the latest possible.

It all looked good until I tried to export something, that gave me this warning(attached image). Can someone tell me the steps I do now? What is mysqldump.exe even and how do I downgrade it?

Is there any fast way how I can do it? Typing doesn't work, unfortunately.
3 months ago
Can someone tell me how to solve this problem the easiest way?
I have String 202104 that I want to turn into Date. So, it means it would be year 2021, month 4 and day 00.
3 months ago
Then what does @Temporal even do? Just formats Date object?
3 months ago
So far I used MySQL's DATE data type, which I mapped like:

I hoped that changing temporal's value from DATE to TIME would work. Unfortunately, it throws an exception. What can be done now? Is there an alternative?

P.S. Why I must keep part: new Date();? Shouldn't it be mapped to the current Date if I omit that field from Postman? If I omit it, I get null.
3 months ago
Hmmm I don't know. I am using IntelliJ.
4 months ago