Решения практических упражнений дисциплины "Теория экономических информационных систем", страница 2

Результат

Server: Msg 170, Level 15, State 1, Line 114

Line 114: Incorrect syntax near 'Enter'.

SELECT          ENAME, DEPTNO,

                        INITCAP (REPLACE (JOB,

                                                             ' SALESMAN ',

                                                              'SALES PERSON'))  JOB

FROM             EMP

WHERE          DEPTNO = 30;

Результат

Server: Msg 195, Level 15, State 10, Line 113

'INITCAP' is not a recognized function name.

SELECT          ENAME, HIREDATE,

                        ADD_MONTHS (HIREDATE,12) REVIEW

FROM             EMP

ORDER BY     ADD_MONTHS(hiredate,12);

Результат

Server: Msg 195, Level 15, State 10, Line 111

'ADD_MONTHS' is not a recognized function name.

DEFINE          TIME = MONTHS_BETWEEN (SYSDATE,HIREDATE);

SELECT          ENAME,

                        FLOOR (&TIME/12) I I ' YEARS ' I I

                        FLOOR (MOD (&TIME, 12 )) | | ‘ MONTHS '

                                                                          "LENGTH OF SERVICE"

FROM             EMP

WHERE          ENAME = UPPER ( ' &EMPLOYEE_NAME ' ) ;

Результат

Server: Msg 170, Level 15, State 1, Line 110

Line 110: Incorrect syntax near 'DEFINE'.

Server: Msg 170, Level 15, State 1, Line 112

Line 112: Incorrect syntax near '&'.

SELECT          ENAME, HIREDATE,

                        NEXT_DAY ( LAST_DAY (ROUND (HIREDATE, 'MONTH') ) - 7,

                                                              'FRIDAY') PAYDAY

FROM             EMP

ORDER BY     HIREDATE;

Результат

Server: Msg 195, Level 15, State 10, Line 111

'LAST_DAY' is not a recognized function name.

Решения упражнений: урок 5

SELECT          ENAME,

                        TO_CHAR (HIREDATE,

                                            'fmMonth, Ddspth YYYY') DATE_HIRED

FROM             EMP

WHERE          DEPTMO =20;

Результат

Server: Msg 195, Level 15, State 10, Line 112

'TO_CHAR' is not a recognized function name.

SELECT          ENAME,

                        DECODE (SIGN (1500 - SAL),

                                            1, 'Below 1500',

                                            0, 'On Target', SAL) SALARY

FROM             EMP

ORDER BY     ENAME;

Результат

Server: Msg 195, Level 15, State 10, Line 113

'DECODE' is not a recognized function name.

Дополнительныеупражнения

SELECT          TO_CHAR (TO_DATE ( ' &ANYDATE ', 'DD.MM.YY') ,

                                             ' DAY ' ) DAY

FROM             SYS. DUAL;

Результат

Server: Msg 195, Level 15, State 10, Line 110

'TO_DATE' is not a recognized function name.

SQL> ACCEPT STRING CHAR PROMPT 'Enter string in nn/nn

format => ';

SELECT          '& STRING' VALUE,

                        DECODE (TRANSLATE ( ' & STRING' ,

                                                                   ‘1234567890', '9999999999'),

                                            '99/99', 'YES'

                                                          'NO') "VALID?",

FROM             SYS. DUAL

SQL > /

Enter string in nn/nn format => 12/34

VALUE VALID?

--------------------

12/34 YES

SOL> /

Enter string in nn/nn format => 01/1a

VALUE VALID?

---------------------

01/1a     NO

Результат

Server: Msg 170, Level 15, State 1, Line 110

Line 110: Incorrect syntax near 'SQL'.

Server: Msg 170, Level 15, State 1, Line 115

Line 115: Incorrect syntax near '‘'.

Server: Msg 105, Level 15, State 1, Line 117

Unclosed quotation mark before the character string ') "VALID?",

FROM            SYS. DUAL

SQL > /

Enter string in nn/nn format => 12/34

VALUE VALID?

--------------------

12/34 YES

SOL> /

Enter string in nn/nn format => 01/1a

VALUE VALID?

---------------------

01/1a     NO

Решения упражнений: урок 6