Skip to content
Advertisement

Variables in TOAD scripts

I have a SQL script that is being executed in TOAD. Currently, I have it laid out with just statement after statement, thusly: And so on. Some of the where clauses end up being repetitive because I have complex inner queries to get particular IDs to operate on. I’d like to capture the ID in the beginning of the script

Seeing the underlying SQL in the Spring JdbcTemplate?

I am learning about the wonders of JdbcTemplate and NamedParameterJdbcTemplate. I like what I see, but is there any easy way to see the underlying SQL that it ends up executing? I’d like to see this for debug purposes (in order to for example debug the resulting SQL in an outside tool). Answer The Spring documentation says they’re logged at

Does SQLite support replication?

In an application which embeds SQLite3 and uses an in-memory database, is it possible to replicate the database between two running instances of the application? I could do this by hand with a homebrew protocol duplicating all my DB accesses, but it seems like something that should be done inside the DB layer. Answer Brute force approach: Send it the

Database design, which table has the foreign key

I have an Table USER (USER_ID, PASSWORD, NAME, …) and an Table ACCESS_ROLES for the Users, every user can have one ACCESS_ROLE (ONE-TO-ONE). Which table has the Foreign Key? I would put the USER_ID into ACCESS_ROLES table. Is there any best practice approach? Answer Since you will be having a one-to-one relationship, the solution suggested by Philip Kelley is better.

Advertisement