PERForm - running an imbedded sql?
Posted in 2007
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Ladies and Gentlemen: Old version: IDS:7.23 (pre Y2K) ISQL:7.x HPUX11.x I'm limited to somewhat of a captive user interface in ISQL. I need to build a PERForm with user input on a single underlying table. However, I also need to execute an SQL to filter it. I can't compile 4GL modules; it must all run directly in the form. I want to sum a column in the table of my inventory on hand. When I put sum(field), it errors as "SUM" not a column.(error -2863) Can I sum in the PERForm? This is my PERForm Code: database inv_cntrl screen size 24 by 80 { warehous_site [a0 ] stk_num [f000 ] owner [a] inventory_cnt [c] date_upd [f013 ] } end tables inv_cntrl="moi".inv_cntrl attributes a0 = inv_cntrl.warehous_site; f000 = inv_cntrl.stk_num; a = inv_cntrl.owner; c = sum(inv_cntrl.inventory_cnt); end Rob
It's been a LONG time since I did any PERFORM screens, but IB you can make that: c= display only integer; Add an INSTRUCTIONS section as: INSTRUCTIONS AFTER QUERY LET c = SELECT SUM(inventory_cnt) FROM inv_cntrl WHERE warehouse_site = a0 AND stock_num = f000 AND owner = a AND date_update = f013; Art S. Kagel ----- Original Message ----- From: Rob Konikoff <ids@iiug.org> At: 8/22 14:09:11 Ladies and Gentlemen: Old version: IDS:7.23 (pre Y2K) ISQL:7.x HPUX11.x I'm limited to somewhat of a captive user interface in ISQL. I need to build a PERForm with user input on a single underlying table. However, I also need to execute an SQL to filter it. I can't compile 4GL modules; it must all run directly in the form. I want to sum a column in the table of my inventory on hand. When I put sum(field), it errors as "SUM" not a column.(error -2863) Can I sum in the PERForm? This is my PERForm Code: database inv_cntrl screen size 24 by 80 { warehous_site [a0 ] stk_num [f000 ] owner [a] inventory_cnt [c] date_upd [f013 ] } end tables inv_cntrl="moi".inv_cntrl attributes a0 = inv_cntrl.warehous_site; f000 = inv_cntrl.stk_num; a = inv_cntrl.owner; c = sum(inv_cntrl.inventory_cnt); end Rob ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Art: I tried it and got -2018 construct error on keyword LET. Let me make sure I got the sequence correct: Database Screen end Table end Then put in your excerpt... Rob -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of ART KAGEL, BLOOMBERG/ 731 LEXIN Sent: Wednesday, August 22, 2007 1:26 PM To: ids@iiug.org Subject: Re:PERForm - running an imbedded sql? [9843] It's been a LONG time since I did any PERFORM screens, but IB you can make that: c= display only integer; Add an INSTRUCTIONS section as: INSTRUCTIONS AFTER QUERY LET c = SELECT SUM(inventory_cnt) FROM inv_cntrl WHERE warehouse_site = a0 AND stock_num = f000 AND owner = a AND date_update = f013; Art S. Kagel ----- Original Message ----- From: Rob Konikoff <ids@iiug.org> At: 8/22 14:09:11 Ladies and Gentlemen: Old version: IDS:7.23 (pre Y2K) ISQL:7.x HPUX11.x I'm limited to somewhat of a captive user interface in ISQL. I need to build a PERForm with user input on a single underlying table. However, I also need to execute an SQL to filter it. I can't compile 4GL modules; it must all run directly in the form. I want to sum a column in the table of my inventory on hand. When I put sum(field), it errors as "SUM" not a column.(error -2863) Can I sum in the PERForm? This is my PERForm Code: database inv_cntrl screen size 24 by 80 { warehous_site [a0 ] stk_num [f000 ] owner [a] inventory_cnt [c] date_upd [f013 ] } end tables inv_cntrl="moi".inv_cntrl attributes a0 = inv_cntrl.warehous_site; f000 = inv_cntrl.stk_num; a = inv_cntrl.owner; c = sum(inv_cntrl.inventory_cnt); end Rob **************************************************************************** *** Forum Note: Use "Reply" to post a response in the discussion forum. **************************************************************************** *** Forum Note: Use "Reply" to post a response in the discussion forum.
Sorry 4GL on the brain. No 'LET' keyword, just assign 'c = SELECT....' Also don't forget the 'end' keyword at the end of the INSTRUCTIONS section, and I now remember that most INSTRUCTIONS done take a trailing semi-colon. Art S. Kagel ----- Original Message ----- From: Rob Konikoff <ids@iiug.org> At: 8/22 14:51:10 Art: I tried it and got -2018 construct error on keyword LET. Let me make sure I got the sequence correct: Database Screen end Table end Then put in your excerpt... Rob -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of ART KAGEL, BLOOMBERG/ 731 LEXIN Sent: Wednesday, August 22, 2007 1:26 PM To: ids@iiug.org Subject: Re:PERForm - running an imbedded sql? [9843] It's been a LONG time since I did any PERFORM screens, but IB you can make that: c= display only integer; Add an INSTRUCTIONS section as: INSTRUCTIONS AFTER QUERY LET c = SELECT SUM(inventory_cnt) FROM inv_cntrl WHERE warehouse_site = a0 AND stock_num = f000 AND owner = a AND date_update = f013; Art S. Kagel ----- Original Message ----- From: Rob Konikoff <ids@iiug.org> At: 8/22 14:09:11 Ladies and Gentlemen: Old version: IDS:7.23 (pre Y2K) ISQL:7.x HPUX11.x I'm limited to somewhat of a captive user interface in ISQL. I need to build a PERForm with user input on a single underlying table. However, I also need to execute an SQL to filter it. I can't compile 4GL modules; it must all run directly in the form. I want to sum a column in the table of my inventory on hand. When I put sum(field), it errors as "SUM" not a column.(error -2863) Can I sum in the PERForm? This is my PERForm Code: database inv_cntrl screen size 24 by 80 { warehous_site [a0 ] stk_num [f000 ] owner [a] inventory_cnt [c] date_upd [f013 ] } end tables inv_cntrl="moi".inv_cntrl attributes a0 = inv_cntrl.warehous_site; f000 = inv_cntrl.stk_num; a = inv_cntrl.owner; c = sum(inv_cntrl.inventory_cnt); end Rob **************************************************************************** *** Forum Note: Use "Reply" to post a response in the discussion forum. **************************************************************************** *** Forum Note: Use "Reply" to post a response in the discussion forum. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.