If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Inline prompt in DB2 SQL?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-15-05, 11:42
tunatoo tunatoo is offline
Registered User
 
Join Date: Oct 2005
Posts: 15
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.
Reply With Quote
  #2 (permalink)  
Old 12-16-05, 03:57
przytula przytula is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 12-16-05, 07:12
gardenman gardenman is offline
Registered User
 
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}'"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On