PLSQL error 103

The query below worked very well in the Sql environment

Some
FROM (SELECT (ABS (TRUNC (SYSDATE) - TRUNC (rsh.expected_receipt_date))) x
, rsh.shipment_num y
OF apps.rcv_shipment_lines rsl
apps.rcv_shipment_headers rsh
apps.po_headers_all poh
apps.po_line_locations_all survey
apps.po_lines_all pol
WHERE pol.item_id = 36123
AND poll.ship_to_organization_id = 102
AND poh.po_header_id = 172624
AND rsl.shipment_header_id = rsh.shipment_header_id
AND rsh.asn_type IN ('CRASH', "ASBN")
AND poh.po_header_id = poll.po_header_id
AND pol.po_line_id = poll.po_line_id
AND poll.line_location_id = rsl.po_line_location_id
AND rsl.shipment_line_status_code = 'EXPECTED '.
ORDER BY x)
WHERE ROWNUM < = 1

I used the same query in form and forms in the compilation don't not order by not allowed if I remove the order she compilation without problem. Please help in this regard

-Added by CR308
PACKAGE mtu_cr308_sd_det BODY
IS
PROCEDURE mtu_cr308_sd_det_proc
IS
l_asn_count NUMBER: = 0;
l_asn_no VARCHAR2 (30): = NULL;
l_source_org_intord NUMBER: = 0;
l_dest_org_intord NUMBER: = 0;
l_intord_org NUMBER: = 0;
l_source_org_req NUMBER: = 0;
l_dest_org_req NUMBER: = 0;
l_req_org NUMBER: = 0;
l_source_org_intrec NUMBER: = 0;
l_dest_org_intrec NUMBER: = 0;
l_intrec_org NUMBER: = 0;
BEGIN
IF: disposition_type = 1
THEN
BEGIN
BEGIN
SELECT COUNT (rsh.shipment_num)
rsh.shipment_num
IN l_asn_count
l_asn_no
OF apps.rcv_shipment_lines rsl
apps.rcv_shipment_headers rsh
apps.po_headers_all poh
apps.po_line_locations_all survey
apps.po_lines_all pol
WHERE pol.item_id =: criteria.inventory_item_id
AND poll.ship_to_organization_id =: parameter.org_id
AND poh.po_header_id =: sd_detail.disposition_id
AND rsl.shipment_header_id = rsh.shipment_header_id
AND rsh.asn_type IN ('CRASH', "ASBN")
AND poh.po_header_id = poll.po_header_id
AND pol.po_line_id = poll.po_line_id
AND poll.line_location_id = rsl.po_line_location_id
AND rsl.shipment_line_status_code = 'EXPECTED '.
AND rsl.quantity_shipped =: sd_detail.quantity
GROUP BY rsh.shipment_num;
EXCEPTION
WHEN TOO_MANY_ROWS
THEN
Some
IN: sd_detail.mtuidfdessc
FROM (SELECT (ABS (TRUNC (SYSDATE) - TRUNC (rsh.expected_receipt_date))) x
, rsh.shipment_num y
OF apps.rcv_shipment_lines rsl
apps.rcv_shipment_headers rsh
apps.po_headers_all poh
apps.po_line_locations_all survey
apps.po_lines_all pol
WHERE pol.item_id =: criteria.inventory_item_id
AND poll.ship_to_organization_id =: parameter.org_id
AND poh.po_header_id =: sd_detail.disposition_id
AND rsl.shipment_header_id = rsh.shipment_header_id
AND rsh.asn_type IN ('CRASH', "ASBN")
AND poh.po_header_id = poll.po_header_id
AND pol.po_line_id = poll.po_line_id
AND poll.line_location_id = rsl.po_line_location_id
AND rsl.shipment_line_status_code = 'EXPECTED '.
ORDER BY x)
WHERE ROWNUM < = 1;
WHILE OTHERS
THEN
l_asn_count: = 0;
END;

IF l_asn_count = 0
THEN
SOME comments
IN: sd_detail.mtuidfdessc
OF po_headers_all
WHERE po_header_id =: sd_detail.disposition_id;
ON THE OTHER
: sd_detail.mtuidfdessc: = l_asn_no;
END IF;
EXCEPTION
WHILE OTHERS
THEN
: sd_detail.mtuidfdessc: = NULL;
END;
ELSIF: disposition_type = 2
THEN
BEGIN
IF: sd_detail.sd_type = "internal order".
THEN
BEGIN
SELECT prl.source_organization_id
prl.destination_organization_id
IN l_source_org_intord
l_dest_org_intord
OF po_requisition_headers_all prh
po_requisition_lines_all prl
oe_order_lines_all oel
oe_order_headers_all oeh
WHERE prh.type_lookup_code = 'INTERNAL '.
AND NVL (prl.cancel_flag, 'n') <>'Y '.
AND NVL (prh.transferred_to_oe_flag, 'n') = 'Y '.
AND = NVL (oel.source_document_line_id-9)
PRL.requisition_line_id
AND oeh.orig_sys_document_ref = prh.segment1
AND oeh.header_id = oel.header_id
AND prl.requisition_header_id = prh.requisition_header_id
AND oeh.order_number =
SUBSTR (: sd_detail.disp)
1
, (INSTR (: sd_detail.disp, '.') - 1).
)
AND prl.item_id =: criteria.inventory_item_id
AND ROWNUM < 2;

IF l_source_org_intord =: parameter.org_id
THEN
l_intord_org: = l_dest_org_intord;
ON THE OTHER
l_intord_org: = l_source_org_intord;
END IF;

SELECT organization_code
IN: sd_detail.mtuidfdessc
Of org_organization_definitions
WHERE organization_id = l_intord_org;
EXCEPTION
WHILE OTHERS
THEN
: sd_detail.mtuidfdessc: = NULL;
END;
ON THE OTHER
SELECT party.party_name
IN: sd_detail.mtuidfdessc
Part hz_parties
hz_cust_accounts_all cust_acct
ooh oe_order_headers_all
WHERE ooh.sold_to_org_id = cust_acct.cust_account_id
AND cust_acct.party_id = party.party_id
AND ooh.order_number =
SUBSTR (: sd_detail.disp)
1
, (INSTR (: sd_detail.disp, '.') - 1).
);
END IF;
EXCEPTION
WHILE OTHERS
THEN
: sd_detail.mtuidfdessc: = NULL;
END;
ELSIF (: disposition_type = 4) OR (: disposition_type = 5)
THEN
BEGIN
SELECT SUBSTR (hp.party_name, 1: 22)
IN: sd_detail.mtuidfdessc
OF cs_incidents_all_b ciab
csd_repairs cr
csd_repair_job_xref crjx
hz_parties hp
, wip_entities we
WHERE ciab.incident_id = cr.incident_id
AND hp.party_id = ciab.customer_id
AND cr.repair_line_id = crjx.repair_line_id
AND crjx.wip_entity_id = we.wip_entity_id
AND we.wip_entity_id =: sd_detail.disposition_id
AND ciab.inv_organization_id =: parameter.org_id;
EXCEPTION
WHILE OTHERS
THEN
: sd_detail.mtuidfdessc: = NULL;
END;
ELSIF: disposition_type = 8
THEN
BEGIN
SELECT rsl.from_organization_id
rsl.to_organization_id
IN l_source_org_intrec
l_dest_org_intrec
OF rcv_shipment_headers rsh
rcv_shipment_lines rsl
WHERE rsh.shipment_header_id = rsl.shipment_header_id
AND rsl.item_id =: criteria.inventory_item_id
AND rsh.shipment_num =: sd_detail.disp
AND ROWNUM < 2;

IF l_source_org_intrec =: parameter.org_id
THEN
l_intrec_org: = l_dest_org_intrec;
ON THE OTHER
l_intrec_org: = l_source_org_intrec;
END IF;

SELECT organization_code
IN: sd_detail.mtuidfdessc
Of org_organization_definitions
WHERE organization_id = l_intrec_org;
EXCEPTION
WHILE OTHERS
THEN
: sd_detail.mtuidfdessc: = NULL;
END;
ELSIF: disposition_type = 10
AND: sd_detail.sd_type = "internal Requisition.
THEN
BEGIN
SELECT prl.source_organization_id
prl.destination_organization_id
IN l_source_org_req
l_dest_org_req
OF po_requisition_headers_all prh
po_requisition_lines_all prl
WHERE prh.type_lookup_code = 'INTERNAL '.
AND NVL (prl.cancel_flag, 'n') <>'Y '.
AND prl.requisition_header_id = prh.requisition_header_id
AND prl.item_id =: criteria.inventory_item_id
AND prh.segment1 =: sd_detail.disp
AND ROWNUM < 2;

IF l_source_org_req =: parameter.org_id
THEN
l_req_org: = l_dest_org_req;
ON THE OTHER
l_req_org: = l_source_org_req;
END IF;

SELECT organization_code
IN: sd_detail.mtuidfdessc
Of org_organization_definitions
WHERE organization_id = l_req_org;
EXCEPTION
WHILE OTHERS
THEN
: sd_detail.mtuidfdessc: = NULL;
END;
ELSIF: disposition_type = 31
THEN
BEGIN
SELECT we.wip_entity_name
IN: sd_detail.mtuidfdessc
OF mtl_material_transactions_temp mmtt
, wip_entities we
WHERE we.wip_entity_id = mmtt.transaction_source_id
AND we.organization_id =: parameter.org_id
AND mmtt.move_order_header_id =: sd_detail.disp
AND mmtt.inventory_item_id =: criteria.inventory_item_id
AND mmtt.organization_id =: parameter.org_id;
EXCEPTION
WHILE OTHERS
THEN
: sd_detail.mtuidfdessc: = NULL;
END;
ELSIF: disposition_type IS NOT NULL
THEN
: sd_detail.mtuidfdessc: =: sd_detail.disp;
END IF;

-Is the color stuff
IF (: control.request_date =: requirement_date)
THEN
DISPLAY_ITEM ('SD_DETAIL.) MTUIDFDESSC', 'SELECTED_DATA');
END IF;

IF: on_hand_quantity < 0
THEN
DISPLAY_ITEM ('SD_DETAIL.) MTUIDFDESSC', 'DATA_SPECIAL');
END IF;

IF (: control.request_date =: requirement_date)
AND (: on_hand_quantity < 0)
THEN
DISPLAY_ITEM ('SD_DETAIL.) MTUIDFDESSC', 'SELECTED_DATA_SPECIAL');
END IF;

SET_RECORD_PROPERTY (: SYSTEM.trigger_record)
, "SD_DETAIL".
status
query_status
);
END mtu_cr308_sd_det_proc;

PROCEDURE mtu_cr308_sd_hdr_proc
IS
l_safety_stk_code NUMBER;
BEGIN
BEGIN
SELECT inventory_item_status_code
mrp_safety_stock_code
IN: criteria.mtustatus
l_safety_stk_code
OF mtl_system_items_b
WHERE inventory_item_id =: criteria.inventory_item_id
AND organization_id =: parameter.org_id;
EXCEPTION
WHILE OTHERS
THEN
: criteria.mtustatus: = NULL;
END;

BEGIN
IF l_safety_stk_code = 1
THEN
SELECT safety_stock_quantity
IN: criteria.mtustkqty
OF mtl_safety_stocks
WHERE inventory_item_id =: criteria.inventory_item_id
AND organization_id =: parameter.org_id;
ELSIF l_safety_stk_code = 2
THEN
: criteria.mtustkqty: =.
mtu_item_demand_stockqty_pk.mtu_item_demand_stockqty
(: criteria.inventory_item_id)
,: parameter.org_id
);
ON THE OTHER
: criteria.mtustkqty: = NULL;
END IF;
EXCEPTION
WHILE OTHERS
THEN
: criteria.mtustkqty: = 'No Stock of security. "
END;

BEGIN
SELECT category_concat_segs
IN: criteria.mtusourcingrule
OF mtl_item_categories_v
WHERE category_set_name = 'Planning MTU'
AND inventory_item_id =: criteria.inventory_item_id
AND organization_id =: parameter.org_id;
EXCEPTION
WHILE OTHERS
THEN
: criteria.mtusourcingrule: = NULL;
END;

BEGIN
SELECT mac.abc_class_name
IN: criteria.mtuabccode
OF mtl_abc_assignment_groups maag
mtl_abc_assignments maa
mtl_abc_classes mac
mtl_abc_assgn_group_classes maagc
mrp_parameters mrp
WHERE maag.assignment_group_id = maa.assignment_group_id
AND maa.abc_class_id = mac.abc_class_id
AND maagc.assignment_group_id = maa.assignment_group_id
AND maa.assignment_group_id = mrp.default_abc_assignment_group
AND mrp.organization_id = maag.organization_id
AND maagc.abc_class_id = maa.abc_class_id
AND maa.inventory_item_id =: criteria.inventory_item_id
AND maag.organization_id =: parameter.org_id;
EXCEPTION
WHILE OTHERS
THEN
: criteria.mtuabccode: = NULL;
END;
END mtu_cr308_sd_hdr_proc;
END;

Best regards
Mahi

Hello
These types of forms oracle sql does not support. You must use the alternative for this like... to create a cursor and retrieve the data in a loop and out of this loop at first time. For example...

DECLARE
CURSOR F_REC IS
SELECT   (ABS (TRUNC (SYSDATE) - TRUNC (rsh.expected_receipt_date))) x
                , rsh.shipment_num y
             FROM apps.rcv_shipment_lines rsl
                , apps.rcv_shipment_headers rsh
                , apps.po_headers_all poh
                , apps.po_line_locations_all poll
                , apps.po_lines_all pol
            WHERE pol.item_id = 36123
              AND poll.ship_to_organization_id = 102
              AND poh.po_header_id = 172624
              AND rsl.shipment_header_id = rsh.shipment_header_id
              AND rsh.asn_type IN ('ASN', 'ASBN')
              AND poh.po_header_id = poll.po_header_id
              AND pol.po_line_id = poll.po_line_id
              AND poll.line_location_id = rsl.po_line_location_id
              AND rsl.shipment_line_status_code = 'EXPECTED'
         ORDER BY x;
  v_val NUMBER;
BEGIN
  FOR G_REC IN F_REC LOOP
    V_VAL:=G_REC.V;
    EXIT;
  END LOOP;
  -- Here your other functionality...
END;

-Clément

Tags: Oracle Development

Similar Questions

  • When you try to connect to my email I get error 103. (net connection error - abandoned)

    e-mail connection problems

    When I try ti sign in is blindly. Most of the time I get error 103 (net connection error-abandoned) unknown error, why this is happening and what can do about it

    Usually, it is a problem on the server or your internet connection.  Contact your e-mail and internet providers to ensure that they are not questions.

    Steve

  • i/o error 103

    whenever I open an internet connection shows a flag with the code i/o error 103 error window and im not able to open the website, what can I do to solve this problem?

    Hello

    Run a malware scan by installing Malwarebytes:
    http://download.CNET.com/Malwarebytes-anti-malware/3000-8022_4-10804572.html

    Perform a clean boot and check in safe mode:
    Clean boot:
    http://support.Microsoft.com/kb/929135

    Too boot safe mode with network ito start typing the F8 key during reboot.

    All the best!

  • Error on the packaging: error 103: application.qnx is an unexpected element/attribute

    Hi all

    A week ago, I sent my application the second time signed, now I do this third time because accidentally I sent the request with the word "debug" on the icon.

    I'm trying to do anything with the process of signing using the excellent How - to's here here , but unfortunately I'm stuck on the first step, when I try to package I have strange error "error 103: application.qnx is an unexpected element/attribute" on the file my - app.xml.

    What is c? What should do?

    Thank you very much

    Because you have qnx tag in the file. Remove and everything in it - this tag and content belongs to blackberry - tablet.xml. Validator of Adobe (which gives you an error) air does not recognize as a first class citizen, then put all of the additional tags in the additional xml file.

  • Master collection (error 103)

    I downloaded master collection on mac, the download is complete, but it shows on adobe download assistant.

    the Setup file cannot be loacted (error 103). Navigate to the folder where you downloaded the product and start the installation manually!

    Please help > > > >.


    Check this out, it can help. http://helpx.Adobe.com/Creative-Suite/KB/troubleshoot-download-Assistant.html

    Try to download again from http://www.adobe.com/products/creativesuite/mastercollection.html

    Make sure that download you them locally, not to any location on the network.

  • error 103

    How can I fix error 103?

    Adobe Download Troubleshooting Wizard

    Mylenium

  • error 103: application.version is an unexpected element/attribute

    Hi guys, when I publish iOS app to Flash, I get this thing

    Unknown or unexpected element or attribute in the application descriptor file.

    (/ Users/stockingem/Documents/DWP/1-app.xml(44): error 103: application.version is an unexpected element/attribute

    application.version is an unexpected element/attribute

    Please, help to solve!


    http://ns.Adobe.com/air/application/2.6">
        in.rithesh.iPadTestApp.MicroPhoneTest
        1.0.1
        MicroPhoneTest
        MicroPhoneTest
        MicroPhoneTest
        Renaut
       
            MicroPhoneTest
            MicroPhoneTest.swf
            fake
            Auto 
            true 
            Portrait 
       

        MobileDevice office
       
                        UIStatusBarStyle 
                UIStatusBarStyleBlackOpaque 
                UIRequiresPersistentWiFi 
               
                UIApplicationExitsOnSuspend
               
                UIPrerenderedIcon
               
                UIDeviceFamily
               
                    2
               

    ]]> 
            standard
       

    Copy and paste the xml code above format and change according to your needs, make sure that there is no version tags, I saw in your xml file, it is always the version label.

  • error 103: application.initialWindow.autoOrients is an unexpected element/attribute

    Hello.

    I use Flash Builder 4.5 to experiment with the creation of a mobile application for my Nexus One Android.  In order to keep the app in landscape mode, regardless of the orientation of the device, I have read that I need to define the following in the file "AppName - app.xml:

    landscape of < aspectRatio > < / aspectRatio >


    < autoOrients > false < / autoOrients >

    And it does not work very well in the debugger, but when I try to test it on my connected device it throws this error:

    Error occurred during the application of packaging:


    (D:\Projects\FlexMobile\AppName\bin-debug\AppName-App.XML(108): error 103: application.initialWindow.autoOrients is an unexpected element/attribute

    I know that I am able to build and test apps on my phone, I've been through the Flex Test tutorial Mobile (http://www.adobe.com/devnet/flex/testdrivemobile.html) and was able to build and run the application without any problem and this app, I am currently working on that is running on the device if I do not restrict automatic orientation.

    Thank you.

    I have the same problem with FB 4.5. App built and works very well, but if I have the tag it does not build.

    Something is broken, or even the tag has migrated in the AIR 2.6?

    Is it possible to put in place when running?

    Edit: Yes, there are: Stage.autoOrients and Stage.deviceOrientation

    Edit 2: who did not work for me (yet) with Flex 4.

    last update: fake works very well! The problem was that I got it twice in my - app.xml file.

  • How to manage the plsql error occurring in the exception block

    We know how to manage exceptins located in the BEGIN block.
    But I am unable to catch the exception in the exception block. Write an erroeneous code so that the control will go to the exception block and there is also a plsql error, but I am unable to handle that error, it returns the error to the calling environment.

    DECLARE
    CNT NUMBER (5): = 0;

    BEGIN

    Select "Chris" IN double's NTC;
    DBMS_OUTPUT. Put_line (to_char (CNT));

    EXCEPTION
    WHEN invalid_number CAN
    DBMS_OUTPUT. Put_line (' error occurred inside the start block ');

    CNT: = "deba";

    WHILE OTHERS THEN
    DBMS_OUTPUT. Put_line (' error occurred inside the start block ');

    END;

    Please suggest me how to catch this exception?

    Hello

    DECLARE
    CNT NUMBER (5): = 0;

    BEGIN

    Select "Chris" IN double's NTC;
    DBMS_OUTPUT. Put_line (to_char (CNT));

    EXCEPTION
    WHEN invalid_number CAN
    DBMS_OUTPUT. Put_line (' error occurred inside the start block ');

    CNT: = "deba";

    WHILE OTHERS THEN
    DBMS_OUTPUT. Put_line (' error occurred inside the start block ');

    END;

    First of all your exception mouhamadou who you have sent i.e. invalid_number itself does not.
    You should use named exception VALUE_ERROR to catch the exception in the main block.

    SQL> DECLARE
      2  cnt NUMBER(5):=0;
      3  BEGIN
      4  select 'debalina' INTO cnt from dual;
      5  DBMS_OUTPUT.PUT_LINE(to_char(cnt));
      6  EXCEPTION
      7  WHEN Invalid_number THEN
      8  DBMS_OUTPUT.PUT_LINE('error has occured inside main block');
      9  end;
     10  /
    DECLARE
    *
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 4
    
    SQL>  DECLARE
      2   cnt NUMBER(5):=0;
      3  BEGIN
      4  select 'debalina' INTO cnt from dual;
      5  DBMS_OUTPUT.PUT_LINE(to_char(cnt));
      6  EXCEPTION
      7  WHEN VALUE_ERROR THEN
      8  DBMS_OUTPUT.PUT_LINE('error has occured inside main block');
      9  end;
     10  /
    error has occured inside main block
    
    PL/SQL procedure successfully completed.
    

    Your doubts regarding catch the exception in the exception block, you can run as below, by nesting a block Begin in the exception block itself.

    SQL> DECLARE
      2  cnt NUMBER(35):=0;
      3  BEGIN
      4  select 'debalina' INTO cnt from dual;
      5  DBMS_OUTPUT.PUT_LINE(to_char(cnt));
      6  EXCEPTION
      7  WHEN Value_error THEN
      8  DBMS_OUTPUT.PUT_LINE('error has occured inside main block');
      9  Begin
     10  cnt:='deba';
     11  Exception
     12  WHEN OTHERS THEN
     13  DBMS_OUTPUT.PUT_LINE('error has occured inside exception block');
     14  End;
     15  END;
     16  /
    error has occured inside main block
    error has occured inside exception block
    
    PL/SQL procedure successfully completed.
    

    Hope your question is clear.
    :)
    Twinkle

  • PL/SQL error 103

    Select a.l_name, a.cap_qty, a.op_bal, b.c_name, b.p_name of location a join left contract b on
    a.L_Name = b.location;

    This query when I run in SQLPlus and TOAD works well, but in PL/SQL form 6i error show.

    Error 103
    Met the symbol 'LEFT' when waiting for him at the following:

    to have the group meet less order beginning where connect unoin.
    outer joins are represented by '+' and not '*'
    
    select a.l_name,a.cap_qty,a.op_bal,b.c_name,b.p_name
    from location a, contract b
    where a.l_name = b.location(+);
    
  • Driver IVI does not not after the creating application. Get the error 103 "no IVI class session open...» »

    I have an application that is really great to work in Labview and control a bunch of test via the IVI drivers equipment.  I want to build it and make a request.  First of all, I want to just make a request.  Then, I want to do a stand-alone application through the installer.  When I integrate it to an EXE file, then run it on the same machine with installed Labview; It gives me an error:

    "No don't open class IVI session. You must call the class driver VI Initialize before calling a specific driver VI. This error can also occur if the logical name IVI control is set to the IVI evil class. »

    Same computer on which it runs well in Labview.  I don't see any option when generating that look like they have nothing to do with drivers.  Any help?

    He was the driver.  I think I have downloaded the driver at a bad time, when it has been updated.  I got a new today and it works great.

  • error - error 103 6i form met the case of the symbol

    Hello

    I'm in the Form 6i, in the program, I had given the following query where I get an error message. Please see below for queries and screenshot

    slider c3 is select canworkorder.workorderno, sum (case when canptn.fgstat is null then canptn.ptnqty end) intqty

    , sum (case when canptn.fgstat is not null then canptn.ptnqty end) ptnqty

    , min (canptn.ons) Add-ons canworkorder, canptn where canworkorder.pendingqty > 0

    and (canworkorder.workorderno = canptn.workorderno) and canworkorder.pendingqty > 0

    Canworkorder.workorderno group;

    form6i.jpg

    Sandy

    Dear Sir

    Case is not supported by forms. You have 2 options,

    (1) using DECODE instead of the CASE.

    (2) record by using the same query (either design or using CREATE_GROUP_FROM_QUERY) group to create and loop through the record group.

    Manu.

  • can someone help with the following code plsql errors...

    Hello

    If anyone can help with the following code... to get a successful outing.

    create or replace package lib_01 as

    procedure lib_proc01 (p_user_id in numbers, p_user_name in varchar2);

    end lib_01;

    create or replace package body lib_01 as

    procedure lib_proc01 (p_user_id in numbers, p_user_name in varchar2) as

    number of v_user_id;

    v_user_name varchar2 (50);

    number of v_avl_books;

    number of v_avl_days;

    date of v_end_date;

    date of v_return_date;

    Start

    dbms_output.put_line ('Enter User Name');

    dbms_output.put_line (' username :'|| p_user_name);

    Select user_id, user_name in v_user_id v_user_name of user_registration where user_name = p_user_name;

    If v_user_name <>p_user_name then

    dbms_output.put_line (' username is not.) Please submit full name ');

    end if;

    If v_user_id is null or v_user_name is null then

    dbms_output.put_line ("' user not found");

    validate_userLogin;

    on the other

    validate_issuedbooks (p_issuecount);

    end if;

    If v_issuecount < v_avl_books then

    issuebooks;

    on the other

    Number of return of late_fee (p_mem_id, p_extradays, p_latefee_total);

    end if;

    If paid_flag = "Y" then

    issuebooks;

    on the other

    dbms_output.put_line ("' book may be issued due to its maximum reached late fees");

    end if;

    end lib_proc01;

    procedure validate_userLogin is

    procedure reg_proc is

    procedure user_validate (p_id_proof in varchar2, p_id_no out varchar2) is

    v_id_proof varchar2 (20);

    v_id_no varchar2 (20);

    Start

    Select user_name, id_proof, id_no, v_user_name, v_id_proof, v_id_no of user_registration where id_proof = p_id_proof;

    If v_id_proof = "Adhar_Card" then

    dbms_output.put_line ('user a valid proof of ID');

    dbms_output.put_line (' and the id no. :'|| is p_id_no).

    on the other

    dbms_output.put_line ('Invalid ID evidence.) Please submit valid proof of ID ');

    end if;

    exception

    When no_data_found then

    dbms_output.put_line ('No Data found');

    end user_validate;

    procedure member_validate (p_mem_id series)

    v_mem_flag char (1);

    curr_date date: = sysdate;

    date of v_mem_enddate;

    Start

    dbms_output.put_line('Mem_flag:'|| v_mem_flag);

    Select mem_flag in the v_mem_flag of user_login where user_id = v_user_id;

    If v_mem_flag = 'n' or v_mem_flag is null then

    dbms_output.put_line ('The User do not have membership');

    on the other

    Select mem_id in the v_mem_id of user_login where user_id = v_user_id;

    dbms_output.put_line ('the user has membership');

    v_mem_id: = p_mem_id;

    Select mem_enddate in the member_login v_mem_enddate where mem_id = v_mem_id;

    If v_mem_enddate < curr_date then

    dbms_output.put_line ('Membership has expired' | v_mem_id |' on ' | v_mem_enddate);

    on the other

    dbms_output.put_line ('User a validity again' | v_mem_enddate);

    end if;

    end if;

    exception

    When no_data_found then

    dbms_output.put_line ("' no data found");

    while others then

    dbms_output.put_line (' another error.) Please find");

    end member_validate;

    Start

    insert into user_registration values ('& first_name ',' & last_name', null, ' & user_type',)

    address_ty ("& bldg_no",

    '& bldg_name',

    '& Street',

    ' & city ",

    '& State',

    '& zip'

    ),

    user_phone ',' & user_mail ',' mem_idproof', ' & id_no');

    Dbms_output.put_line ('user is properly registered');

    exception

    When no_data_found then

    dbms_output.put_line ("' data not found");

    end reg_proc;

    Start

    Dbms_output.put_line (' enter ID or user name ');

    Dbms_output.put_line (' username: ' | p_user_name);

    If v_user_name is null then

    Dbms_output.put_line ('user not found');

    reg_proc;

    Insert user_login SELECT user_id_seq. NEXTVAL, user_name, NULL, mem_id_seq. NEXTVAL, user_type FROM user_registration WHERE user_name is lower (p_user_name);

    Dbms_output.put_line (' because the user wants to have the membership? ");

    Dbms_output.put_line ('If Yes, please pay dues");

    INSERT INTO member_login SELECT mem_id_seq. CURRVAL, SYSDATE, SYSDATE + avl_days, 500, 'Y' of user_login ul, bl book_loan WHERE ul.mem_type = bl.mem_type AND user_name = p_user_name;

    END IF;

    exception

    When no_data_found then

    dbms_output.put_line ("' no data found");

    When too_many_rows then

    dbms_output.put_line (' too many lines).

    END validate_userLogin;

    procedure validate_issuedbooks (p_issuecount series)

    number of v_issuecount;

    Start

    Select user_login u, bl book_loan, avl_days, avl_books in v_avl_days, v_avl_books where bl.mem_type = u.mem_type and user_id = p_user_id;

    SELECT count (case when end_date < end return_date then p_mem_id) as invalidcount in v_issuecount from book_count where mem_id = p_mem_id;

    v_issuecount: = p_issuecount;

    dbms_output.put_line (' no. books that the user contains the :'|| p_issuecount);

    end validate_issuedbooks;

    procedure issuebooks is

    procedure book_avl (p_avl_now_flag in p_avl_date Boolean, date) is

    v_avl_now_flag char (1);

    date of v_avl_date;

    procedure reader_bookissue is

    Start

    insert into values drive (p_user_id, v_book_id, sysdate, sysdate, null);

    insert into book_count values(p_mem_id,v_book_id,sysdate,sysdate,null);

    Update book_availability set issued_to is "Reader" where book_id = v_book_id;.

    end reader_bookissue;

    Start

    Select book_name, b.book_id avl_now_flag v_book_name, v_book_id, v_avl_now_flag of the book b, book_availability b where b.book_id = ba.book_id and ba.book_id = p_book_id;

    If v_avl_now_flag = "Y" then

    dbms_output.put_line ('the book is available for issuance' | v_book_id);

    on the other

    Select mem_type in the v_mem_type of user_login where user_id = (select user_id from book_availability where avl_now_flag = 'n' and book_id = p_book_id);

    If v_mem_type = "Reader" then

    reader_bookissue;

    dbms_output.put_line (' the book is with Reader.) Please try tomorrow.') ;

    on the other

    dbms_output.put_line ('the book is member');

    end if;

    Select avl_date in the book_availability v_avl_date where book_id = p_book_id;

    v_avl_date: = p_avl_date;

    dbms_output.put_line (' the available date is: ' | p_avl_date);

    end if;

    end book_avl;

    Start

    insert into book_count values(p_mem_id,p_book_id,sysdate,sysdate+v_avl_days,v_return_date);

    Update book_availability set book_id = p_book_id, avl_now_flag = 'n', avl_date is to_date (sysdate + v_avl_days,' dd-mm-yyyy ""), issued_to = v_mem_type, user_id = p_user_id where mem_id = p_mem_id;

    commit;

    dbms_output.put_line ("' the book published successfully");

    end issuebooks;

    Number of function return late_fee (p_mem_id in number, p_extradays series, p_latefee_total number) is

    number of v_extradays;

    number of v_latefee_total;

    number of v_latefee_per_book;

    number of v_latefee_per_day;

    number of v_book_count;

    Start

    Select trunc (sysdate) - v_end_date in v_extradays from book_received where mem_id = p_mem_id and book_id = p_book_id;

    p_extradays: = v_extradays;

    v_latefee_per_book: = v_latefee_per_day * v_extradays;

    v_latefee_total: = v_latefee_per_book * v_book_count;

    p_latefee_total: = v_latefee_total;

    dbms_output.put_line ('The total AMT for not returned books' | p_latefee_total);

    end late_fee;

    end lib_01;

    Hello

    I checked the first 10 lines after the beginning and I could count already several errors.

    Is it an exercise or a real code, you must provide?

    Kind regards.

    Alberto

  • error 103 to the column of the line 6 17

    Hi all

    brand new m forms of oracle, using oracle forms 6i
    m using this code

    BEGIN
    IF
    : OVERALL. FABRIC = "BUY" THEN
    GO_BLOCK ('PURCHASE_ORDER');
    ON THE OTHER
    : OVERALL. FABRIC = "BUSINESS" THEN
    GO_BLOCK ('LOOMS_CONTRACT');
    ON THE OTHER
    : OVERALL. FABRIC = 'KNITTING' CAN
    GO_BLOCK ('KNITTING_CONTRACT');
    END IF;
    END;



    where is the error please do some need full.
    thnks.

    Published by: 940133 on June 26, 2012 21:42

    Published by: 940133 on June 26, 2012 21:47

    Try this

    BEGIN
    IF :GLOBAL.FABRIC = 'PURCHASE' THEN
    GO_BLOCK('PURCHASE_ORDER');
    ELSif :GLOBAL.FABRIC = 'LOOMS' THEN
    GO_BLOCK('LOOMS_CONTRACT');
    ELSif :GLOBAL.FABRIC = 'KNITTING' THEN
    GO_BLOCK('KNITTING_CONTRACT');
    END IF;
    END;
    
  • Oracle/PLSQL: Error ORA-01756

    Hello

    I'm new to PL/SQL and my script keeps ORA-01756, not finished string. Here is the code:

    DECLARE
    query_str VARCHAR2 (60);
    BEGIN
    plsql_block: = ' SELECT ' grant execute on | object_name | "to dummy_user;"
    From user_objects
    WHERE type_objet = 'PACKAGE '.
    Query_str EXECUTE IMMEDIATE
    END;

    I want this implementation in DBSM_SCHEDULER WORK, but he constantly Gets the error.

    If I ran is separately as:
    ' SELECT ' grant execute on | object_name | "to dummy_user;"
    From user_objects
    WHERE type_objet = 'PACKAGE '.

    There's no problem.

    Can someone give me advice or recommendation which is exactly the problem.
    I would be really grateful for some assistance :)

    Kind regards
    Emil Bolokanov

    Hello

    >
    SELECT "grant execute on | object_name | "to dummy_user;"
    From user_objects
    WHERE type_objet = 'PROCEDURE '.
    >

    This is for change

    SELECT 'grant execute on ' || object_name || ' to dummy_user'
    FROM user_objects
    WHERE object_type = 'PROCEDURE';
    

    To run it

    Just type

    exec NEW_1 ('aa');

    This should be good for you. As there is an already available dummy_user.

    see you soon

    VT

Maybe you are looking for