C – File Functions

Background Wanted to package up a couple of functions in the C Language that allows one to determine if a file exists. And, also to get the file type and last modification time. We rely in the C function, stat. Coincidentally, it is both a structure and a function. Outline Functions isFileExistsStats Passes file name … Continue reading C – File Functions

ODBC – API – SQLBindParameter – Date, Time – Timestamp – Error Messages

Background Wanted to highlight a few less than intuitive error messages one can run into when trying to work on dates using the SQLBindParameter. BTW,  our programming language is C and ODBC. Code 1) DATE_STRUCT // SQL_C_TYPE_DATE // SQL_TYPE_DATE Code Output 2) SQL_TIMESTAMP_STRUCT // SQL_C_TYPE_TIMESTAMP // SQL_TYPE_TIMESTAMP Code Output 3) SQL_TIMESTAMP_STRUCT // SQL_C_TYPE_TIMESTAMP // SQL_TYPE_TIMESTAMP … Continue reading ODBC – API – SQLBindParameter – Date, Time – Timestamp – Error Messages

Transact SQL – using xp_sscanf to parse input ( Parse Bible Verse )

  Background Let us use xp_sscanf to parse Bible Verse. Introduction Bible people will say my hope rests on John 3:16 An inquiry mind might want to look up John 3:16. In his or her mind, he will break those words down. In computer jargon, one will tokenize it. Tokens Here are the tokens :- … Continue reading Transact SQL – using xp_sscanf to parse input ( Parse Bible Verse )

C – using sscanf to parse input

Background Let us use the C function, sscanf, to parse input. Bible verse Let us say we want to accept bible verses and interpret the input. Example Input Genesis 3:1 sscanf Format %s %d:%d Code Outline Function - requestVerseInput Prompt :- printf Accept Input gets Display Display accepted input Function - parseVerseInput Reset variables sscanf … Continue reading C – using sscanf to parse input

Sharing Code Online – IBM.COM – “SQLDriverConnect() – Use a connection string to connect to a data source”

Background One of the interesting things about blogging is the headache of sharing code online. It is just cumbersome. Sample Courtesy of IBM, here is how teary eye things can be. SQLDriverConnect() - Use a connection string to connect to a data source Link Items Display failure return code Display "completed connection string"; which is … Continue reading Sharing Code Online – IBM.COM – “SQLDriverConnect() – Use a connection string to connect to a data source”