B
Bill Sturdevant
(I inadvertently posted this question in the Forms
Programming Forum, so please excuse the double post)
I am using the SQL statement below to insert a bunch of
records into a table. I want to generate an Index Number
for each record that is sequential. I cannot use an
autonumber field.
Generate_Next_Sequential_Index_Num() is a routine that
accesses a public variable and bumps it by 1
The problem is, Generate_Next_Sequential_Index_Num() only
gets called ONCE in the query and every inserted record
then gets the value returned from that single call.
What am I doing wrong?
INSERT INTO Tbl_myTable ( Index_Number, Portfolio_Name )
SELECT DISTINCT Generate_Next_Sequential_Index_Num() AS
Expr1, Temp_Input_File.Portfolio_Name
FROM Temp_Input_File;
Programming Forum, so please excuse the double post)
I am using the SQL statement below to insert a bunch of
records into a table. I want to generate an Index Number
for each record that is sequential. I cannot use an
autonumber field.
Generate_Next_Sequential_Index_Num() is a routine that
accesses a public variable and bumps it by 1
The problem is, Generate_Next_Sequential_Index_Num() only
gets called ONCE in the query and every inserted record
then gets the value returned from that single call.
What am I doing wrong?
INSERT INTO Tbl_myTable ( Index_Number, Portfolio_Name )
SELECT DISTINCT Generate_Next_Sequential_Index_Num() AS
Expr1, Temp_Input_File.Portfolio_Name
FROM Temp_Input_File;