Click here to Skip to main content
15,898,035 members
Home / Discussions / Database
   

Database

 
QuestionOracle Error Pin
Member 867725124-Mar-14 19:49
Member 867725124-Mar-14 19:49 
AnswerRe: Oracle Error Pin
Kornfeld Eliyahu Peter24-Mar-14 20:13
professionalKornfeld Eliyahu Peter24-Mar-14 20:13 
GeneralRe: Oracle Error Pin
Member 867725124-Mar-14 20:38
Member 867725124-Mar-14 20:38 
GeneralRe: Oracle Error Pin
Jörgen Andersson24-Mar-14 21:34
professionalJörgen Andersson24-Mar-14 21:34 
AnswerRe: Oracle Error Pin
Member 1043154927-Mar-14 0:28
Member 1043154927-Mar-14 0:28 
QuestionComplex Query Pin
#realJSOP24-Mar-14 4:18
professional#realJSOP24-Mar-14 4:18 
AnswerRe: Complex Query Pin
Simon_Whale24-Mar-14 4:46
Simon_Whale24-Mar-14 4:46 
GeneralRe: Complex Query Pin
#realJSOP24-Mar-14 5:53
professional#realJSOP24-Mar-14 5:53 
QuestionGrouping Results by ElectionName Pin
samflex19-Mar-14 10:44
samflex19-Mar-14 10:44 
AnswerRe: Grouping Results by ElectionName Pin
Jörgen Andersson19-Mar-14 11:02
professionalJörgen Andersson19-Mar-14 11:02 
AnswerRe: Grouping Results by ElectionName Pin
Mycroft Holmes19-Mar-14 12:52
professionalMycroft Holmes19-Mar-14 12:52 
GeneralRe: Grouping Results by ElectionName Pin
samflex19-Mar-14 13:12
samflex19-Mar-14 13:12 
GeneralRe: Grouping Results by ElectionName Pin
Mycroft Holmes19-Mar-14 14:05
professionalMycroft Holmes19-Mar-14 14:05 
GeneralRe: Grouping Results by ElectionName Pin
samflex19-Mar-14 14:13
samflex19-Mar-14 14:13 
GeneralSSIS - Truncation may occur due to inserting data Pin
Smith201418-Mar-14 2:59
Smith201418-Mar-14 2:59 
AnswerRe: SSIS - Truncation may occur due to inserting data Pin
Kornfeld Eliyahu Peter18-Mar-14 3:00
professionalKornfeld Eliyahu Peter18-Mar-14 3:00 
GeneralRe: SSIS - Truncation may occur due to inserting data Pin
Smith201418-Mar-14 3:07
Smith201418-Mar-14 3:07 
AnswerRe: SSIS - Truncation may occur due to inserting data Pin
Kornfeld Eliyahu Peter18-Mar-14 3:11
professionalKornfeld Eliyahu Peter18-Mar-14 3:11 
GeneralRe: SSIS - Truncation may occur due to inserting data Pin
jschell18-Mar-14 8:44
jschell18-Mar-14 8:44 
GeneralRe: SSIS - Truncation may occur due to inserting data Pin
Mycroft Holmes18-Mar-14 12:55
professionalMycroft Holmes18-Mar-14 12:55 
QuestionSSIS - Truncation may occur due to inserting data Pin
Smith201418-Mar-14 2:54
Smith201418-Mar-14 2:54 
QuestionInserting a new record into 2 tables at the same time Pin
jkirkerx17-Mar-14 11:49
professionaljkirkerx17-Mar-14 11:49 
I took Jorgen's advice and modified my Movie database

I split the table into 2, the first table being movie information and the 2nd table being FLV information

So I can do the JOINs in displaying the data, and using it to create a Flash Movie Player,

But it just dawned on me that I have no clue on how to insert and update records for my new setup here.

So I came up with this.

My question, am I on the right track here, Inserting the first table, getting the ID of the record so I can use the ID in the 2nd table?

Or is there a better way in which I can insert in one shot?
I'm not ready to write stored procedures yet, in case that is suggested.

INSERT INTO MovieInfo(
   MovieName, MovieType, MoviePath, MoviePostage, MovieThumbnail, flv, h264
)
VALUES(
   @MovieName, @MovieType, @MoviePath, @MoviePostage, @MovieThumbnail, @flv, @H264
);
DECLARE @mID AS INT;
SET @mID = (
   SELECT MovieID FROM MovieInfo WHERE MovieName=@MovieName
)
INSERT INTO MovieInfo_flv(
 movieID, flv_movieName, flv_skin, flv_folderpath, flv_filename
)
VALUES(
   @mID, @flv_movieName, @flv_skin, @flv_folderpath, @flv_filename
)


modified 17-Mar-14 18:07pm.

AnswerRe: Inserting a new record into 2 tables at the same time Pin
Mycroft Holmes17-Mar-14 19:48
professionalMycroft Holmes17-Mar-14 19:48 
GeneralRe: Inserting a new record into 2 tables at the same time Pin
jkirkerx19-Mar-14 13:21
professionaljkirkerx19-Mar-14 13:21 
GeneralRe: Inserting a new record into 2 tables at the same time Pin
Mycroft Holmes19-Mar-14 14:10
professionalMycroft Holmes19-Mar-14 14:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.