Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    15

    Unanswered: Inline prompt in DB2 SQL?

    I've been reading where SQL Plus allows you to create an interactive WHERE clause to prompt for a value before it executes. Is there a way to do this with DB2? Before I execute for example SELECT PHONE WHERE BUSINESS = 'ABC', I'd like SQL to prompt me for a value to enter for the BUSINESS field. Thanks.

    Ultimately, we're testing Oracle Application Server 10g Web Portal to let our users pull data from DB2 and display on the web. It works so far, except for the prompting part.

  2. #2
    Join Date
    Nov 2004
    Posts
    374

    prompt

    this should be intercepted by the web page, and have the possibility to accept this field. The sql statement should be translated to add this entered value
    native sql / db2 tools do not have this prompting.. you need tools like QMF or other...
    Best Regards, Guy Przytula
    DB2/ORA/SQL Services
    DB2 DBA & Advanced DBA Certified
    DB2 Dprop Certified
    http://users.skynet.be/przytula/dbss.html

  3. #3
    Join Date
    Apr 2004
    Posts
    54
    Use standart *NIX shell like bash,ch.
    Or you cah download MSYS from www.sourceforge.com

    here is an example:

    #!/bin/bash
    echo Enter username: ; read USERNAME;
    db2 connect to test user ${USERNAME};
    echo Enter tablename: ; read VAR;
    db2 "select * from syscat.tables where tabname='${VAR}'"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •