While not enter the cycle...

because the procedure did not execute the process ...
While not enter the cycle ...
create or replace
Procedure metodo_inventario( tipo_inventario varchar2 )
is
cursor compras is select id_tp_movimiento
from c_factura_aux
where estado = 1
and fecha_Factura = (select min(fecha_factura)
from c_factura_aux
where estado = 1);
pl_aux           number;
pl_fecha_factura      date;
pl_numero_factura     number;
pl_id_tp_movimiento      number;     
pl_id_tp_movimientos NUMBER;
pl_id_producto     number;
pl_cantidad          number;
pl_vlr_unitario     number;
pl_vlr_vairable      number;
pl_vlr_peps           number;
pl_vlr_upes           number;
pl_sum_aux          number;
pl_cant_aux          number;
pl_vlr_promedio number;
pl_vlr_variable number;
cont number;
Begin      
     pl_vlr_promedio :=0;
     pl_vlr_peps      :=0;     
     pl_vlr_upes      :=0;
     pl_sum_aux     :=0;
     pl_cant_aux     :=0;
cont :=0;
--pl_id_tp_movimientos  := 0;
--pl_id_tp_movimiento   := 0;
DBMS_OUTPUT.PUT_LINE('<<---- Se acabo de declarar las variables -->>> ');
DBMS_OUTPUT.PUT_LINE('----- ');
     --if (tipo_inventario = '%PEPS%') then
open compras;
DBMS_OUTPUT.PUT_LINE('Se abrio el cursor -->>> ');
fetch compras into plid_tp_movimiento;_*
while compras%found loop*
DBMS_OUTPUT.PUT_LINE('Acaba de ingresar al cursor -->>> ');
DBMS_OUTPUT.PUT_LINE('Abre el Ciclo Mientras');
DBMS_OUTPUT.PUT_LINE('pl_id_tp_movimientos es '||pl_id_tp_movimientos );
DBMS_OUTPUT.PUT_LINE('pl_id_tp_movimiento es '||pl_id_tp_movimiento );
select min(FECHA_FACTURA)
,     min(NUMERO_FACTURA)
into pl_fecha_factura, pl_numero_factura
from      c_factura_aux
where     estado = 1;
select id_tp_movimiento
into pl_id_tp_movimiento
from c_factura_aux
where numero_factura = pl_numero_factura;
--if (pl_id_tp_movimiento = '%COMPRA%') then
          if (pl_id_tp_movimiento = 4) then
select FECHA_FACTURA
,     NUMERO_FACTURA
,     ID_TP_MOVIMIENTO
,     ID_PRODUCTO
,     CANTIDAD           -- cantidad
,     VLR_UNITARIO               -- vlr unitario
,     (CANTIDAD * VLR_UNITARIO)     -- vlr total
INTO     pl_fecha_factura      
,     pl_numero_factura     
,     pl_id_tp_movimiento      
,     pl_id_producto     
,     pl_cantidad          
,     pl_vlr_unitario     
,     pl_vlr_variable
from      c_factura_aux
where     NUMERO_FACTURA = pl_numero_factura
and      Estado = 1;
select cantidad, vlr_unitario
into      pl_cantidad, pl_vlr_unitario
from c_factura_aux
where estado = 1
and numero_factura = pl_numero_factura;
update c_factura_aux set estado = 0
where numero_factura = pl_numero_factura;
pl_cant_aux := pl_cantidad+pl_cant_aux;
pl_vlr_variable := pl_vlr_peps+pl_vlr_variable;
DBMS_OUTPUT.PUT_LINE('apenas se va insertar la informacion -->>> ');
insert into c_inventario_final(FECHA_FACTURA, ID_TIPO_MOVIMIENTO,
VLR_UNITARIO, E_CANTIDAD_PRODUCTO, E_VLR_FACTURA, S_CANTIDAD_PRODUCTO,
S_VLR_FACTURA, IF_CANTIDAD, IF_VLR, ESTADO_FACTURA) values (pl_fecha_factura,
pl_numero_factura, pl_id_tp_movimiento, pl_id_producto, pl_cantidad,
pl_vlr_unitario, pl_vlr_variable, pl_cant_aux, pl_vlr_variable, 1);
cont := cont+1;
DBMS_OUTPUT.PUT_LINE('numero de vuelta va en --> ' ||cont);
end if;
end loop;
close compras;
--end if;
--end if;
exception
when others then
dbms_output.put_line(sqlerrm);
DBMS_OUTPUT.PUT_LINE('hay error, Corregir...');
--> PROCEDIMIENTO DE GENERACION MEOTDOS DE INVENTARIO...
end;
I appreciate your attention and cooperation extended ...
Martinez Salazar Reynel ...
good day ...

It looks like you are asking why your procedure never entered WHILE loop. If so, the answer woud be as follows:
select id_tp_movimiento
from c_factura_aux
where estado = 1
and fecha_Factura = (select min(fecha_factura)
from c_factura_aux
where estado = 1);does not return any rows. Try executing the above SQL and make sure table c_factura_aux has rows with estado = 1 and at least one of these rows has NOT NULL fecha_factura.
SY.

Similar Messages

  • I seem to not enter the correct answers to my security questions for itunes to buy an in-app purchase and also cannot answer the questions exactly like i answered them when creating the account for my ipod, how do i find out what answers i put

    I seem to not enter the correct answers to my security questions for itunes to buy an in-app purchase and also cannot answer the questions exactly like i answered them when creating the account for my ipod, how do i find out what answers i put for my ipod touch and itunes?

    Try these previous discusssions:
    recover answers to security questions: Apple Support Communities
    how do i change apple ID security...: Apple Support Communities

  • When ı update firefox 7 to 8 I can not enter the facebook site, when I try it, it says Uyumsuz bir internet tarayıcısı kullanıyorsun. ( it means in english : you are using an unsuportted web browser) how I can solve this problem?

    when ı update firefox 7 to 8 I can not enter the facebook site, when I try it, it says Uyumsuz bir internet tarayıcısı kullanıyorsun. ( it means in english : you are using an unsuportted web browser) how I can solve this problem?

    Step by step, how did you arrive at seeing this agreement?

  • In visual studio 2012 coded Ui test is not entering the URL

    Hi,
    When i try to run the recorded script it is opening the new tab but it is not entering the new URL in to tab. It is showing test has failed due to some stack trace error. I am new to coded UI test am learning it. Is it timing error i need to place some sleep
    time in between them?
    Thanks
    Prasanth
    Prasanth

    Hi Prasanth,
    Generally, the coded UI test is used to verify that the whole application, including its user interface, is functioning correctly. Coded UI Tests are particularly useful where there is validation or other logic in the user interface, for example in a web
    page. They are also frequently used to automate an existing manual test.
    In other words, we can use coded UI test to verify the UI control instead of verifying the URL.
    For more information:
    http://msdn.microsoft.com/en-us/library/dd286726(v=vs.110).aspx
    However, if you want to record script it is opening the new tab and then entering the new URL in to tab, I suggest you can use the Web Performance test to record and verify the request works correctly.
    Reference:
    Walkthrough: Recording and Running a Web Performance Test
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • HT1296 How to transfer data between 2 iphones while not having the old one

    How can I transfer or sync  all the data from my previous iphone to the new one while not having the first(it's not working due to high voltage problem of the area),and of course not loosing anything?

    Correct, you do not need your old iPhone. All you need is your old iPhone's backup. If you had an old model iPhone and wanted to replace it with a newer one, restoring it from a backup of your older one would be the process you would use.
    Make sure before you start that your new iPhone is either really new or completely erased. If you did not just buy it new, do Settings > General > Reset > Erase all content and settings before restoring it from your old iPhone's backup.

  • Why not enter the Flash Media Playback setup website?

    Why not enter the Flash Media Playback setup website?
    My Live & Vod Flash Service can't run.
    Is Flash Media Playback termination of services?

    How to access the page ??
    Flash Media Playback Setup page
    To copy the embed code, visit the Flash Media Playback Setup page at osmf.org/configurator/fmp/. The Flash Media Playback Setup page (see Figure 2) contains two main sections on the left and the right. Use the form on the left to enter the values for your video: video source location and various custom settings. The right side of the page contains a preview player and the preview embed code. Enter the values and then click Preview to generate the proper embed code.
    I tried the above link and it takes me to the blogs.adobe.com .
    Pls advice

  • Why my iphone screen can not open the key and can not enter the menu

    why my iphone screen can not open the key and can not enter the menu

    Your issue is not clear - are you saying your phone is disabled and/or you forgot the passcode?
    http://support.apple.com/kb/ht1212

  • I can not enter the crs administration lost the password.

    I can not enter the crs administration lost the password.
    How could retrieve the password to enter the administration interface crs?
    Please help me,
    Natalia

    For versions prior to version 8, there is a procedure to do this.  You'll find the details documented in this thread:
    https://supportforums.cisco.com/message/3196728#3196728

  • GT70 not enter the bios

    My GT70 starts normally but not enter the bios when it starts down the DEL key gets black screen and not out of it, neither can change the boot by F11, gets black screen also,
    Have some way of doing the bios update for windows 81

    Hello
    My laptop is a MSI GT70 GT70 Dominator Dragon Edition 22PC-1886
    MY PROBLEM AND NOT ENTERING THE NOTEBOOK BIOS, AND CAN NOT BOOT SELECT, DO NOT BOOT BY USB.
    NEED BIOS UPDATE FOR RETURN TO WORK
    The NOTEBOOK WAS PURCHASED IN THE DAY 10.14.2014 IN USA, BUT TODAY I'M IN BRAZIL

  • TS1292 I am having trouble with my iTunes Gift card code. It says I have not entered the code correctly when I have-repeatedly. How can I redeem my iTunes voucher?

    I am having trouble with my iTunes Gift card code. It says I have not entered the code correctly when I have…repeatedly. How can I redeem my iTunes voucher?

    If the card was issued in the same country as you and your account are based and the page that you posted from doesn't help, then you will need to try contacting iTunes Support (you will probably need to give them images of the front and back of the card, and possibly its receipt) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then iTunes Cards And Codes

  • I now have two user names showing at times. I did not enter the second one. What does this mean and how do I delete the unwanted one?

    I don't have any details. It just showed up.

    Use these steps to remove saved (form) data from a drop-down list:
    #click the (empty) input field on the web page to open the drop-down list
    #highlight an entry in the drop-down list with the mouse or cursor Down key<br>do not click the mouse or press the Enter key
    #press the Delete key (on Mac: Shift+Delete) to delete the highlighted entry
    *http://kb.mozillazine.org/Deleting_autocomplete_entries

  • When adjusting the date of a photo I can not enter the year

    When in I photo , and I need to adjust the date of the photo that I have scanned in, I go to that drop down menu and try to enter the year but can not do so.

    I go to that drop down menu
    Which menu would that be?  Have you tried the Photos ➙ Batch Change ➙ Date menu option?  That menu option should add the Image Capture date to the EXIF data for the photo.
    OT

  • Why no recording tracks and not enter the GPS coor...

    It is interesting for sports (running, skiing, cycling, tracking)
    I can not find the application running on a Nokia 2710 which can record my track, time, average speed and keep it on a flash card
    Also interesting opportunity to send their GPS coordinates best with the help of SMS to my friends (which is important for security reasons). Also interesting is the input of GPS coordinates so that when you travel is not possible to install the application in an Internet cafe and noted the interest point on the map, as well as meet with their friends using GPS coordinates

    That is probably because the 2710 is a low end model and uses the more basic S40 operating system. What you need is a Nokia S60 smartphone which support a raft applications which do exactly as you require including one called Sports Tracker.

  • Can you use the data while NOT on the EDGE network?

    I am wondering if when I travel through SD and ND I will be able to use my data (email, web, maps...etc.) I am in Minneapolis on the EDGE network, but I'm concerned that in Sioux Falls, SD no a GPRS network I won't be able to use 1/2 the functions on my phone.
    Before release the rumor was that it would work, but has anyone actually tried it yet?

    So essentially you're asking... if there's no Wi-Fi or EDGE coverage will you be able to use the data network features of the phone?
    In short... from my experience the answer appears to be "no, it won't work." Allow me to elaborate:
    I disabled Wi-Fi access and found an EDGE dead spot where the phone could not connect to the EDGE data network but I could place a phone call. When I attempted to launch Mail and sync, I got a message saying that my IMAP server could not be reached. When attempted to launch a website, I received an error message stating that the server could not be reached.
    End result, I was unable to use any of the data network features of the phone. So it would appear... that the answer is no. It will not use the basic GPRS undearlining network. However it's quite possible that your results may vary.

  • I have given a ipod touch to my kid. However, not entering the right password. The ipod has been disabled for  try again in 21,531,444 minutes

    How do I enable my disable Ipod touch. My kid does not rember the password?

    Do as the manual says and restore.
    iPhone User Guide (For iOS 4.2 and 4.3 Software)

Maybe you are looking for

  • Error in a script and i can´t find it

    Hi, I found a very interesting Tutorial about an Archtitcural Fly-Trough at the Adobe Sites. As I tried make the same i got an Error in the Lingo Script that was providet with the Tutorial. I have no experience with Lingo so I can´t find the Error. C

  • Compatibility with Mac

    I have a new Nokia 5300, before it i use a SOny Ericcson W600i fully compatible with Mac Os X and iSync never had problem and the compatibility is awesom easy to use. Now in This case with Nokia 5300 i can't find software to make it compatible in a a

  • Programmatically change a NSWindow contents

    I've got a single NSView that is currently inside my window. The idea is create an OpenGL based tool with this view being the main canvas someone would be working with. The problem is I want to be able to attach or detach tools in the form of NSBox t

  • Sync audio books

    I have three audio books on itunes on my laptop, but it wont let me sync them to my iphone? any ideas? Thanks you guys in advance...

  • IDOC Info Fram Scrap

    Dear all, Can you please send me all the technical details about the idocs.like how to create a custom idoc,Wht is requirement of partner profile,Distribution model etc. Thanks , Srinivasa