× 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.



Can DBU write to an SQL view? If so, define one and try it, i.e.:

CREATE VIEW #785/ERRSVRTYV AS
(SELECT Error_Severity, Description
FROM #785/ERRSVRTY)

Elvis

Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
OS/400
www.centerfieldtechnology.com


-----Original Message-----
Subject: Default user ID in SQL table

I am trying to get the user ID to default on additions and changes to a
table defined using DDL. The only special register value I can get to work
is USER. When I add records to the table outside of SQL the user ID field
is blank. I am also using the CURRENT_TIMESTAMP register for a timestamp
value and it works fine.

Using SYSTEM_USER or SESSION_USER results in an error creating the table.
It doesn't like the , at the end of the line.

Anyone have any ideas how to get the user ID to default on adds outside of
SQL?

Here's the SQL statement:
Create table #785/ERRSVRTY (
Error_Severity for ERRSEV Numeric(1,0) not null,
Description for DESCR Char(50) not null,
Add_User for ADDUSER Char(18) not null with default USER,
Add_Timestamp for ADDTMSTP Timestamp not null
with default CURRENT_TIMESTAMP,
Update_User for UPDUSER Char(18) not null with default USER,
Update_Timestamp for UPDTMSTP Timestamp
with default CURRENT_TIMESTAMP,

-- Add primary key
Constraint ERRSVRTY_Key Primary Key (Error_Severity));

Rick Chevalier




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.