devxlogo

The Latest

Using Where on Fields of Differing Types

Question: I need to extract information using WHERE on fields in two different tables: one a text field, the other a numeric field. Both hold only numeric data. How can

Problem with Select Statement

Question: I’m writing a select statement to make a table name a variable whose value is set according to a condition: Var tablename;tablename := emp tableselect * from tablename; But

Finding Out if a User Has Disabled Cookies

Question: How do I find out if a user has disabled cookies? Answer: To find out if a user has disabled cookies, follow these steps: Set a cookie. Redirect to

Informix Data Types for Linking Images

Question: Does Informix have a data type similiar to SQL Server’s image or ntext to input paths to link images? Answer: I’d use a CHAR(25) or a VARCHAR field for

Effects of Operator delete

Question: Why, after deleting an object I allocated dynamically, is the pointer still there? What exactly have I deleted and what would happen if I assigned a new value to

WAP IP Address

Question: Does WAP have a concept of IP address? Answer: You can get the gateway IP address and the terminal IP address using HTTP headers. WAP 1.1 currently has no

Percent Sign in SQL

Question: I have a table in which the key field has a value stored with a percent sign, like ‘1234%’.Using this value, I want to select from another table that

ESQL/C (9.2) UC3 Errors

Question: I have installed the version 9.2 of ESQLC, and when I try to run the program in the following manner: esql -e crdb.ec cc -c -I/home/informix/incl/esql crdb.c cc -ocrdb7.exe

Concatenating Fields

Question: How do I concatenate a value in Stored Procedures (e.g., select * from mytable, where mytable.field1 = field that I concatenate)? Answer: If you want to match field1 to

Constructors – Derived to Base

Question: My base class contains this constructor: class Parent { Parent(int a, int b, char* c);}; My derived class contains this constructor: class Child : public Parent { Child(int a);};

Manual Redirection of URL

Instead of using a META tag to re-direct a URL, simply place this code in place of the old page and a visitor will instantly be taken there. This piece

Building a Text Editor, Part II

n Part I of this article, we built our basic form for our text editor and wrote the Save functionality. In this part, we complete the File menu with the

How to Use sp_OAMethod

n last month’s 10-Minute Solution, we looked at how to use the OLE automation stored procedures that come with SQL Server to call an object’s properties. These extended stored procedures

Avoid error 1540 in Join queries

When you plan your queries, you should avoid the use of wildcard keyword * – which means “retrieve any field” – mainly because it may decrease performances, since the engine

Listing all available SQL Server

Thanks to the SQL-DMO object model, it’s very easy to list all the available SQL Server 7.0 installations. For example, this code loads all the SQL Servers registered on the

Tricks with DateSerial

The DateSerial function has an interesting feature: it doesn’t raise errors when you pass it an invalid month or day number. Instead, it evaluates the date as if the arguments

Using CallByName with nested objects

Sometimes Microsoft documentation can be, well lacking is a kind word, and one is reluctant to call tech support when they smoke your credit card first, and ask questions later.My

The ALL clause can speed up UNION statements

If you omit the ALL clause in an UNION statement, SQL Server must delete duplicate values, which in turn means that it has to sort the two sub-resultsets that have

Zip a Directory In Java

Through its java.util.zip package, Java provides you with an easy mechanism to compress/decompress files. Here is a method called zipDir, that shows how to recursively zip a directory structure. Note

Bit Rotation for Byte, Short and Int Variables

This is a Class to perform rotr and rotl as known in standard C implementations and a rotate with carry implementation. The technique used is to determine which bits within

Accessing and Modifying System Properties with SQL-J

You can access Java system properties within your queries (most useful when running in embedded mode; in server mode, you will see the server’s properties, not the client’s). VALUES (CLASS

Use Finally For Guaranteed Code Execution

Java’s exception handling mechanism provides developers with an elegant, easy-to-use way to handle exceptional situations in their programs. For example, if there is a file operation to be performed, one