Practica 1 Enunciados 2015 Con Referencias

download Practica 1 Enunciados 2015 Con Referencias

of 5

Transcript of Practica 1 Enunciados 2015 Con Referencias

  • 7/25/2019 Practica 1 Enunciados 2015 Con Referencias

    1/5

    INDRA - Introduccion a PL/SQL

    Practica1 - Variables Tipos de Datos

    Eercicio 1 ! "arcar la respuesta correcta

    Ejemplo #1:

    set serveroutput on;set serveroutput on size 1000000;declaremi_var varchar(20):='hola mundo';e!in dms_output"put_line(mi_var);ss"dms_output"put_line('$in del pro!rama');end;%

    a) &evuelve

    hola mundo$in del pro!rama

    ) &evuelve error de compilacin

    Eercicio # ! "arcar la respuesta correcta

    Ejemplo #2E E*+E*,-.- ,/&E*E+_/-31 /-34E*(562):=10"2;+_/-32 /-34E*(562):=20"1;4E78/&43_,-.-".-_8/E(' -3 E: '99,_*(+_/-31+_/-32));E/&;%

    &evuelve

    a) -3 E: ?.E;4E78/EE *EE& 8/, +_$E $*,3 +&4E;&43_,-.-".-_8/E(' $E &E *E8,/ &E 4E &E &,$-E: '99,_*(+_$E6'&&33????'));E/&;

    &evuelve

    d) $E &E *E8,/ &E 4E &E &, @ue 0

  • 7/25/2019 Practica 1 Enunciados 2015 Con Referencias

    2/5

    rear un plAsBl Bue de@ina dos variales v_nomre_empleado_1 v_nomre_empleado_2 con el nomreCDuan C " a primera de tipo char de la se!unda de tipo varchar de " 8mprimir amos valoresconcatenando un FGH al principio "

    1) ,cupan lo mismo I J 8mprimir usando len!th(variale)2) si!nar a v_nomre_empleado_1 el nomre CDuan manuel 7arciaK

  • 7/25/2019 Practica 1 Enunciados 2015 Con Referencias

    3/5

    &&a o@ the UeeW (1AO)" unda is da 1 Uhen nls_territor is set to'3E*8' ut di@@ers i@ another nls_territor is set (i"e" '-/8E&Y8/7&,3' or '7E*3/?' A in these cases 3onda is 1"

    &? /ame o@ the da"

    && he da o@ month (1A

  • 7/25/2019 Practica 1 Enunciados 2015 Con Referencias

    4/5

    he strin! to search" stringcan e *6 +**26 /*6 /+**26 ,46 or

    /,4"

    sustrin!

    he sustrin! to search @or in string" substringcan e *6 +**26 /*6

    /+**26 ,46 or /,4"

    start_position

    ,ptional" he position in stringUhere the search Uill start" 8@ omitted6 it de@aults to 1" he @irst

    position in the strin! is 1" 8@ the start_positionis ne!ative6 the 8/* @unction counts

    acW start_positionnumer o@ characters @rom the end o@ stringand then searches toUards the

    e!innin! o@ string"

    nth_appearance

    ,ptional" he nth appearance o@ substring" 8@ omitted6 it de@aults to 1"

    S23STR

    -4*( strin!6 start_position R6 len!th S )

    .arameters or r!uments

    strin!he source strin!"

    start_positionhe startin! position @or eTtraction" he @irst position in the strin! is alUas 1"

    len!th,ptional" 8t is the numer o@ characters to eTtract" 8@ this parameter is omitted6 the -4*@unction Uill return the entire strin!"

    /ote:

    8@ start_position is 06 then the -4* @unction treats start_position as 1 (ie: the @irst position in

    the strin!)"

    8@ start_position is a positive numer6 then the -4* @unction starts @rom the e!innin! o@ the

    strin!"

    8@ start_position is a ne!ative numer6 then the -4* @unction starts @rom the end o@ the strin!

    and counts acWUards"

    8@ len!th is a ne!ative numer6 then the -4* @unction Uill return a /- value"

    Eercicio 5 ! Precedencia de operadores

    *ealizar un pl%sBl Bue tome la @echa del dia le sume un se!undo" .ara ello tomar la @echa del dia unavariale en otra variale asi!narle el valor anterior dividido por 25G0G0" +er@icar la predcedencia de ladivision con la multiplicacin la asi!nacin"

    ( ener presente)

    Table 21 Order of Operations)perator )peration** exponentiation+, - identity, negation*, / multiplication, division+, -, || addition, subtraction, concatenation=, , =, , !=, ~=, ^=,

    IS NULL, LIKE, BETWEEN, INcomparisonNOT logical negation

  • 7/25/2019 Practica 1 Enunciados 2015 Con Referencias

    5/5

    AND conjunctionOR inclusion

    *e@: http:%%UUU"oracle"com%technetUorW%issueAarchive%2012%12Ajan%o12plsBlA150ZN1"html

    Eercicio 6! &lausulas adicionales0 - RAN7E

    E si!uiente ejemplo de@ine un ran!o de valores6 ejecuta I

    &E*E di!ito ._8/E7E* */7E 0""M; dos_di!itos ._8/E7E* */7E 10""MM; menos_de_100 ._8/E7E* */7E 0""MM;

    4E78/

    di!ito := 5; dos_di!itos :=