April 28, 2000

Benefits of Using PLS_INTEGER Datatype in PL/SQL

If you have a whole-number counter, for example in a loop or record counter, consider using a datatype of PLS_INTEGER instead of INTEGER or NUMBER. When declaring an integer variable, PLS_INTEGER is the most efficient numeric datatype because its values require less storage than INTEGER or NUMBER values, which are

Use java.lang Methods as Functions with SQL-J

You can use methods of java.lang classes for all of the functions found built-in to other databases. For example, you can call the static method java.lang.Math.abs, which is similar to ABS in other database systems. You can call the method this way: SELECT (CLASS java.lang.Math).abs(balance) FROM account You can also

Avoid Java Null Pointer Exceptions with SQL-J

Direct access of a NULL in a column does not cause any problems in SQL-J. If you use that value as a parameter in a Java method or as a method receiver, you will get a Java Null Pointer Exception. The conditional expression is useful for avoiding Java-caused null pointer

Clean Quotes From SQL Parameters With Replace

If you’ve ever used SQL commands against the ADO Connection object, you might have had a problem allowing the user to enter text that contains an apostrophe: ADOCon.Execute “Insert Into Emp(Name) Select ‘” _ & txtName.Text & “‘” This works fine if the name is Smith, but fails if the

Avoid Cursor Problems in Oracle With Precompiled Queries

ADO and RDO do not support Oracle cursor types; neither Microsoft nor Oracle drivers provide appropriate conversion. As a result, you cannot use Oracle stored procedures from VB or Active Server Pages (ASP) to retrieve a multiple-row recordset. Instead, dynamic embedded SQL statements have to be passed. At this point,

Sort DBGrid Contents With Recordset Refresh

It’s often useful to sort a DBGrid field in either descending or ascending order. You do this by using the HeadClick event and the DataField property of columns. You must change the query string (Qry) with one of your own (be sure it contains the code in bold): Private Sub

Optimize Parametrized Queries With ADO Objects

When you write Insert statements, it can be difficult to accommodate the possible values end users might enter into a textbox. The most common task is replacing single quotes with double quotes. However, parameterized queries provide two benefits: You do not have to parse data entered by users?except for business

Dynamically Populate MSFlexGrid Control

If you use an MSFlexGrid control to display data returned in an ADO recordset, you can use this code to dynamically populate the grid?including the header row?with the information in the recordset. You need an open ADO recordset named rst and a form containing an MSFlexGrid control named msfGrid: Dim

Pass Arrays ByVal From ASP Scripts to VB COM Objects

In Microsoft Knowledge Base article Q217114, “How to: Implement Array Arguments in Visual Basic COM Objects for Active Server Pages,” Microsoft says you can’t pass an array to a COM method by value. However, you want to do this for Microsoft Transaction Server (MTS), so here is a workaround that

No more posts to show