elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web
| | |-+  Bases de Datos (Moderador: Carloswaldo)
| | | |-+  ayuda con error de sintaxis
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: ayuda con error de sintaxis  (Leído 2,461 veces)
crisoof

Desconectado Desconectado

Mensajes: 48


Ver Perfil
ayuda con error de sintaxis
« en: 6 Abril 2016, 16:01 pm »

Hola buenos dias, les agradeceria si me pueden ayudar estoy un poco colapsado y quizas no veo el error, espero me puedan ayudar

Código:
CREATE OR REPLACE PROCEDURE SP_SEQ_TEST
AS

NOM_SEQ  VARCHAR2(100);
ULT_SEQ  NUMBER;
VAL_SEQ  NUMBER;
NEXT_SEQ NUMBER;
VAR_EXEC VARCHAR2(200);


CURSOR C_SEQ IS
    SELECT seQuence_name, LAST_NUMBER   
      from all_sequenceS
     where sequence_name like '%SPRIDEN_SURROGATE%'
        or sequence_name like '%GTVZIPC_SURROGATE%'
        or sequence_name like '%STVCNTY_SURROGATE%'
        or sequence_name like '%SPRADDR_SURROGATE%'
        or sequence_name like '%SPRTELE_SURROGATE%'
        or sequence_name like '%SPBPERS_SURROGATE%'
        or sequence_name like '%GOREMAL_SURROGATE%'
        or sequence_name like '%SPREMRG_SURROGATE%'
        or sequence_name like '%GOBINTL_SURROGATE%'
        or sequence_name like '%SPRMEDI_SURROGATE%'
        or sequence_name like '%SPRHOLD_SURROGATE%'
        or sequence_name like '%SORFOLK_SURROGATE%'
        or sequence_name like '%SGBSTDN_SURROGATE%'
        or sequence_name like '%SGRSATT_SURROGATE%'
        or sequence_name like '%SGRSCMT_SURROGATE%'
        or sequence_name like '%SGRCHRT_SURROGATE%'
        or sequence_name like '%SIBINST_SURROGATE%'
        or sequence_name like '%SGRADVR_SURROGATE%'
        or sequence_name like '%SHRTTRM_SURROGATE%'
        or sequence_name like '%SHRTCKN_SURROGATE%'
        or sequence_name like '%SHRTCKG_SURROGATE%'
        or sequence_name like '%SHRTCKL_SURROGATE%'
        or sequence_name like '%SARADAP_SURROGATE%'
        or sequence_name like '%SARAPPD_SURROGATE%'
        or sequence_name like '%SORHSCH_SURROGATE%'
        or sequence_name like '%SYRCRMI_SURROGATE%'
        or sequence_name like '%TBRACCD_SURROGATE%'
        or sequence_name like '%STVSBGI_SURROGATE%'
        or sequence_name like '%SORBTAG_SURROGATE%'
        or sequence_name like '%SORBTAL_SURROGATE%'
        or sequence_name like '%SHRTGRD_SURROGATE%'
        or sequence_name like '%SHBTATC_SURROGATE%'
        or sequence_name like '%SHRTATC_SURROGATE%'
        or sequence_name like '%SORBDMO_SURROGATE%'
        or sequence_name like '%SOBSBGI_SURROGATE%'
        or sequence_name like '%STVBCHR_SURROGATE%'
        or sequence_name like '%SORBCHR_SURROGATE%'
        or sequence_name like '%SORBCMT_SURROGATE%'
        or sequence_name like '%SORTEST_SURROGATE%'
        or sequence_name like '%STVCIPC_SURROGATE%'
        or sequence_name like '%STVTESC_SURROGATE%'
        or sequence_name like '%STVTSRC_SURROGATE%'
        or sequence_name like '%SSBSECT_SURROGATE%'
        or sequence_name like '%SSRLINK_SURROGATE%'
        or sequence_name like '%SSBXLST_SURROGATE%'
        or sequence_name like '%SSRXLST_SURROGATE%'
        or sequence_name like '%SSRMEET_SURROGATE%'
        or sequence_name like '%SIRASGN_SURROGATE%'
        or sequence_name like '%SFBETRM_SURROGATE%'
        or sequence_name like '%SFRSTCR_SURROGATE%'
        or sequence_name like '%SGRSATT_SURROGATE%'
        or sequence_name like '%TBRMEMO_SURROGATE%'
        or sequence_name like '%SARCHKL_SURROGATE%'
        or sequence_name like '%SPRHOLD_SURROGATE%'
        or sequence_name like '%SGRSCMT_SURROGATE%'
        or sequence_name like '%SHRMRKS_SURROGATE%'
        or sequence_name like '%SHRMRKA_SURROGATE%'
        or sequence_name like '%SMBSLIB_SURROGATE%'
        or sequence_name like '%SMRSWAV_SURROGATE%'
        or sequence_name like '%SMRSWPV_SURROGATE%'
        or sequence_name like '%SHRDGMR_SURROGATE%'
       and sequence_owner ='SATURN';
       
       V_CUR C_SEQ%ROWTYPE;
 BEGIN
       
      OPEN C_SEQ;
      LOOP
     
      FETCH C_SEQ INTO V_CUR;
      EXIT WHEN C_SEQ%NOTFOUND;
           
            VAR_EXEC:= 'SELECT SATURN.'||V_CUR.SEQUENCE_NAME||'.NEXTVAL INTO '||ULT_SEQ||' FROM DUAL';
            EXECUTE IMMEDIATE (VAR_EXEC) ; -- esta es la linea 87
           
            VAL_SEQ := V_CUR.LAST_NUMBER - ULT_SEQ;
           
            IF VAL_SEQ > 0 THEN
           
            VAR_EXEC :='ALTER SEQUENCE SATURN.'||V_CUR.SEQUENCE_NAME
            ||' INCREMENT BY '||VAL_SEQ;
           
            EXECUTE IMMEDIATE (VAR_EXEC);
           
            VAR_EXEC := 'SELECT SATURN.'||V_CUR.SEQUENCE_NAME||'.NEXTVAL FROM DUAL';
           
            EXECUTE IMMEDIATE (VAR_EXEC);
           
            VAR_EXEC :='ALTER SEQUENCE SATURN.'||V_CUR.SEQUENCE_NAME
            ||' INCREMENTE BY 1';
           
            EXECUTE IMMEDIATE (VAR_EXEC);
     
            END IF;
                 
      END LOOP;
      CLOSE C_SEQ; 
 END; 


ORA-00936: falta una expresión
ORA-06512: en "BANINST1.SP_SEQ_TEST", línea 87
ORA-06512: en línea 1
   

tambien intente hacerlo con un cursor de manera distinta pero casualmente llegue al mismo error xD
Código:

declare

NOM_SEQ  VARCHAR2(100);
ULT_SEQ  NUMBER;
VAL_SEQ  NUMBER;
NEXT_SEQ NUMBER;

BEGIN

FOR CUR IN (
    SELECT seQuence_name, LAST_NUMBER   
      from all_sequenceS
     where sequence_name like '%SPRIDEN_SURROGATE%'
        or sequence_name like '%GTVZIPC_SURROGATE%'
        or sequence_name like '%STVCNTY_SURROGATE%'
        or sequence_name like '%SPRADDR_SURROGATE%'
        or sequence_name like '%SPRTELE_SURROGATE%'
        or sequence_name like '%SPBPERS_SURROGATE%'
        or sequence_name like '%GOREMAL_SURROGATE%'
        or sequence_name like '%SPREMRG_SURROGATE%'
        or sequence_name like '%GOBINTL_SURROGATE%'
        or sequence_name like '%SPRMEDI_SURROGATE%'
        or sequence_name like '%SPRHOLD_SURROGATE%'
        or sequence_name like '%SORFOLK_SURROGATE%'
        or sequence_name like '%SGBSTDN_SURROGATE%'
        or sequence_name like '%SGRSATT_SURROGATE%'
        or sequence_name like '%SGRSCMT_SURROGATE%'
        or sequence_name like '%SGRCHRT_SURROGATE%'
        or sequence_name like '%SIBINST_SURROGATE%'
        or sequence_name like '%SGRADVR_SURROGATE%'
        or sequence_name like '%SHRTTRM_SURROGATE%'
        or sequence_name like '%SHRTCKN_SURROGATE%'
        or sequence_name like '%SHRTCKG_SURROGATE%'
        or sequence_name like '%SHRTCKL_SURROGATE%'
        or sequence_name like '%SARADAP_SURROGATE%'
        or sequence_name like '%SARAPPD_SURROGATE%'
        or sequence_name like '%SORHSCH_SURROGATE%'
        or sequence_name like '%SYRCRMI_SURROGATE%'
        or sequence_name like '%TBRACCD_SURROGATE%'
        or sequence_name like '%STVSBGI_SURROGATE%'
        or sequence_name like '%SORBTAG_SURROGATE%'
        or sequence_name like '%SORBTAL_SURROGATE%'
        or sequence_name like '%SHRTGRD_SURROGATE%'
        or sequence_name like '%SHBTATC_SURROGATE%'
        or sequence_name like '%SHRTATC_SURROGATE%'
        or sequence_name like '%SORBDMO_SURROGATE%'
        or sequence_name like '%SOBSBGI_SURROGATE%'
        or sequence_name like '%STVBCHR_SURROGATE%'
        or sequence_name like '%SORBCHR_SURROGATE%'
        or sequence_name like '%SORBCMT_SURROGATE%'
        or sequence_name like '%SORTEST_SURROGATE%'
        or sequence_name like '%STVCIPC_SURROGATE%'
        or sequence_name like '%STVTESC_SURROGATE%'
        or sequence_name like '%STVTSRC_SURROGATE%'
        or sequence_name like '%SSBSECT_SURROGATE%'
        or sequence_name like '%SSRLINK_SURROGATE%'
        or sequence_name like '%SSBXLST_SURROGATE%'
        or sequence_name like '%SSRXLST_SURROGATE%'
        or sequence_name like '%SSRMEET_SURROGATE%'
        or sequence_name like '%SIRASGN_SURROGATE%'
        or sequence_name like '%SFBETRM_SURROGATE%'
        or sequence_name like '%SFRSTCR_SURROGATE%'
        or sequence_name like '%SGRSATT_SURROGATE%'
        or sequence_name like '%TBRMEMO_SURROGATE%'
        or sequence_name like '%SARCHKL_SURROGATE%'
        or sequence_name like '%SPRHOLD_SURROGATE%'
        or sequence_name like '%SGRSCMT_SURROGATE%'
        or sequence_name like '%SHRMRKS_SURROGATE%'
        or sequence_name like '%SHRMRKA_SURROGATE%'
        or sequence_name like '%SMBSLIB_SURROGATE%'
        or sequence_name like '%SMRSWAV_SURROGATE%'
        or sequence_name like '%SMRSWPV_SURROGATE%'
        or sequence_name like '%SHRDGMR_SURROGATE%'
       and sequence_owner ='SATURN'
       )
       
      LOOP -- esta es la linea 78
            EXECUTE IMMEDIATE 'SELECT SATURN.'||CUR.SEQUENCE_NAME||'.NEXTVAL INTO '||ULT_SEQ||' FROM DUAL';
            VAL_SEQ := CUR.LAST_NUMBER - ULT_SEQ;
           
            IF VAL_SEQ > 0 THEN
         
            EXECUTE IMMEDIATE 'ALTER SEQUENCE SATURN.'||CUR.SEQUENCE_NAME
            ||' INCREMENT BY '||VAL_SEQ;
           
            EXECUTE IMMEDIATE 'SELECT SATURN.'||CUR.SEQUENCE_NAME||'.NEXTVAL FROM DUAL';
           
            EXECUTE IMMEDIATE 'ALTER SEQUENCE SATURN.'||CUR.SEQUENCE_NAME
            ||' INCREMENTE BY 1';
     
            END IF;
           
      END LOOP;
       
 END; 

ORA-00936: falta una expresión
ORA-06512: en línea 78

muchas gracias por su ayuda saludos


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Ayuda con error de sintaxis en formulario PHP
PHP
oscarj24 2 2,970 Último mensaje 8 Junio 2010, 20:05 pm
por oscarj24
Error de sintaxis en PHP :S
PHP
oscarj24 3 3,231 Último mensaje 17 Junio 2010, 04:49 am
por oscarj24
error de sintaxis « 1 2 »
Programación C/C++
mapers 10 7,795 Último mensaje 22 Septiembre 2010, 06:14 am
por [L]ord [R]NA
volviendome loco error en sql sintaxis LA 1 ME DA ERROR Y SI REPITO ME DA ok
Java
yo_lestat 0 2,124 Último mensaje 17 Agosto 2012, 20:43 pm
por yo_lestat
Error de sintaxis en la instrucción INSERT INTO. Ayuda porfavor!
.NET (C#, VB.NET, ASP)
airtraffic 2 2,920 Último mensaje 12 Febrero 2013, 14:51 pm
por HdM
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines