Click here to Skip to main content
15,912,507 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL DATABASE Pin
SilimSayo10-Sep-10 8:23
SilimSayo10-Sep-10 8:23 
QuestionVariants of SQL Server Pin
john john mackey26-Aug-10 6:14
john john mackey26-Aug-10 6:14 
AnswerRe: Variants of SQL Server Pin
Estys26-Aug-10 6:42
Estys26-Aug-10 6:42 
GeneralRe: Variants of SQL Server Pin
john john mackey26-Aug-10 7:12
john john mackey26-Aug-10 7:12 
GeneralRe: Variants of SQL Server Pin
Estys26-Aug-10 7:42
Estys26-Aug-10 7:42 
GeneralRe: Variants of SQL Server Pin
Mycroft Holmes26-Aug-10 13:19
professionalMycroft Holmes26-Aug-10 13:19 
GeneralRe: Variants of SQL Server Pin
PIEBALDconsult27-Aug-10 3:18
mvePIEBALDconsult27-Aug-10 3:18 
GeneralRe: Variants of SQL Server Pin
PIEBALDconsult27-Aug-10 3:21
mvePIEBALDconsult27-Aug-10 3:21 
AnswerRe: Variants of SQL Server Pin
Steve Maier26-Aug-10 7:39
professionalSteve Maier26-Aug-10 7:39 
GeneralRe: Variants of SQL Server Pin
john john mackey26-Aug-10 7:49
john john mackey26-Aug-10 7:49 
QuestionSQL Joins Help Pin
Jammer26-Aug-10 2:03
Jammer26-Aug-10 2:03 
AnswerRe: SQL Joins Help Pin
scottgp26-Aug-10 2:45
professionalscottgp26-Aug-10 2:45 
AnswerRe: SQL Joins Help Pin
Mycroft Holmes26-Aug-10 2:48
professionalMycroft Holmes26-Aug-10 2:48 
GeneralRe: SQL Joins Help Pin
Jammer26-Aug-10 3:40
Jammer26-Aug-10 3:40 
QuestionSet value of Excel cell to the result of a query [modified] Pin
anthasaurus25-Aug-10 23:12
anthasaurus25-Aug-10 23:12 
AnswerRe: Set value of Excel cell to the result of a query Pin
Eddy Vluggen26-Aug-10 7:20
professionalEddy Vluggen26-Aug-10 7:20 
QuestionBest way to merge/process commands on SQLCE Pin
Spawn@Melmac25-Aug-10 5:23
Spawn@Melmac25-Aug-10 5:23 
AnswerRe: Best way to merge/process commands on SQLCE Pin
David Mujica25-Aug-10 5:39
David Mujica25-Aug-10 5:39 
AnswerRe: Best way to merge/process commands on SQLCE Pin
Eddy Vluggen25-Aug-10 7:54
professionalEddy Vluggen25-Aug-10 7:54 
GeneralRe: Best way to merge/process commands on SQLCE Pin
Spawn@Melmac25-Aug-10 14:22
Spawn@Melmac25-Aug-10 14:22 
GeneralRe: Best way to merge/process commands on SQLCE Pin
Eddy Vluggen26-Aug-10 7:19
professionalEddy Vluggen26-Aug-10 7:19 
GeneralRe: Best way to merge/process commands on SQLCE Pin
Spawn@Melmac26-Aug-10 11:08
Spawn@Melmac26-Aug-10 11:08 
Ok here you go but I should warn you I don't fully understand it myself.

I think of an accessor as a wrapper to the SQL like this (which is an extract from working code)...

class CDBHubDetails
{
public:
// Data Elements
	TCHAR	f_LocSub[255];
	int		f_HubID;						// Input field

// Column binding map
BEGIN_COLUMN_MAP(CDBHubDetails)
   COLUMN_ENTRY(1, f_LocSub)
END_COLUMN_MAP()

// Parameter binding map
BEGIN_PARAM_MAP(CDBHubDetails)
   SET_PARAM_TYPE(DBPARAMIO_INPUT)
   COLUMN_ENTRY(1, f_HubID)
END_PARAM_MAP()

DEFINE_COMMAND_EX(CDBHubDetails, L" \
     SELECT  Hub.SubLoc \
     FROM    Location  \
     WHERE   Hub.id = ?")
};


Now this get's used as follows

CCommand<CAccessor<CDBHubDetails > > rs;

rs.f_HubID = pHub->m_iHubID;                                                 // pull the HubID from the CDevice object
hr = rs.Open(m_oDB->session);


where I can then walk the recordset.

The thing is I have not figured out how to process the additional SELECT command I need to include in the INSERT operation so I can retrieve the ID of the item inserted.

Now I know I am being both optemistic, and lazy, but I was hoping that as the INSERT does not return a recordset itself, the SELECT @@IDENTITY would become the result. Silly me...

The responses thus far have given me some ideas but finding examples I can learn from is proving difficult. MSDN seems devoid of C++ examples in the documentation (although F# is there!).

Thank you for taking the time to look at this for me.
Alan

GeneralRe: Best way to merge/process commands on SQLCE Pin
Eddy Vluggen27-Aug-10 7:04
professionalEddy Vluggen27-Aug-10 7:04 
QuestionODP.Net Vs OleDb Pin
V.25-Aug-10 3:51
professionalV.25-Aug-10 3:51 
AnswerRe: ODP.Net Vs OleDb Pin
dan!sh 25-Aug-10 5:31
professional dan!sh 25-Aug-10 5:31 

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.