Error when performing procedure a TOAD that contains the parameter and dblink

Hi all
I get the error while executing the following code in the TOAD and APEX.

It contains the parameter (start_date and end_date) and dblink (@TO_FUT).
When I hardcode the values of the parameters, it works very well.
When I give values hard-coded in the procedure, the error comes.
When I commented that the lines as much as setting comes, the error always comes.

I don't know if it's parameter problem or question dblink or some other problem

Everyone is having no idea about this error?
Your help is very appreciated.

Code:
CREATE OR REPLACE PROCEDURE PROC_ENR_ACC (START_DATE, END_DATE DATE DATE)
AS
BEGIN
RUN IMMEDIATELY 'TRUNCATE TABLE OUTPUT_TABLE;
INSERT INTO OUTPUT_TABLE
(FIRST_NAME, LAST_NAME, HIDDEN, EFF_DT, CID, PLAN, FLAG)
SELECT
TEMP1. FIRST NAME,
TEMP1. LAST_NAME,
TEMP1. HIDDEN,
TEMP1. EFF_DT,
TEMP1. CID,
TEMP1. PLAN,
NVL ((SELECT ' Y'))
OF FADMIN. MEMI_TABLE@TO_FUT MCQUEEN
WHERE MCQUEEN. MEME_CK = TEMP1. MEME_CK
AND MCQUEEN. TXN_EFF_DT = TEMP1. EFF_DT
AND MCQUEEN. PBP = TEMP1. PLAN
AND MCQUEEN. MEMI_TXN_CD IN ('AC', ARE ')
AND MCQUEEN. MEMI_SEQ_NO = (SELECT MAX (MI. MEMI_SEQ_NO)
OF FADMIN. MEMI_TABLE@TO_FUT MI
WHERE MI. MEME_CK = MOUGEOT. MEME_CK
AND MI. TXN_EFF_DT = MOUGEOT. TXN_EFF_DT
AND MI. PBP = MOUGEOT. PBP
AND MI. MEMI_TXN_CD IN ('AC', ARE ')
AND MI. (MEMI_INTF_STS = 03)), 'N') AS FLAG
Of
(SELECT
M1. FIRST NAME,
M1. LAST_NAME,
M1. HIDDEN,
M1. EFF_DT,
M1. CID,
M1. PLAN,
(SELECT THE SAME. MEME_CK
OF FADMIN. EVEN MEME_TABLE@TO_FUT, FADMIN. GRGR_TABLE@TO_FUT CHRISTIAN
WHERE EVEN. M_HIN = M1. HID
AND EVEN. GRGR_CK = CHRISTIAN. GRGR_CK
AND CHRISTIAN. GRGR_ID = M1. GRGR_ID
) AS MEME_CK
OF FADMIN. METR_TABLE@TO_FUT M1,
(SELECT M3. HIDDEN, M3. FADMIN EFF_DT. METR_TABLE@TO_FUT M3
WHERE M3. TYPE IN ('60 ', ' 61')
AND M3. RESPONSE TO ('117 ', ' 118')
AND TRUNC (M3. METR_TRANS_DT) BETWEEN START_DATE AND END_DATE
AND M3. SYIN_INST = (SELECT MAX (M4. SYIN_INST)
OF FADMIN. METR_TABLE@TO_FUT M4
WHERE M4. HID = M3. HID
AND M4. TYPE IN ('60 ', ' 61')
AND M4. RESPONSE TO ('117 ', ' 118')
AND TRUNC (M4. EFF_DT) = TRUNC (M3. EFF_DT))
) TEMP
WHERE M1. TYPE IN ('60 ', ' 61')
AND M1. RESPONSE = "011"
AND TRUNC (M1. METR_TRANS_DT) BETWEEN START_DATE AND END_DATE
AND M1. SYIN_INST = (SELECT MAX (M2. SYIN_INST)
OF FADMIN. METR_TABLE@TO_FUT M2
WHERE M2. HID = M1. HID
AND M2. TYPE IN ('60 ', ' 61')
AND M2. RESPONSE = "011"
AND TRUNC (M2. EFF_DT) = TRUNC (M1. EFF_DT))
AND M1. HID = TEMP. HID (+)
AND M1. EFF_DT = TEMP. EFF_DT (+)
AND TEMP. HIDDEN IS NULL
--------
UNION
--------
SELECT
M1. FIRST NAME,
M1. LAST_NAME,
M1. HIDDEN,
M1. EFF_DT,
M1. CID,
M1. PLAN,
(SELECT THE SAME. MEME_CK
OF FADMIN. EVEN MEME_TABLE@TO_FUT, FADMIN. GRGR_TABLE@TO_FUT CHRISTIAN
WHERE EVEN. M_HIN = M1. HID
AND EVEN. GRGR_CK = CHRISTIAN. GRGR_CK
AND CHRISTIAN. GRGR_ID = M1. GRGR_ID
) AS MEME_CK

OF FADMIN. METR_TABLE@TO_FUT M1
WHERE M1. TYPE IN ('60 ', ' 61')
AND M1. RESPONSE TO ('016', '017', '022', ' 023')
AND TRUNC (M1. METR_TRANS_DT) BETWEEN START_DATE AND END_DATE
AND M1. SYIN_INST = (SELECT MAX (M2. SYIN_INST)
OF FADMIN. METR_TABLE@TO_FUT M2
WHERE M2. HID = M1. HID
AND M2. TYPE IN ('60 ', ' 61')
AND M2. RESPONSE TO ('016', '017', '022', ' 023')
AND TRUNC (M2. EFF_DT) = TRUNC (M1. EFF_DT))
) TEMP1;
END;
/

The error:
ORA-00918: column ambiguously defined
ORA-02063: preceding the line of TO_FUT
ORA-06512: at "PROC_ENR_ACC", line 5
ORA-06512: at line 5

Good,

Please can just as a test you try this and see what happens

WITH variables AS
(SELECT /*+ MATERIALIZE */
        TO_DATE(:START_DATE) start_date,
        TO_DATE(:END_DATE) end_date
 FROM dual)
    SELECT   TEMP1.FIRST_NAME,
            TEMP1.LAST_NAME,
            TEMP1.HID,
            TEMP1.EFF_DT,
            TEMP1.CID,
            TEMP1.PLAN,
            NVL (
                 (SELECT   'Y'
                  FROM   MEMI_TABLE MEMI
                  WHERE       MEMI.MEME_CK = TEMP1.MEME_CK
                  AND MEMI.TXN_EFF_DT = TEMP1.EFF_DT
                  AND MEMI.PBP = TEMP1.PLAN
                  AND MEMI.MEMI_TXN_CD IN ('AC', 'RE')
                  AND MEMI.MEMI_SEQ_NO = (SELECT   MAX (MI.MEMI_SEQ_NO)
                                          FROM   MEMI_TABLE MI
                                          WHERE   MI.MEME_CK = MEMI.MEME_CK
                                          AND MI.TXN_EFF_DT = MEMI.TXN_EFF_DT
                                          AND MI.PBP = MEMI.PBP
                                          AND MI.MEMI_TXN_CD IN ('AC', 'RE')
                                          AND MI.MEMI_INTF_STS = 03)
                  ),'N') FLAG
   FROM (SELECT   M1.FIRST_NAME,
                  M1.LAST_NAME,
                  M1.HID,
                  M1.EFF_DT,
                  M1.CID,
                  M1.PLAN,
                  (SELECT   MEME.MEME_CK
                   FROM   MEME_TABLE MEME, GRGR_TABLE GRGR
                   WHERE       MEME.M_HIN = M1.HID
                   AND MEME.GRGR_CK = GRGR.GRGR_CK
                   AND GRGR.GRGR_ID = M1.GRGR_ID) MEME_CK
         FROM   METR_TABLE M1,
                (SELECT   M3.HID, M3.EFF_DT
                 FROM   METR_TABLE M3
                 WHERE   M3.TYPE IN ('60', '61')
                 AND M3.REPLY IN ('117', '118')
                 AND TRUNC (M3.METR_TRANS_DT) BETWEEN (SELECT start_date FROM variables) AND  (SELECT end_date FROM variables)
                 AND M3.SYIN_INST = (SELECT   MAX (M4.SYIN_INST)
                                     FROM   METR_TABLE M4
                                     WHERE   M4.HID = M3.HID
                                     AND M4.TYPE IN ('60', '61')
                                     AND M4.REPLY IN ('117', '118')
                                     AND TRUNC (M4.EFF_DT) = TRUNC (M3.EFF_DT))
                 ) TEMP
         WHERE   M1.TYPE IN ('60', '61') AND M1.REPLY = '011'
         AND TRUNC (M1.METR_TRANS_DT) BETWEEN (SELECT start_date FROM variables) AND  (SELECT end_date FROM variables)
         AND M1.SYIN_INST = (SELECT   MAX (M2.SYIN_INST)
                             FROM   METR_TABLE M2
                             WHERE       M2.HID = M1.HID
                             AND M2.TYPE IN ('60', '61')
                             AND M2.REPLY = '011'
                             AND TRUNC (M2.EFF_DT) = TRUNC (M1.EFF_DT))
        AND M1.HID = TEMP.HID(+)
        AND M1.EFF_DT = TEMP.EFF_DT(+)
        AND TEMP.HID IS NULL
        UNION
        SELECT   M1.FIRST_NAME,
                 M1.LAST_NAME,
                 M1.HID,
                 M1.EFF_DT,
                 M1.CID,
                 M1.PLAN,
                 (SELECT   MEME.MEME_CK
                  FROM   MEME_TABLE MEME, GRGR_TABLE GRGR
                  WHERE       MEME.M_HIN = M1.HID
                  AND MEME.GRGR_CK = GRGR.GRGR_CK
                  AND GRGR.GRGR_ID = M1.GRGR_ID) MEME_CK
        FROM   METR_TABLE M1
        WHERE   M1.TYPE IN ('60', '61')
        AND M1.REPLY IN ('016', '017', '022', '023')
        AND TRUNC (M1.METR_TRANS_DT) BETWEEN (SELECT start_date FROM variables) AND  (SELECT end_date FROM variables)
        AND M1.SYIN_INST = (SELECT   MAX (M2.SYIN_INST)
                            FROM   METR_TABLE M2
                            WHERE   M2.HID = M1.HID
                            AND M2.TYPE IN ('60', '61')
                            AND M2.REPLY IN ('016', '017', '022', '023')
                            AND TRUNC (M2.EFF_DT) = TRUNC (M1.EFF_DT))
        ) TEMP1;
END;

See you soon

Ben
http://www.munkyben.WordPress.com
Don't forget to mark the answers useful or correct ;)

Tags: Database

Similar Questions

  • Sort the listBox that contains the text and numbers

    Is there a script to sort a listBox control that contains the text and numbers using a button?

    I would have preferred that he sort 1, 2, 10, 20, 100, not 1, 10, 100, 2, 20

    Examples are part numbers: HP1457100-9, 011-2025-479, 85216, etc.

    You may need to change this line:
    oTarget = this,

    It refers to the object to display the results.

  • Printing of documents that contain the letter and legal-size pages - Laserjet 600 M602

    We have a printer Laserjet 600 M602, that does not automatically select a tray to print every time someone tries to print a document that contains the letter so many pages of legal size.  The default printer for the Tray 1 (Manual power) and the user will have to walk over to the printer and the printer to select the correct tray.  I went in the printers settings via the web interface and I set the tray settings to the following: Tray 1 - any Type of Size/Any, bin 2 - letter/plain, plateau 3 - legal/Plain and it still does not print correctly.  Unfortunately for the printer settings, it was on that I'm comfortable doing.  I read the print driver may have changed, but we use the driver included with the disc and I guess that it would be sufficient that this driver.  Does anyone know of some setting that I might be able to change the printer or if it is indeed a print driver problem?  Any comments would be appreciated.

    Thank you

    I was able to receive help this morning from HP support.  He turns out, there were two things that I needed to change.  The first is that when printing from a pdf file, there is an option in the print area for "Choose paper according to the size of PDF page source" and the second thing, it was with the printer printing preferences.  In the printing preferences, under the "Printing shortcuts" tab, the paper Type has been set to Prepunched.  We changed this Unspecified.  After making these two changes, the user is able to print correctly in the printer.

  • Hi, I use iTunes 12.3.2.35 on a Windows 7 computer. I don't seem to be able to import files from a CD that contains the files on it as mp3 files. If I launch iTune and then put the CD in, it doesn't appear and I can't drag and drop.

    Hi, I use iTunes 12.3.2.35 on a Windows 7 computer. I don't seem to be able to import files from a CD that contains the files on it as mp3 files. If I start iTunes and then put the CD in, it doesn't appear and I can't drag and drop.

    It would not seem like an audio CD, as a drive in this way is a data disc when it contains mp3 files. You would need to access the file menu in iTunes, manage files here. If you manually manage music, you will need to access it as a regular folder on your computer. In iTunes, go to file > add file to library, and select individual files.

  • The feature you are trying to use is on a network that is not available. Click OK to try again or enter a different path to the folder that contains the installation packagr 'TrayApp.msi'

    Original title: trayapp

    When I open the computer message appears, the component you are trying to use is on a network that is not available. Click OK to try again or enter a different path to the folder that contains the installation packagr 'TrayApp.msi' in the box below.
    C:\Users\user\AppData\Local\Temp\7zS5216\setup\TrayApp\
    When I click ok the message this way that c:\users\user\appdata\local\temp\7zs5216\setup\trayapp\ is not found. Verfy that you have access to this location and try again or try to find the 'TrayApp.msi' in installing a package file from which you can install the product'TrayApp.
    When I try to cancel the warning message, is that an installation package for the TrayApp product is not found. Again the installation again using a valid copy of the 'TrayApp of installation' package. I already uninstalled all HP products, but this message is still bothering me, how to solve this problem?

    Hey Tama,


    -What version of windows is installed on the computer?
    -Have there been recent changes to the computer before the show?
    I recommend you go through the next HP document and check if it helps.
    Hope this information is useful.
  • I can't read a CD that contains the UDF files on my Windows 7 system.

    I can't read a CD that contains the UDF files on my Windows 7 system.  When I try to open them, I get a message saying that I need a special software to fix it. but when I try to download this software (C2UDFFS. (SYS) I get "cannot copy file in the destination directory."  Would be grateful for any help.

    Try this link: -.

    http://support.Microsoft.com/kb/975617

    It will be useful.

  • Prepare a document to insert a row that contains the Blob column. Is what sense this correct?

    When we prepare the statement to insert a row that contains the Blob column. Is what sense this correct? And what is the difference? Does anyone know?

    1 Preparestatement.setBlob(parameter number, blob type object)

    2 Preparestatement.setBlob(parameter number, inputstream type object)

    This link shows the test I did.

    https://community.Oracle.com/thread/3680185?SR=Inbox & customTheme = OTN

    When we prepare the statement to insert a row that contains the Blob column. Is what sense this correct? And what is the difference? Anyone know?

    1 Preparestatement.setBlob(parameter number, blob type object)

    2 Preparestatement.setBlob(parameter number, inputstream type object)

    I answered in your other thread and provided a link to the JDBC Dev Guide section, which explains how to work with type LOB and BFILE data.

    Have you read this article from doc?

    Did you read my response to your other thread?

    In java, a BLOB is just the index that gives you access to the content. In your case, you access by selecting a locator BLOB existing and getting his inputstream. This inputstream is what allows you to access the content real blob.

    The Locator is just that; It specifies the LOCATION of the blob content, but NOT the content.

  • How to get a paragraph that contains the string selected in FDK?

    Hello

    I am writing a program that extracts content of the paragraph that contains a selection string. This program runs in the interaction point menu. When the user click on the menu item. The process as follows:
    1. find a chain on a document, for example: F_ApiFind ("ABC").
    2. the F_ApiFind ("ABC") API returns the F_TextRangeT structure.
    3. the string "ABC" has been highlighted on the document.

    Here's my question:
    How can I write code to locate an object ID paragraph (pgfId) that contains the string (or object) 'ABC '?.
    As the 'ABC' object belongs to the current paragraph, how can I get section ID (pgfId) and then get the content of the entire paragraph
    without a loop through FP_FirstFlowInDoc, FP_FirstTextFrameInFlow, FP_FirstPgf and FP_NextPgfInFlow.

    Thank you very much for you help,

    Thai Nguyen

    Hi thai,

    Paragraph ID is returned as part of the structure of F_TextRangeT, as the Member "objId". Let's say you have:

    F_TextRangeT tr;

    ... then:

    TR = F_ApiFind (...);

    On an action to search with success, "tr" will contain the pgfId of the paragraph. I'm assuming you're looking for a string that is entirely contained in a paragraph, in which case two ways contains the ID of the paragraph:

    tr.beg.objId

    TR.end objId

    If you want to retrieve all the text in the paragraph after the search, you could do something like: (attention, incomplete code!)

    F_TextItemsT ti;

    F_TextRangeT tr;

    F_ObjHandleT docId.

    ...

    TR = F_ApiFind (...);

    TR. Beg.offset = 0;

    TR.end.Offset = FV_OBJ_END_OFFSET;

    TI = F_ApiGetTextForRange (docId, & b, FTI_String);

    .. After that the text of the paragraph will be included in the ti TextItems structure. Navigate through this structure can be difficult and I will renounce any discussion about it for now unless you need more help. There is good information in the developer reference as to its use.

    Russ

  • I downloaded an e-mail that contains the music, I deleted the email, but the music continues to play despite having deleted the history etc.

    I down loaded an e-mail that contains the music, I deleted the email, but the music continues on whwenever game that I connect despite having deleted the history etc.

    {Ctrl + J} t0 open downloads window. Right click on this audio file, and then click remove from the list of

  • Cell that contains the formula paste between spreadsheets

    How do I paste the value of a cell that contains the result of a spreadsheet formula has, in a worksheet cell B and still have the operation of the formula? OS 10.11.14, numbers 3.6.1.

    Hi dad,

    It depends on what you mean by "still have the operation of the formula."

    If simply paste you it into a new table in another document, the formula will be stuck more or less intact, but it will not reference all the cells on the original table. If he refers only the cells on the table where he came from, he can refer to these same cells or cells in the same position relative to the new location on the table to which it is glued. You will have probably the best success with her work on the new table, if you copy and then paste the formula itself, rather than the containing cell.

    Repeat what I have not quite clear in the first line: the numbers documents cannot reference cells in other documents of numbers.

    Kind regards

    Barry

  • How to create a formula that highlights the cell that contains the same data that I type in another cell

    Hi, can someone help me make a formula which detects and highlights the value of the cell that contains the items of data that I entered in another cell? Thank you

    resolved to myself

  • Where does FireFox get the default value for a preference of. What is the format of the file that contains the default value?

    Where does FireFox get the default value for a preference of. What is the format of the file that contains the default value? I need the actual default value for an individual preference.
    Topic: config shows some default values, but I need the source from which everything: config returns to the default value.
    Any help in this direction is greatly appreciated.

    User Agent

    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x 64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

    The preferences that are not hidden if they have by default are stored in two JavaScript text files in the Firefox program folder
    You can open them in a tab in Firefox through these links:
    resource:///defaults/pref/firefox.js
    resource:///greprefs/all.js

    (702598/forum/1/702598)

  • Is it possible to get the name of the folder that contains the current document?

    Hi all!


    I know how to get the name of the active document


    app.activeDocument.name;


    but I was wondering if you could also get the name of the folder that contains the current document. Not sure if this is possible or not, so I thought I'd ask, if so it save me a lot of time.


    Thanks in advance!

    Hi djbgraphicdesign,

    does this work for you?

    if (app.activeDocument.saved){
    alert(app.activeDocument.path.name);
    }
    

    Have fun

  • How can I add a game action on an object that contains the first click and read reversed to this object even a second click action?

    How can I add a game action on an object that contains the first click and read reversed to this object even a second click action?

    First create a symbol of the object.

    Then add the code in the event click on this symbol as below:

    Insert the code for the mouse, click here

    var bReverse = (sym.getVariable ("reverseDir")! = undefined)? (sym.getVariable ("reverseDir")): true;

    sym.setVariable ("reverseDir", bReverse)

    {if (bReverse)}

    sym.playReverse ();

    }

    else {}

    SYM. Play();

    }

    HTH,

    Vivekuma

  • I have a pdf file that contains the text if I copy all the text and paste it into Notepad and save the .txt file is it changes the ascii value of the text?

    I have a pdf file that contains the text if I copy all the text and paste it into Notepad and save the .txt file is it changes the ascii value of the text?

    If the encoding is ASCII? Laughing out loud

    Be well...

Maybe you are looking for

  • After installing Ubuntu 11.04, Windows Vista has disappeared.

    Original title: Windows vista is missing After installing Ubuntu 11.04 (Natty Narwhal) my other OP system Windows vista has disappeared. I don't get a menu to choose which OP system I want to use. The grub menu 2 does not include an entry for windows

  • loop of reboot after trying to reinstall sp2

    I have a 7550 Presario with Windows XP, which has been updated at least SP2 and IE8... after the infamous 10 updates / 02 / 10, my computer to bike to the safe mode screen... I couldn't get Mode safe, instead, she would simply keep a backward loop. H

  • How to load a CD-ROM BACK under Windows?

    I have a game disc that says: type install, then follow the prompts.  I do not have a DOS command prompt (or I'm not.)  Thanks for the help.

  • Windows Vista - the product key you typed is invalid for activation

    I get the error message - to fix or buy the new product key for Windows Vista - when signing my laptop. When I retype the original as suggested by one of the troubleshooting answers however, this did not help.

  • Blue screen appears during playback of movies

    Hi, whenever I play a movie with Windows Media Player, the blue screen upwards and I have to restart my system. Is it a hardware problem or software? and what do I do? I will be appreciated if someone could help me with this problem. Thank you.