الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Can I pass input Parameters as array

مغلق
بدأه alharethi في 20 أغسطس 2004 · 3 رد · 678 مشاهدة · في قواعد بيانات Oracle
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

I have two tables that I want to move records for one to the other. Basically, the user will have three options: Undecided, Approve, or Deny those values.

I might have tens of records in my temp table that I need to approve or deny using this stored procedure so that they will be inserted into the Real Table if approved or deleted if rejected. (no worry about Undecided option)

How can I pass this much data as input parameters and how can I fetch it or go through them inside the stored procedure.

Someone told me to pass the parameters as Comma seperated input parameter and then do it but how?

Your help is much appreciated.

Salam

Groups_Pending.HTM

Quran_Signature.jpg
#2

Hello ..

I didn't get what you need exactly.

Any way, to declare an arrays in PL/SQL you declare record type. then table of this record type binarry_indexed.

but I think in your case you can use cursor, it works as an array.

or may be you can just insert as select. no need for cursors.

I think you have to modify the tecnike of your procedure. put a flag for the records you need to take action with. this flag spacify the action (U,A,D).

or any thing like this. but there is o need to pass all this records to the procedure as inputs. the data are in the table. Go & select them in the procedure body.

I hope that I was usefull for you.

If you still need help ask more, and give me more details.

Mago_Mago

تم تعديل هذه المشاركة بواسطة mago_mago في 21 أغسطس 2004 في 02:06

#3

شكر الله لك اخي الكريم جميل ما صنعت ... سأحاول ما قلت ان شاء الله ....

بارك الله فيك

سلام

Quran_Signature.jpg
#4

شكرا لك اخي ....

من اجل الفائدة انا عملت التالي:

حاولت تمرير قيمة واحدة كل مرة و من ثم اختيار ما اريده و حفظه في Record كالتالي:

PROCEDURE INSERT_NEW_GROUPS (pGroupCode IN bits.GROUPS.group_code%TYPE,
                             oErrorMessage OUT TABLE of VARCHAR(2000))

   IS
     CURSOR getGroupName is
         SELECT *
        FROM BITS.TEMP_GROUPS t
        WHERE t.group_code = pGroupCode;
        
    childRow getGroupName%ROWTYPE;
BEGIN

 FOR childRow IN getGroupName LOOP

    INSERT INTO BITS.GROUPS
                (GROUP_NAME,
                 BITS_GRP_FLG,
                 PPSR_CREATE_FLG,
                 FLASH_CREATE_FLG,
                 FIRST_LVL_FLG,
                 SECOND_LVL_FLG,
                 THIRD_LVL_FLG,
                 RPT_MGMT_FLG,
                 GROUP_DESC,
                 ADMIN_CODE,
                 REF_FLG,
                 ZERO_LVL_FLG,
                 RSFBS_FLG,
                 HOLDING_GRP_FLG,
                 MANAGER_CODE,
                 CBSFLASH_GRP_FLG,
                 GCSC_FLG,
                 GROUP_DISTRO,
                 EMAIL_SUBJECT,
                 ASSIGN_TO_ANALYST_FLG,
                 ROLLUP_GRP1,
                 FAX_NUMBER,
                 GROUP_DISTRO_FLG,
                 GROUP_EMAIL_ACCOUNT,
                 URL_NEWISSUE,
                 RECEIVE_GROUP_EMAIL_FLG,
                 RECEIVE_GROUP_EMAIL_ACCOUNT,
                 RESET_SUBSTATUS_FLG,
                 RECEIVER_VERIFICATION_FLG,
                 PASSER_VERIFICATION_FLG)

        VALUES (childRow.GROUP_NAME,
                childRow.BITS_GRP_FLG,
                childRow.PPSR_CREATE_FLG,
                childRow.FLASH_CREATE_FLG,
                childRow.FIRST_LVL_FLG,
                childRow.SECOND_LVL_FLG,
                childRow.THIRD_LVL_FLG,
                childRow.RPT_MGMT_FLG,
                childRow.GROUP_DESC,
                childRow.ADMIN_CODE,
                childRow.REF_FLG,
                childRow.ZERO_LVL_FLG,
                childRow.RSFBS_FLG,
                childRow.HOLDING_GRP_FLG,
                childRow.MANAGER_CODE,
                childRow.CBSFLASH_GRP_FLG,
                childRow.GCSC_FLG,
                childRow.GROUP_DISTRO,
                childRow.EMAIL_SUBJECT,
                childRow.ASSIGN_TO_ANALYST_FLG,
                childRow.ROLLUP_GRP1,
                childRow.FAX_NUMBER,
                childRow.GROUP_DISTRO_FLG,
                childRow.GROUP_EMAIL_ACCOUNT,
                childRow.URL_NEWISSUE,
                childRow.RECEIVE_GROUP_EMAIL_FLG,
                childRow.RECEIVE_GROUP_EMAIL_ACCOUNT,
                childRow.RESET_SUBSTATUS_FLG,
                childRow.RECEIVER_VERIFICATION_FLG,
                childRow.PASSER_VERIFICATION_FLG);
        COMMIT;
   END LOOP;
        EXCEPTION
            WHEN OTHERS THEN
                oErrorMessage(1) :=SQLERRM;
            ROLLBACK;

END; -- Procedure
Quran_Signature.jpg

هذا الموضوع مغلق.

مواضيع مشابهة