|
Sudha, The SQL looks like the following: CREATE ALIAS MYLIB.MYMBR2_ALIAS FOR MYLIB.MYFILE (MBR2) Where MBR2 is the member name. This works well for regular SQL selects, but the parser will not accept it as the object of a CREATE TRIGGER. HTH, Jim -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of SRamanujan@xxxxxxxxxxxxxxxxxx Sent: Tuesday, April 05, 2005 11:37 AM To: midrange-l@xxxxxxxxxxxx Subject: RE: SQL Triggers and Multiple Member Database Files James, This is interesting. How do you define a member as an alias to reference from? Thanks, Sudha Sudha Ramanujan SunGard Futures Systems sramanujan@xxxxxxxxxxxxxxxxxx (312) 577 6179 (312) 577 6101 - Fax -----Original Message----- From: Reinardy, James [mailto:jreinardy@xxxxxxxxxxxxxxx] Sent: 2005年4月5日 11:25 To: Midrange Systems Technical Discussion Subject: RE: SQL Triggers and Multiple Member Database Files Charles, Thanks for replying. I do have to disagree to a point about one of your statements. "Which would make sense since SQL doesn't have any concept of multiple members." Well, yes and no. As a workaround, you can define an alias for a member and reference it like a table in a SQL statement. In this case, what I am really looking for is a way to reference the trigger buffer in SQL, which contains the member name. Based on what I have seen so far, I think you may be correct, Charles. Thanks, Jim -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Wilt, Charles Sent: Tuesday, April 05, 2005 9:57 AM To: Midrange Systems Technical Discussion Subject: RE: SQL Triggers and Multiple Member Database Files As far as I know, it can't be done with an SQL trigger. Which would make sense since SQL doesn't have any concept of multiple members. You have two options: 1) Change the program to use a temporary work file. 2) Use an RPG/COBOL/C program for your trigger. HTH, Charles Wilt iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121 > -----Original Message----- > From: midrange-l-bounces@xxxxxxxxxxxx > [mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Reinardy, James > Sent: Tuesday, April 05, 2005 10:09 AM > To: Midrange Systems Technical Discussion > Subject: SQL Triggers and Multiple Member Database Files > > > We are using SQL Triggers on an 830 running v5r2 in connection with an > application that is writing transactions to an audit file for later > updates to a data warehouse. We are finding that one source of a lot > of transactions is a program that creates and then deletes a temporary > member in one of our major database files. These transactions are > useless to us, and are causing some issues because the key values are > the same as the primary member, and the audit records show up as > another insert of the same keys. I am looking for a way to reference > the member name in the SQL trigger to exclude updates to the secondary > member from being written to our transaction audit files. Any ideas > about how to do this? > > Thanks, > > Jim Reinardy > Badger Meter, Inc. > -- > This is the Midrange Systems Technical Discussion > (MIDRANGE-L) mailing list > To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, > unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/midrange-l > or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take > a moment to review the archives at > http://archive.midrange.com/midrange-l. > > -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l. -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l. -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.