The Latest

DevX - Software Development Resource

Get Server Time at Workstation

Question: We want to timestamp transactions on an application that is not yet using a client/server database. Is there a Windows 2000 API that programmatically gets the server time? Answer:

DevX - Software Development Resource

Problem with Streams

Question: Why does a simple program such as the following produce compilation errors? #include#includeusing namespace std;int main(){ ostream_iterator os(cout); vector vi(3,0); os=vi[0]; os++; os=vi[1]; return 0;} I use the Microsoft

DevX - Software Development Resource

SELECT Using LIKE

Question: Can I use LIKE across all columns in a single table without having to name each column specifically? Answer: You cannot do this as a direct query against a

DevX - Software Development Resource

Accessing the Address of a String Element

Question: In the following code, how do I get the address of the first character of str in the function discard? discard(string *name){ //..}int main(){ string str; cin >> str;

DevX - Software Development Resource

Advantages of EXISTS over IN Clause in a Query

If you wish to retrieve from the department table all the department numbers that have at least one employee assigned to them, write the query as: select deptno, deptname from

DevX - Software Development Resource

Performance Analysis of Application by Code Profiling

Oracle8i provides a standard package, DBMS_PROFILER, which facilitates performance and code coverage analysis of your PL/SQL application. This package provides functions for gathering statistics, such as total number of times

DevX - Software Development Resource

Caching Packages on Database Startup

Oracle8i has introduced database-level and system-level triggers. They can track events in the database such as logon/logoff from a schema, startup and shutdown of a database, and response to a

DevX - Software Development Resource

Wrapping Application Code

Oracle comes with a PL/SQL wrapper, which converts the PL/SQL source code into an intermediate form of object code. By hiding application internals, the wrapper prevents the misuse of your

DevX - Software Development Resource

Avoid Multiple Exit Points in a Function

If you have a database function that has multiple return statements, try to minimize the exit points. I will explain with the following example: create or replace function getStatus(p_status_code in

DevX - Software Development Resource

How to Emit a Beep?

Question: How do I make a beep in C++? I’d like to make my program alert the user in case of errors. Answer: Use the ‘a’ escape sequence to emit

DevX - Software Development Resource

SQL Script from Linux OS

Question: How can I run an Informix SQL Script from the Linux Operating System command line directly? Answer: Use this format: dbaccess The is the name of the database and

DevX - Software Development Resource

SQL Server Datatypes

Question: Why doesn’t the datatype called sysname show up in all the tables’ dropdown lists of datatypes? Answer: The sysname datatype is a system datatype used to store database object

DevX - Software Development Resource

Private Member as Return Type?

Question: I was trying to test a base class and I came across an unusual question: in the below code, why doesn’t the compiler complain about the return code type

DevX - Software Development Resource

How Many Member Functions Can a Class Contain?

The C++ standard doesn’t specify the maximal number of member functions that a class can have. However, it recommends that it be 4096. Normally, classes don’t have more than 15-25

DevX - Software Development Resource

Avoiding Code Bloat Caused by Inline

I received an interesting question from a reader. He used STL’s vector in a class that was heavily used in his project. The two compilers he used produced an extremely

DevX - Software Development Resource

Chasing

I often receive readers’ queries regarding non-standard header files that they don’t have in their development suite, e.g.,,, that they wish to install. This header chase is futile Related Posts

DevX - Software Development Resource

Does the Order of Type Qualifiers Matter?

Do the following declarations differ in any way from one another? const long int N=0;long const int N=0; No, they don’t. C and C++ do not enforce a specific order

DevX - Software Development Resource

Using dynamic_cast

You can apply operator dynamic_cast only to polymorphic objects (a polymorphic object is one that has at least one virtual member function). This is a requirement of the C++ standard.

DevX - Software Development Resource

Orphaned Exchange Accounts

Question: I have some orphaned Exchange mailboxes that are displayed under Private Information Store/Mailbox Resources. How do I remove them if the object is not defined in the DS? Answer:

DevX - Software Development Resource

Don’t use = operator on Date values

Date variables store values in floating point format, much like Double variables, with the integer part for dates and the fractional part for the time portion. Being floating point values,

DevX - Software Development Resource

Use Server.HTMLEncode for strings stored in a database

If your ASP pages display strings stored in database fields, you should always process the strings with the Server.HTMLEncode method, otherwise the string won’t be displayed correctly in the user’s

DevX - Software Development Resource

Out-of-date dependency file for COMCTL32.OCX

Have you ever read a message like “Dependency file for COMCTL32.OCX is out of date” during the package creation process? The cause of this problem is simple: you have installed