Question : How do I make the random number different for each record

The random number needs to be different for each record
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
SELECT LOWER(SUBSTR(spriden_first_name, 1, 1) || SUBSTR(spriden_mi, 1, 1) || spriden_last_name)
       || rnd
           AS "EMAIL ADDRESS",
       ';',
          a.spriden_last_name
       || rnd
       || ', '
       || a.spriden_first_name
       || ' '
       || SUBSTR(a.spriden_mi, 1, 1)
           AS "FULL NAME",
       ';',
       a.spriden_last_name || rnd last_name,
       ';',
       a.spriden_first_name,
       ';',
       SUBSTR(a.spriden_mi, 1, 1) AS "MID NAME",
       ';',
       spriden_id,
       spriden_pidm,
       'CAMP',
          SUBSTR(a.spriden_first_name, 1, 1)
       || SUBSTR(a.spriden_mi, 1, 1)
       || a.spriden_last_name
       || rnd
       || '@mail.ecsu.edu'
           banner_email,
       'A',
       'Y',
       '13-JANUARY-2009',
       'LTHERRING',
       ' ',
       'Y',
       'SCRIPT'
  FROM spriden a, spbpers b, sfbetrm c, sarappd d, 
       (select floor(DBMS_RANDOM.VALUE(100, 999)) rnd from dual where rownum=1 ) rnd
 WHERE a.spriden_pidm = b.spbpers_pidm
   AND a.spriden_change_ind IS NULL
   AND c.sfbetrm_pidm = a.spriden_pidm
   AND d.sarappd_pidm = a.spriden_pidm
   AND d.sarappd_apdc_code = '25'
   AND c.sfbetrm_ar_ind = 'Y'
   AND d.sarappd_term_code_entry = '200920'
   AND c.sfbetrm_term_code = '200920';
Open in New Window Select All

Answer : How do I make the random number different for each record

try this...

sorry I didn't understand what you were looking for well enough in your first question
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
SELECT LOWER(SUBSTR(spriden_first_name, 1, 1) || SUBSTR(spriden_mi, 1, 1) || spriden_last_name)
       || rnd
           AS "EMAIL ADDRESS",
       ';',
       spriden_last_name || rnd || ', ' || spriden_first_name || ' ' || SUBSTR(spriden_mi, 1, 1)
           AS "FULL NAME",
       ';',
       spriden_last_name || rnd last_name,
       ';',
       spriden_first_name,
       ';',
       SUBSTR(spriden_mi, 1, 1) AS "MID NAME",
       ';',
       spriden_id,
       spriden_pidm,
       'CAMP',
          SUBSTR(spriden_first_name, 1, 1)
       || SUBSTR(spriden_mi, 1, 1)
       || spriden_last_name
       || rnd
       || '@mail.ecsu.edu'
           banner_email,
       'A',
       'Y',
       '13-JANUARY-2009',
       'LTHERRING',
       ' ',
       'Y',
       'SCRIPT'
  FROM (SELECT spriden_id,
               spriden_first_name,
               spriden_mi,
               spriden_last_name,
               spriden_pidm,
               banner_email,
               FLOOR(DBMS_RANDOM.VALUE(100, 999)) rnd
          FROM spriden a, spbpers b, sfbetrm c, sarappd d
         WHERE a.spriden_pidm = b.spbpers_pidm
           AND a.spriden_change_ind IS NULL
           AND c.sfbetrm_pidm = a.spriden_pidm
           AND d.sarappd_pidm = a.spriden_pidm
           AND d.sarappd_apdc_code = '25'
           AND c.sfbetrm_ar_ind = 'Y'
           AND d.sarappd_term_code_entry = '200920'
           AND c.sfbetrm_term_code = '200920');
Open in New Window Select All
Random Solutions  
 
programming4us programming4us