Unexpected Token: Error occuring inside a stored procedure

I get an unexpected token error when trying to compile below stored procedure. The error occurs on the exec pk_proof.pr_ProofAssets execution statement inside the stored procedure. Any reason why?
CREATE OR REPLACE PROCEDURE MONTHLY_ASSET (ln_business_dt_num IN NUMBER DEFAULT NULL,
                                           missing_tbl_name OUT NOCOPY VARCHAR2)
IS
   ln_business_dt_num NUMBER;
   missing_tbl_name VARCHAR2;
   no_tbl_name_found EXCEPTION;
   bad_date_value EXCEPTION;
   counts_not_matched EXCEPTION;
BEGIN
   IF ln_business_dt_num < 0 THEN
   RAISE bad_date_value;
   ELSE
     Select MAX(business_dt_num) into ln_business_dt_num
     FROM sasor.dp_ca_proof;
   if missing_tbl_name IS NOT NULL then
      raise no_tbl_name_found;
   end if;
   exec pk_proof.pr_ProofAssets('SLH_DST_ASSET', ln_business_dt_num, 'sasor_batch');

EXEC (short for EXECUTE) is an SQL*Plus command. Just remove it.

Similar Messages

  • Error occured while obtaining stored procedure

    Hi,
    I'm trying to configure a Database adapter to call a stored procedure. When I try to select the procedures in a package I get an error saying:
    "Error occurred while obtaining the stored procedure, Please verify the Database connection"
    The database connection is fine. I can select other stnad alone procedures and it works fine but I get the above error only when trying to select the procedures in a package.
    Any help is appreciated.
    Thanks

    Yes, this is happening when I use the wizard to Browse. I see all the packages but when I click on the package to expand it, I do not see the procedures in the package and I get the error message. And as you said the procedures are on 10g and Olite is for dehydration.
    Any ideas as to why I get this error. When I create standalone procedures or functions I can select those and create the adapter. Its only with packages.
    Thanks

  • Error message for running stored procedure

    Hello expert,
    I got error message for a stored procedure running as follows, will you please tell me what that error is? what is the reason for that error? appreciate very much.
    Job name=PROD DWH REPORT MART LOAD.1
    Job owner=DEVTEAM
    Job type=SQL Script
    Job status=Error
    Occurred At=Aug 9, 2011 5:26:29 AM EDT
    Target Name=proddw(Database Instance)
    Job output=
    Command:Output Log
    SQL*Plus: Release 10.2.0.3.0 - Production on Tue Aug 9 03:00:07 2011
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    SQL> SQL> SQL> SQL> Connected.
    SQL> SQL> SQL> SQL> SQL> SQL>
    TO_CHAR(SYSDATE,'DD-
    09-aug-2011 03:00:07
    SQL> SQL>
    Many Thanks,

    What error? I can't see an error.

  • Strange error while executing a stored procedure: Incorrect syntax near '@p0'

    All, I am getting a strange error while executing a stored procedure: Incorrect syntax near '@p0'  using JDBC CallableStatment.
    Here is my code...
    CallableStatement cStmt = con.prepareCall("{call SET CHAINED ON EXEC <dbName>.<schemaName>.<SPName> (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
    cStmt.setString(1, "2012005881");
    cStmt.setString(2, "07");
    cStmt.setString(3, "10");
    cStmt.setString(4, "Case title");
    cStmt.setString(5, "Open");
    java.sql.Date dt1 = new java.sql.Date(2014,10,20);
    cStmt.setDate(6, dt1);
    cStmt.setString(7, "01");
    cStmt.setString(8, "N");
    cStmt.setString(9, "ADA Test");
    cStmt.setString(10, "N");
    cStmt.setString(11, "English");
    cStmt.setString(12, "N");
    cStmt.setString(13, "N");
    cStmt.setString(14, "N");
    cStmt.setString(15, "N");
    cStmt.setString(16, "N");
    cStmt.setString(17, "N");
    cStmt.setString(18, "07");
    cStmt.setString(19, "10");
    cStmt.setString(20, "juache0");
    java.sql.Date dt2 = new java.sql.Date(2014,10,20);
    java.sql.Date dt3 = new java.sql.Date(2014,10,20);
    cStmt.setDate(21, dt2);
    cStmt.setDate(22, dt3);
    cStmt.setString(23, "userid0");
    cStmt.setString(24, "");
    cStmt.setString(25, "");  
    cStmt.setString(26, "");
    java.math.BigDecimal bg1 = new java.math.BigDecimal(10);
    cStmt.setBigDecimal(27, bg1);
    cStmt.setString(28, "userid");
    cStmt.setString(29, "userid");
    int hadResults = cStmt.executeUpdate();
    Your help is greatly appreciated.
    I am executing the above using Jconnect3.0 driver, inside WebSphere Application Server V8.0
    Thanks
    Nags

    NOTE: I don't work with JDBC/jConnect so (at this point) just some questions ...
    1 - are you sending this to ASE, ASA, IQ, or some other RDBMS?
    2 - what is the value of <schemaname>?
    3 - do you have other prepareCall() instances that successfully call a stored proc? [would be interesting to see if there's a difference in the format of the calls]
    A quick google search shows a couple ways to submit a stored proc execution to the RDBMS, with the format depending on the format expected by the target RDBMS.
    I'm wondering if you really need/want the parentheses around the argument list, ie, what happens if you change
    from
    -- parentheses around args
    EXEC <dbName>.<schemaName>.<SPName> ( ?,?,?,?,?,...,? )
    to
    -- no parentheses around args
    EXEC <dbName>.<schemaName>.<SPName> ?,?,?,?,?,...,?
    In ASE if I wrap the parameters in parentheses I get the same error you're getting:
    ================== w/ parentheses => error
    1> sp_who (sa)
    2> go
    Msg 102, Level 15, State 1:
    Server 'CC1_V1', Line 1:
    Incorrect syntax near 'sa'.   <<=== sa == @p0 ??
    ================== w/out parentheses => works
    1> sp_who sa
    2> go
    fid spid status  loginame origname ...
       0   17 running sa       sa       ...
    ==================

  • Error saving map. Stored procedure returned non-zero result BizTalk Bug

    Hallo all
    MSDN is reporting this Bug.
    "Error saving map. Stored procedure returned non-zero result." error message when you deploy the BizTalk Server 2010 applications in BizTalk Server 2010 Administration Console"
    http://support.microsoft.com/kb/2673264/en-us
    I am having this problem in BizTalk 2013. Is this correct? or I am doing something wrong..
    This error occured as I was about to deploy BizTalk application from Visual studio 2012 to BizTalk 2013.
    If this bug is available in 2013, where can I get a fix for it..
    Thanks in Advance
    AKE

    Hi AKE,
    Fix for this bug in BizTalk Server 2013 is not publicly available yet. Only option to get the fix for this bug is to contact:
    http://support.microsoft.com/contactus/?ws=support
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

  • Error: Could not find stored procedure !!

    Hi,
    Error: Could not find stored procedure.
    I Installed the SQL Server SP2 and the error still occurs when ever I call the stored procedure from my windows app!!
    Any Help ?

    I run this query:
    select uid,
    left ([name], 30) as [name]
    from sysobjects
    where [name] like 'ThisMonthRecords%'
    the result is:
    1 ThisMonthRecords

  • How can i create a Global Temporary Table inside a Stored Procedure....

    Hi...
    I need to create a Global Temporary Table inside a Stored
    Procedure....
    I have no idea how to do that....
    Please....if u can send me a sample, send to me....
    Thanks a lot

    To create a global temporary table inside a stored procedure,
    the minimal syntax would be:
    CREATE OR REPLACE PROCEDURE procedure_name
    AS
    BEGIN
    EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE table_name'
    || '(column_name NUMBER)';
    END procedure_name;
    As Todd stated, it would probably be better to create the global
    temporary table outside of the procedure:
    SQL> CREATE GLOBAL TEMPORARY TABLE table_name
    2 (column_name NUMBER);
    Table created.
    You can also specify things like ON COMMIT PRESERVE ROWS or ON
    COMMIT DELETE ROWS.
    It may be that there is something else, like a PL/SQL table of
    records or a cursor, that would suit your needs better. It is
    difficult to guess without knowing what you want to do with it.

  • Error while executing the stored procedure through sender JDBC adapter

    Hi All,
    I am getting below error while executing the stored procedure through sender JDBC adapter.
    Database-level error reported by JDBC driver while executing statement 'exec SapgetNextEntity 'SalesOrder''. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor.
    what is the problem? any idea to anyone...
    regards
    Ramesh

    hi Dharamveer,
    I am not getting below statement for your reply
    Try to use Refrence Cursor it will return u reference of resultset.
    I mention SP like this
    exec SapgetNextEntity 'SalesOrder'
    SapgetNextEntity -
    > SP Name
    SalesOrder----
    > Parameter I am passing...
    regards
    Ramesh

  • SQL SERVER 2012 Installed to SMB share Error 59 (An unexpected network error occurred)

    I have installed SQL 2012 on a clustered file share. When I try to add space to extend the log file for a database I get the following error
    Msg 5149, Level 16, State 3, Line 1
    MODIFY FILE encountered operating system error 59(An unexpected network error occurred.) while attempting to expand the physical file '\\server\share\path to ldf file.ldf'
    The SQL service is running under a local domain account that does not have administrator rights to the system.  The service account does have full disk and share permissions and the service starts without any problems.  I have applied all the cluster
    hotfixes and all the current Windows Updates.  If I log into the system as the SQL service domain user account I can access the share and have full rights to it.
    Any help would be appreciated.
    Thanks,

    The LDF file is 16 GB
    Free space on the drive is 62 GB
    Expansion is set to 10 percent
    I have several instances on this cluster, some are installed to drive letters and others to the clustered file share.  The error only occurs on the SQL 2012 instances that are installed to the clustered file share.
    I installed them to the clustered file share because I am running out of drive letters in the cluster.

  • The document could not be saved. an unexpected network error occurred

    I have several users on a terminal server that access a PDF from a file server. This PDF has many fillable fields like Name: with an empty text box next to it.
    Sometimes when the users open this PDF everything is missing except the fillable text fields. If they try to save the file they get the error in the subject of this ticket:
    the document could not be saved. an unexpected network error occurred
    Obviously, this sounds like a networking error, but 2 things.
    1) The terminal server and the file server on both virtual servers on the same host, using the same SAN. Very unlikely to have a networking error.
    2) This doesn't happen to every, it seems to be only affecting 3 of about 25 right now, and it is not all the time.
    Any thoughts? I have checked to see if there were any hidden lock files, but that wasn't it. Google-fu turned up nothing.
    Thanks for your help

    Hey jdorimoto,
    Could be please confirm if you are using Adobe Reader or Acrobat (what version) to open a PDF form.
    What version of OS are you using?
    Try saving the form to any other location with administrative privileges and then check.
    Hope to get your response.
    Regards,
    Anubha

  • An unexpected processing error occurred. Please contact Microsoft

    Before I get flamed like I did on StackOverflow, can I please make the point that there does NOT seem to be a clear route for getting official support for the Live SDK from Microsoft? I'm just trying to get someone from Microsoft to explain to me either
    what I need to be doing to my code OR how best to reach out to someone at Microsoft regarding this particular issue.
    Using this C# code:
    LiveConnectClient liveClient = new LiveConnectClient(currentSession);
    LiveOperationResult operationResult = await liveClient.GetAsync(file.FileLocation);
    dynamic contentResults = operationResult.Result;
    IDictionary<string, object> item = contentResults as IDictionary<string, object>;
    the following exception occurred on the GetAsync call:
    Microsoft.Live.LiveConnectException occurred
    HResult=-2146233088
    Message=An unexpected processing error occurred.
    Please contact Microsoft.
    Source=mscorlib
    ErrorCode=server_internal_error
      StackTrace:
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
    task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
    task)
       at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
       at Relative_History.OneDriveViewModel.<GetPictureURL>d__86.MoveNext()
      InnerException:
    I've not encountered this exception before and the code works as-is on other files. Restarting the app and the code works as expected so I'm not sure what I'm supposed to do other than "contact Microsoft" as instructed and, as stated at the start
    of this post, Microsoft don't say HOW to contact them.

    Hi,
    Do you have some anti-virus software installed and set to scan network drive, temporarily disable it, check if that is the cause.
    I also suggest you update the firmware of your router.
    Please alos share more information in event viewer with us as mentioned by ZigZag31343x
    Meanwhile you can contact the support of My Book Live
    http://wdc.com/en/products/products.aspx?id=280
    NOTE
    This
    response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.
    Microsoft
    does not control these sites and has not tested any software or information found on these sites.
    Regards
    Yolanda
    TechNet Community Support

  • Exchange ActiveSync has shut down because an unexpected critical error occurred

    Hi, 
    At one point all phones stopped syncing and when checking event log i came to this error:
    Exchange ActiveSync has shut down because an unexpected critical error occurred.
    URL=
    --- Exception start ---
    Exception type: System.OutOfMemoryException
    Exception message: Insufficient memory to continue the execution of the program.
    Exception level: 0
    Exception stack trace:    at Microsoft.Exchange.Data.Storage.GenericListData`2.DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
       at Microsoft.Exchange.AirSync.DeviceBehaviorData.DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
       at Microsoft.Exchange.Data.Storage.DerivedData`1.DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
       at Microsoft.Exchange.Data.Storage.GenericListData`1.DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
       at Microsoft.Exchange.Data.Storage.GenericDictionaryData`3.DeserializeData(BinaryReader reader, ComponentDataPool componentDataPool)
       at Microsoft.Exchange.Data.Storage.SyncState.DeserializeSyncStateTable(Int64 idxTable)
       at Microsoft.Exchange.Data.Storage.SyncState.Deserialize(PropertyDefinition property)
       at Microsoft.Exchange.Data.Storage.SyncState.Load(Boolean reloadFromBackend, PropertyDefinition[] additionalPropsToLoad)
       at Microsoft.Exchange.Data.Storage.SyncState..ctor(SyncStateStorage syncStateStorage, StoreObject storeObject, SyncStateInfo syncStateInfo, Boolean syncStateIsNew)
       at Microsoft.Exchange.Data.Storage.CustomSyncState.GetSyncState(SyncStateStorage syncStateStorage, Folder syncStateParentFolder, SyncStateInfo syncStateInfo, StoreObjectId storeObjectId)
       at Microsoft.Exchange.Data.Storage.SyncStateStorage.GetCustomSyncState(SyncStateInfo syncStateInfo)
       at Microsoft.Exchange.AirSync.GlobalInfo.LoadFromMailbox(MailboxSession mailboxSession, SyncStateStorage syncStateStorage, ProtocolLogger protocolLogger)
       at Microsoft.Exchange.AirSync.Command.OpenSyncStorage(Boolean shouldOpenGlobalSyncState, Boolean shouldUseBudget)
       at Microsoft.Exchange.AirSync.Command.WorkerThread()
    --- Exception end ---
    mail server has 35GBs of Ram, plenty of disk space, no extra transaction logs adding or anything like that. Right now phones work, but every other minute that error pops up and after sometime event 1013 is logged saying that Exchange activesync has been
    loaded.
    Thanks

    Hi Luksharp
    Is it happening only for Iphones or is it for all types of phones as well ?
    What version of Exchange server you are running ?
    Are you experiencing this issue after any recent upgrade or changes in CAS server ?
    Just check the sync state policy refer below article
    http://blog.chrislehr.com/2012/02/difference-in-policy-versions.html
    Looks like Sync State Policy is loaded for user's mailbox from latest version of CAS server and it was contacted the lower version of CAS for mailbox access.
    Just ensure all of your CAS servers are up to date with all mailbox and hub in correct versions.
    Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you Check out my latest blog posts on http://exchangequery.com

  • 59 An unexpected network error occurred

    Hi everyone,
    This is a strange one.
    We are using a TMG for a VPN (amongst other things such as web publishing etc) 
    We are using some software called 2X  to connect to something on a part of our network,  internally this works ok, but users on our VPN cant connect to it, but they can connect to everything else.  2X is a program that connects on port 80.
     From the VPN we can ping the host that the 2x software connects to, we can even RDP to the servers the 2X software is pointing to (once we set up a standard 3389 rule for this) but it wont work as it should via port 80.  Its something to do with
    this port 80 connection.
    In TMG logs we get - 59 An unexpected network error occurred. 
    I have tried a block and allow rule, in various orders but cant get it to work.
    Any ideas ?
    Thanks

    Hi,
    If I understand correctly, the VPN users cannot connect to the 2X software via port 80 as something else is
    using port 80, right?
    In addition, there would be multiple reasons for system error 59. Would you please provide the entire error
    message or other related information in TMG logs? I would appreciate it if you can also share the publishing rules or other rules on the TMG server for us.
    Based on my experience, TCP port 80 is often used by HTTP. You can run “netstat -ano” at the command
    prompt on the server which hosts the 2X software to find PID which is using local port 80. Then based on the PID, to find the related process in Task Manager.
    Best regards,
    Susie

  • Using ALTER SESSION inside a stored procedure.... not a good idea?

    Hi,
    I have two stored procedures, both of which are used to query a database to find a particular book, based on ISBN. One sproc searches our main product catalogue and the other searches our suppliers feed catalogues. The stored procedures are called from a C# application via a search tool and the user is able to search on either our catalogue or our suppliers. The appropriate procedure is called based on the users choices.
    However, the following behaviour is observed
    I search for an ISBN (is a varchar2 field, as isbn's may contain an X if the checksum digit equates to 10) on a feed, so uses the FEED SPROC. The book is found and returned to the app in about 0.5 seconds. I can repeat this as often as i like on different books etc. always works fine.
    I then do the same search but against our own catalogue, so uses our CATALOGUE SPROC. Again the book is found quickly, and the search can be repeated with the same results.
    If i then go back and run our FEED SPROC then the search time increases to about 3 minutes !
    Both the feed and our catalogue is in the same database, although different schema's the connections will be pooled through our app server.
    I can repliacte this every single time. I think i have narrowed doen the cause of this behaviour to a few lines of code in our CATALOGUE SPROC:
    -- store values
    select value into v_vch_NLS_COMP from nls_session_parameters nsp where nsp.parameter = 'NLS_COMP';
    select value into v_vch_NLS_SORT from nls_session_parameters nsp where nsp.parameter = 'NLS_SORT';
    -- Ensure case insensitivity throughout
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP = LINGUISTIC';
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT = BINARY_CI';
    do other stuff
    -- restore session variables
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP = ' || v_vch_NLS_COMP;
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT = ' || v_vch_NLS_SORT;
    If i remove this code then all is well, so i am assuming that using ALTER SESSION inside a stored procedure is the cause of the problem as it would be changing the execution plan of the FEEDS SPROC in some manner? Any ideas? I know i can just rewrite the sproc to avoid using this coding, but wanted to understand if i am doing something wrong by using ALTER SESSION in this manner?
    Any pointers would be appreciated.
    John Thompson
    Software Architect,
    play.com
    Edited by: user7186902 on 27-May-2009 03:51

    Hello (and welcome),
    It may be a case of having to create a linguistic index to facilitate the queries once you set these session level parameters, i.e..,
    CREATE INDEX idx_01 ON tab ((NLSSORT(col1, 'NLS_SORT=BINARY_CI'))It would appear that the setting of those parameters is invalidating index searching on the current indexes.

  • Calling Stored procedure inside an Stored procedure

    Hi,
    I am working in oracle 9i. I want to call a stored procdure from another stored procedure.
    Kindly provide me the example...
    rgds.

    having a pocedure called PRCD1,
    Create or Replace Procedure PRCD2 IS
    egin
    PRCD1;
    END;
    cheers !!!It will for surely err out. You cannot use "EXECUTE" inside a stored procedure.
    Here's how you do it:
    SQL> create or replace procedure p1 is
      2  begin
      3    dbms_output.put_line('I am P1');
      4  end;
      5  /
    Procedure created.
    SQL> create or replace procedure p2 is
      2  begin
      3    dbms_output.put_line('I am P2');
      4    p1;
      5  end;
      6  /
    Procedure created.
    SQL> set serveroutput on
    SQL> exec p2
    I am P2
    I am P1
    PL/SQL procedure successfully completed.
    SQL>

Maybe you are looking for

  • Crashing on startup: CS5 Apps in OS 10.6.4

    SOS I've searched the forum database and haven't found enough comments to help with this problem: Computer: iMac i5 Core running Snow Leopard 10.6.4 Adobe: CS5 Design Standard Illustrator version 15.0 InDesign version 7.0.0.355 Previous CS Design app

  • Landline rotary phone does not work in my house.

    I have a sort of antique rotary landline phone. It did work perfectly well until I got Xfinity phone service. I can receive calls but not make them. All other types of phones work fine. Also the phone works fine elsewhere. I had a Comcast technician

  • Commit on one application module also commits the other

    Jdev 11.1.1.4 I have a fusion ADF application where I have defined two Data Controls. One is called AppModuleDatacontrol and the other AppModuleWSDataControl. I do this in order to be able to commit DML made on one Data Control independently of the o

  • Flash actionscript question!

    This is a external.as for loading images Do anyone of you knows where gone wrong?? the images can't be loaded.... thanks! I attached my code here! :)

  • Apple Works Data Base Replacement

    Recently got a MacBook Pro going from 10.6.8 to 10.8.3.  I had used the data base program in Apple Works for MANY things.  I was told I would need to buy iWorks, but I can't see that it has a data base program.  Any suggestions would be greatly appre