I have a create account page and on the page I have one button to insert all the details into two seperate tables one of the tables Pictures is dependant on the User table 1:1 relationship via UserID. I have written some code to try get the last insert id so I can insert into the pictures table: Not sure
Tag: sql
How to do a batch insert in MySQL
I have 1-many number of records that need to be entered into a table. What is the best way to do this in a query? Should I just make a loop and insert one record per iteration? Or is there a better way? Answer From the MySQL manual INSERT statements that use VALUES syntax can insert multiple rows. To do
Update cell in jTable using SQL
I want to know how I can update specific cells in jTable (in Java) using SQL. This my try but it doesn’t work. Note: I am working in Netbeans. Answer finally I’ve found the correct answer the following code will explain every thing thanks for every one helped me
How to automatically convert a MySQL column to lowercase
Is there a property that I can add to a column so that it converts its value to lowercase? Instead of doing it for every single value through PHP? Answer You could probably do it through a trigger that fires on insert or update. Myself, I’d rather just create a view that has a lower-case version of the …
sql query: list every song belonging to a particular artist, even though there is no direct foreign key reference between them
I have 4 tables artist (artistID, …) album (albumID, artistID, …) song (songID, …) albumsongs (songID, albumID) and the table that joins the many to many between album and songs – albumsongs …
For VAT tax, what is the correct Decimal(p, s) precision and scale for SQL Server field size declaration?
I am defining VAT rates (European and other countries levy the VAT tax) in a SQL Server database and am wondering what the ideal decimal definition to capture the necessary precision. I have seen VAT rates of: I am curious if there are cases where the VAT rate requires more precision than decimal(4, 3) where …
MySQL OPTIMIZE all tables?
MySQL has an OPTIMIZE TABLE command which can be used to reclaim unused space in a MySQL install. Is there a way (built-in command or common stored procedure) to run this optimization for every table in the database and/or server install, or is this something you’d have to script up yourself? Answer You…
SQL query for today’s date minus two months
I want to select all the records in a table where their date of entry is older then 2 months. Any idea how I can do that? I haven’t tried anything yet but I am on this point: Answer If you are using SQL Server try this: Based on your update it would be:
How to insert a timestamp in Oracle?
I have an Oracle DB with a timestamp field in it. What is the correct SQL code to insert a timestamp into this field?
passing parameters to a stored procedure in C#
How can i send three parameters a to stored procedure in sql? Here is my error: Procedure or function GetIslemIdleri has too many arguments specified. This is my stored procedure: CREATE PROCEDURE …