× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 01-Jul-2014 19:35 -0500, Jack Tucky wrote:

I've been using SQL more in my daily work. I'm working with my first
table defined using SQL.

Since I have users who like to use Query/400, Is there an equivalent
to the EDTCDE DDS keyword that I can use maybe via ALTER TABLE?

Data /editing/ for presentation is the domain of the Report Writer; the Structured Query Language (SQL) is more about getting the [raw] data to the program. Edited data is not the original data type, and thus is an effective casting; i.e. the SQL would return either the original [raw] data, or that original data since cast into the data type documented by whatever is the chosen casting\scalar function. The DB2 for i SQL has not, and [per still have not] probably will not :-( provide an EDTWRD or EDTCDE scalar function; the SQL standards have added some Date and Timestamp editing casting scalars, and those are supported and documented with the DB2 for i SQL.

I also have a timestamp field in this table, is there a way to
define a separate date and time field as well?

Just as TIMESTAMP is the type keyword to define a timestamp data-type: DATE is the SQL type keyword to define a date data-type, and TIME is the SQL type keyword to define a time data-type.

I see iDate and an mcpress article for an edit code UDF from Bruce
Vining, but will they work with Query?

<http://www.mcpressonline.com/programming/apis/the-api-corner-dynamically-editing-a-numeric-value.html >


The Query/400 will be able to process a VIEW that encapsulates the specification of the scalar User Defined Function (UDF) against the column. The Query/400 only supports its own [built-in] specific set of SQL-like scalar functions; no SQL scalars nor any SQL UDF scalars can be specified directly [neither in the Define Result Fields nor Record Selection specifications]. Of course, the Query/400 report writer will only see the casted-to data type for that column of the VIEW rather than the original data type, thus will be unable to apply any of its supported numeric-only editing features.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.