Rank: 183444 based on 0 downloads (last 30 days) and 0 file submitted
photo

Benny Leung

E-mail

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Benny Leung View all
Updated File Comments Rating
08 Sep 2013 upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven

By the way, this is a fantastic function!

08 Sep 2013 upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven

Hi Sven,

Can you give me some insights as to why i am getting this error?

Error using database/fastinsert (line 259)
Java exception occurred:
sun.jdbc.odbc.JdbcOdbcBatchUpdateException: [Microsoft][ODBC SQL Server
Driver][SQL Server]Violation of PRIMARY KEY constraint 'PK_CAISO_daLMP'. Cannot
insert duplicate key in object 'dbo.CAISO_daLMP'.

at sun.jdbc.odbc.JdbcOdbcPreparedStatement.emulateExecuteBatch(Unknown
Source)

at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeBatchUpdate(Unknown
Source)

at sun.jdbc.odbc.JdbcOdbcStatement.executeBatch(Unknown Source)

Error in upsert (line 165)
insertFcn(conn,tableName,fieldNames,data(insertMask,:));
Error in upsert (line 66)
insertMask(dataInds) = ...
Error in CRRdb/daLMP (line 87)
daLMP = upsert(dbConn,tableName,daLMP.Properties.VarNames,[1 1 1 0 0
0],data4Load);

Benny

05 Sep 2013 upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven

can someone please give me a hand on this? i got the following error

Subscript indices must either be real positive integers or logicals.

Error in upsert (line 111)
keyFieldsCell = fieldNames(keyFields);

05 Sep 2013 upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven

can someone please give me a hand on this? i got the following error

Subscript indices must either be real positive integers or logicals.

Error in upsert (line 111)
keyFieldsCell = fieldNames(keyFields);

05 Sep 2013 upsert - automatically handles database inserts/updates If a data row already exists, UPDATE that row! If it doesn't exist, INSERT that row! Author: Sven

can someone please give me a hand on this? i got the following error

Subscript indices must either be real positive integers or logicals.

Error in upsert (line 111)
keyFieldsCell = fieldNames(keyFields);

Contact us