使用SQL Developer需要项目帮助。我似乎无法让程序从表中检索信息。输出显示N / A'而不是价值观。
DEFINE V_MESS = 'ORDER NOT FOUND!! Rerun the program!!!'
DEFINE V_PARTNUM = 'N/A'
DEFINE V_PARTDESCRIPTION = 'N/A'
DEFINE V_CURRQTY = 'N/A'
DEFINE V_SUPPCODE = 'N/A'
DEFINE V_SUPPNAME = 'N/A'
DEFINE V_ORDERED = 'N/A'
DEFINE V_RECEIVED = 'N/A'
DEFINE V_QTY = 'N/A'
ACCEPT V_ORDNUM NUMBER format 9999 PROMPT 'Enter Order Number to Receive (format 9999): '
--input should be 1010
SET TERMOUT OFF
SPOOL \IS380\receive.sql
SELECT 'DEFINE V_MESS=' ||'''' || ORD_NUM || '''' || CHR(13) || CHR(10) ||
'DEFINE V_PARTNUM =' || '''' || PART_NUM || '''' || CHR(13) || CHR(10) ||
'DEFINE V_PARTDESCRIPTION = ' || '''' || PART_DESCRIPTION || '''' || CHR(13) || CHR(10) ||
'DEFINE V_CURRQTY = ' || '''' || PART_QTYONHAND || '''' || CHR(13) || CHR(10) ||
'DEFINE V_SUPPCODE =' || '''' || SUPPLIER_CODE || '''' || CHR(13) || CHR(10) ||
'DEFINE V_SUPPNAME = ' || '''' || SUPPLIER_NAME || '''' || CHR(13) || CHR(10) ||
'DEFINE V_ORDERED =' || '''' || ORD_DATE || '''' || CHR(13) || CHR(10) ||
'DEFINE V_RECEIVED =' || '''' || ORD_RECDATE || '''' || CHR(13) || CHR(10) ||
'DEFINE V_ORDERED =' || '''' || ORD_QTY || '''' || CHR(13) || CHR(10) ||
FROM PART P, SUPPLIER S, ORD O
WHERE O.SUPPLIER_CODE = S.SUPPLIER_CODE
AND O.PART_NUM = P.PART_NUM
AND O.ORD_NUM = &V_ORDNUM;
SPOOL OFF
PAUSE "Retrieving Customer Information. Please press the enter key"
SET TERMOUT ON
START SPOOL \IS380\RECEIVE.SQL
PROMPT SP2-0137: DEFINE requires a value following equal sign
PROMPT
PROMPT Order Found. Verify the following:
PROMPT
PROMPT Part Number : &V_PARTNUM
PROMPT Part Description : &V_PARTDESCRIPTION
PROMPT Current Inventory Quantity: &V_CURRQTY
PROMPT
PROMPT Supplier Code: &V_SUPPCODE
PROMPT Supplier Name: &V_SUPPNAME
PROMPT
PROMPT Date Ordered : &V_ORDERED
PROMPT Date Received : &V_RECEIVED
PROMPT Quantity Ordered: &V_QTY
PROMPT ** Again, verify order information: **
PROMPT ** In case of discrepancy (Order not found, Wrong quantity, etc.) **
PROMPT ** Press [CRTRL] [C] twice to ABORT **
PAUSE ** If correct, press [ENTER] to continue