Hi again, I got over this. When I checked the REQUESTS table, in the column LOWNER_ID (on which this table is joined with USERS table) I found that in one row there was a value which was absent in USERS table (foreign key wasn't defined :( ). When I changed this one row to a proper USER_ID value everything works well. But - why the DB Engine behaves so strangely- is the one of the largest secrets.
Bye, Marcin U�ytkownik "Marcin P" <[EMAIL PROTECTED]> napisa� w wiadomo�ci news:[EMAIL PROTECTED] > Hello! > Today I got into real trouble with my SAP DB instance (7.3.0.29). > I have a foolowing view definition: > CREATE VIEW VIEW_DBV_REQUESTS_OPER AS > SELECT > R.REC_ID, R.REQUEST_ID, R.AUTHOR_ID, R.ORGANIZATION_ID, > R.ORG_UNIT_ID, R.TITLE, R.ASSET_ID, R.LOWNER_ID, R.PRIORITY_ID, R.STATUS_ID, > CHAR(R.OPEN_DATE, ISO) || ' ' || CHAR(R.OPEN_TIME, ISO) AS OPEN_DT, > CHAR(R.CLOSE_DATE, ISO) || ' ' || CHAR(R.CLOSE_TIME, ISO) AS CLOSE_DT, > R.PROBLEM_TYPE_ID, R.REQUEST_TYPE_ID, R.ASSET_LOCATION, > Z.LAST_NAME AS Z_LAST_NAME, Z.FIRST_NAME AS Z_FIRST_NAME, > Z.CELL_PHONE AS Z_CELL_PHONE, Z.PHONE AS Z_PHONE, > C.LAST_NAME AS C_LAST_NAME, C.FIRST_NAME AS C_FIRST_NAME, C.CELL_PHONE AS > C_CELL_PHONE, C.PHONE AS C_PHONE, > CHAR(R.LAST_ACT_DATE, ISO) || ' ' || CHAR(R.LAST_ACT_TIME, ISO) AS > LAST_ACT_DT, R.LAST_ACT_TIME, R.SRV_AGREEMENT, R.TLX_ORDER_ID, > R.TSD_PROBLEM_ID, IFNULL('FS-' & R.BILL_SYMB & '; ','') & IFNULL('ST-' & > R.WAR_CRED_TAG & '; ','') & IFNULL('UM-' & R.LUMP_CONTRACT,'') AS COSTS_SUM, > R.ACCOUNT_SUM, R.ACCOUNT_ACC_BY, R.CALL_TYPE, U.DEPARTMENT > FROM > TALD_ADMIN.CONTACTS C,TALD_ADMIN.CONTACTS Z, TALD_ADMIN.REQUESTS R, USERS U > WHERE > (Z.CONTACT_ID = R.CALLER_ID) AND (C.CONTACT_ID = R.CONTACT_ID) AND > (U.USER_ID = R.LOWNER_ID) > > And now - I try to execute following statements: > SELECT * FROM VIEW_DBV_REQUESTS_OPER > > which returns 11471 rows (and this is correct), > but the statement > SELECT REC_ID,REQUEST_ID,C_LAST_NAME,COSTS_SUM,ASSET_LOCATION, > OPEN_DT,TSD_PROBLEM_ID,STATUS_ID,TLX_ORDER_ID, TITLE, > ACCOUNT_SUM,LOWNER_ID,ASSET_ID FROM DBV_REQUESTS_OPER > > returns only 7638 rows (and in my opinion this isn't correct). > Could any body give me any hint? > Am I missing something? > What's the difference if I select all columns, and when > I select only few of them if I still use the same view?? > Why does the number of returning rows is changed? > I would appreciate every help, because the case is very urgent. > > Thanks in advance, > > Marcin Pytel _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
