sql1

3555 단어 sqlOS


[B]    、SQL&PL/SQL[/B] 
[Q]         ,    % _ 
[A]select * from table where name like 'A\_%' escape '\' 
  
[Q]              
[A]   ASCII   ,       &   ,   
insert into t values('i'||chr(39)||'m');  -- chr(39)    ' 
             
or insert into t values('I''m');  --   ''      ' 
  
[Q]            
[A]cursor c1 is  
           select * from tablename  
                  where name is null for update [of column] 
    …… 
    update tablename set column = …… 
                  where current of c1; 
  
[Q]        
[A] pragma_exception_init(exception_name,error_number); 
             
    raise_application_error(error_number,error_msg,true|false); 
  number -20000 -20999,      2048B 
         
SQLCODE          
SQLERRM          
  
[Q]            
[A]8i    : 
to_char(100,'XX') 
to_number('4D','XX') 


[Q]     SYS_CONTEXT      
[A]       ,      
select 
         SYS_CONTEXT('USERENV','TERMINAL') terminal, 
         SYS_CONTEXT('USERENV','LANGUAGE') language, 
         SYS_CONTEXT('USERENV','SESSIONID') sessionid, 
         SYS_CONTEXT('USERENV','INSTANCE') instance, 
         SYS_CONTEXT('USERENV','ENTRYID') entryid, 
         SYS_CONTEXT('USERENV','ISDBA') isdba, 
         SYS_CONTEXT('USERENV','NLS_TERRITORY') nls_territory, 
         SYS_CONTEXT('USERENV','NLS_CURRENCY') nls_currency, 
         SYS_CONTEXT('USERENV','NLS_CALENDAR') nls_calendar, 
         SYS_CONTEXT('USERENV','NLS_DATE_FORMAT') nls_date_format, 
         SYS_CONTEXT('USERENV','NLS_DATE_LANGUAGE') nls_date_language, 
         SYS_CONTEXT('USERENV','NLS_SORT') nls_sort, 
         SYS_CONTEXT('USERENV','CURRENT_USER') current_user, 
         SYS_CONTEXT('USERENV','CURRENT_USERID') current_userid, 
         SYS_CONTEXT('USERENV','SESSION_USER') session_user, 
         SYS_CONTEXT('USERENV','SESSION_USERID') session_userid, 
         SYS_CONTEXT('USERENV','PROXY_USER') proxy_user, 
         SYS_CONTEXT('USERENV','PROXY_USERID') proxy_userid, 
         SYS_CONTEXT('USERENV','DB_DOMAIN') db_domain, 
         SYS_CONTEXT('USERENV','DB_NAME') db_name, 
         SYS_CONTEXT('USERENV','HOST') host, 
         SYS_CONTEXT('USERENV','OS_USER') os_user, 
         SYS_CONTEXT('USERENV','EXTERNAL_NAME') external_name, 
         SYS_CONTEXT('USERENV','IP_ADDRESS') ip_address, 
         SYS_CONTEXT('USERENV','NETWORK_PROTOCOL') network_protocol, 
         SYS_CONTEXT('USERENV','BG_JOB_ID') bg_job_id, 
         SYS_CONTEXT('USERENV','FG_JOB_ID') fg_job_id, 
         SYS_CONTEXT('USERENV','AUTHENTICATION_TYPE') authentication_type, 
         SYS_CONTEXT('USERENV','AUTHENTICATION_DATA') authentication_data 
  from dual 
  

좋은 웹페이지 즐겨찾기