Getting error while using DYNAMIC SQL

Hi Team,
I am Oracle DBA. I have limited knowledge on PL/SQL. I used below PL/SQL code to drop 50 partitons from one of the table.
I used Dynamic SQL EXECUTE IMMEDIATE to drop partions. But error occured. If I commented EXECUTE IMMEDIATE, procedure executed successfully.
Please suggest me, where i did the mistake. Also please suggest for better code than my code. please find below code and error details.
SQL> ed
Wrote file afiedt.buf
1 DECLARE
2 CURSOR DROP_PARTITON IS select partition_name from user_tab_subpartitions where PARTITION_NAME<='ABCD_2011_04';
3 BEGIN
4 for curr IN DROP_PARTITON LOOP
5 DBMS_output.put_line(curr.partition_name);
6 execute immediate(Alter table Table_Name drop partition curr.partition_name);
7 end loop;
8* END;
SQL> /
execute immediate(Alter table BILLCHRG drop partition curr.partition_name);
ERROR at line 6:
ORA-06550: line 6, column 19:
PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
( - + case mod new not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall merge time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>
<an alternative
SQL> ed
Wrote file afiedt.buf
1 DECLARE
2 CURSOR DROP_PARTITON IS select partition_name from user_tab_subpartitions where PARTITION_NAME<='ABCD_2011_04';
3 BEGIN
4 for curr IN DROP_PARTITON LOOP
5 DBMS_output.put_line(curr.partition_name);
6 --execute immediate(Alter table TABLE_NAME drop partition curr.partition_name);
7 end loop;
8* END;
SQL> /
ABCD_2009_06
ABCD_2009_06
ABCD_2009_06
BILLCHRG_2011_04
PL/SQL procedure successfully completed.

PL/SQL code runs on the server, inside an Oracle process - thus PL/SQL code cannot dynamically write and display messages to the client. That server process is not connected to any keyboard, mouse or display.
DBMS_OUTPUT can be used. This is a PL/SQL buffer area in that server process that code can write lines of text too. When the server process informs the client that it has completed, the client can now request the contents of the DBMS_OUTPUT buffer and the client can display it on the client device.
This is what set serveroutput on in SQL*Plus does - tell the sqlplus client to request the DBMS_OUTPUT buffer after each Oracle server call made and to display the contents locally.
So to display the SQL command can be done using DBMS_OUTPUT. E.g.
declare
  dropPart varchar2(32767);
begin
  for c in (select...) loop
    dropPart := 'alter table my_tab drop partition '||c.partition_name';
    --// write the SQL command to DBMS_OUTPUT
    DBMS_OUTPUT.put_line( dropPart );
    --// execute the SQL using a begin..end block in order to catch error
    begin
      execute immediate dropPart;
      DBMS_OUTPUT.put_line( 'command completed successfully' );
    exception when OTHERS then
      DBMS_OUTPUT.put_line( 'command failed with: '||SQLERRM(SQLCODE) );
    end;
  end loop;
end;So after this code block has been executed and partitions dropped, sqlplus will display the DBMS_OUTPUT generated by this code block.

Similar Messages

  • Getting error while using HTTP connector and calling POST action to a Web API which is deployed as website on Azure

    I have create Logic App under Azure App Services, I am getting
    error while using HTTP connector and calling POST action to a Web API which is deployed as website on Azure.
    Following are the screen shots:
    Login App Connector Diagram:
    hema

    Marking as answered since no response on request for more information - assuming that you found what was wrong in the inputs. Let us know if you're still having trouble.
    http://twitter.com/joshtwist

  • Runtime Error while using Dynamic Selection

    Hi,
      We are getting a runtime error while using a dynamic selection. One of the fields has got an apostrophe in the middle of the text and so the condition is returning an error SAPSQL_WHERE_PARANTHESES.
      Let's say the value in the field is SCV's. So the WHERETAB is filled as 'SCV's' or `SCV's`. An exception is caught in this case as there is no closing apostrophe.
    Let us know if anyone has come across a similar issue and any help is appreciated.
    Regards,
    Sarves

    Hi Sarves,
    as Rob said.
    check also the [ORACLE FAQS|http://www.orafaq.com/faq/how_does_one_escape_special_characters_when_writing_sql_queries] or [SQL SERVER u2013 How to Escape Single Quotes|http://blog.sqlauthority.com/2008/02/17/sql-server-how-to-escape-single-quotes-fix-error-105-unclosed-quotation-mark-after-the-character-string/]
    Honestly: Before posting here and getting a whole lot of more or less useless comments just use your favorite search engine.
    Regards,
    Clemens

  • Getting error while runing utlu102i.sql:

    Dear Experts,
    I am getting following error while running utlu102i.sql script (Oracle 9.2.0.6,HP-UX 11.11)
    DECLARE
    ERROR at line 1:
    ORA-00980: synonym translation is no longer valid
    ORA-06512: at line 2925
    I nned to upgrade this database, how to resolve this problem, furthermore can we goahead on upgrading without solve this ? (pre. may be obtain from another database with almost same configuraton)
    Thanks & Regards
    Sunil Kumar

    Pl open an SR for your issue. You will need to run this script and execute its recommendations before you can upgrade. Are there any errors in the alert.log ? Are any other trace files created ?
    MOS Doc 400200.1 (ORA-0600 [17069] During Upgrade of Pre-10g Database to 10g+) may also help.
    HTH
    Srini

  • Getting error while using Callouts

    Hi Gurus,
    I am getting the below error while using callouts.
    Error -: AIP-51806: Error during callout invocation: Error -: AIP-10606: Domain exception in callout execution. Error -: AIP-10606: Domain exception in callout execution. Callout/Usage property not found for key password.
         at oracle.tip.adapter.b2b.callout.CalloutUtil.raiseIPCalloutDomainException(CalloutUtil.java:88)
         at oracle.tip.adapter.b2b.callout.CalloutContextImpl.getMapValue(CalloutContextImpl.java:100)
         at oracle.tip.adapter.b2b.callout.CalloutContextImpl.getStringProperty(CalloutContextImpl.java:149)
         at com.tm.EncryptMessage.execute(EncryptMessage.java:25)
         at oracle.tip.adapter.b2b.callout.CalloutExecuteWorker.doWork(CalloutExecuteWorker.java:424)
         at oracle.tip.adapter.b2b.callout.CalloutExecuteWorker.run(CalloutExecuteWorker.java:333)
         at java.lang.Thread.run(Thread.java:534)
         at oracle.tip.adapter.b2b.callout.B2BCalloutHandler.handleOutgoingCallout(B2BCalloutHandler.java:344)
         at oracle.tip.adapter.b2b.msgproc.Request.outgoingRequestPostColab(Request.java:1606)
         at oracle.tip.adapter.b2b.msgproc.Request.outgoingRequest(Request.java:975)
         at oracle.tip.adapter.b2b.engine.Engine.processOutgoingMessage(Engine.java:1167)
         at oracle.tip.adapter.b2b.transport.AppInterfaceListener.onMessage(AppInterfaceListener.java:141)
         at oracle.tip.transport.basic.FileSourceMonitor.processMessages(FileSourceMonitor.java:903)
         at oracle.tip.transport.basic.FileSourceMonitor.run(FileSourceMonitor.java:317)
    Caused by: Error -: AIP-10606: Domain exception in callout execution. Error -: AIP-10606: Domain exception in callout execution. Callout/Usage property not found for key password.
         at oracle.tip.adapter.b2b.callout.CalloutUtil.raiseIPCalloutDomainException(CalloutUtil.java:88)
         at oracle.tip.adapter.b2b.callout.CalloutContextImpl.getMapValue(CalloutContextImpl.java:100)
         at oracle.tip.adapter.b2b.callout.CalloutContextImpl.getStringProperty(CalloutContextImpl.java:149)
         at com.tm.EncryptMessage.execute(EncryptMessage.java:25)
         at oracle.tip.adapter.b2b.callout.CalloutExecuteWorker.doWork(CalloutExecuteWorker.java:424)
         at oracle.tip.adapter.b2b.callout.CalloutExecuteWorker.run(CalloutExecuteWorker.java:333)
         at java.lang.Thread.run(Thread.java:534)
         at com.tm.EncryptMessage.execute(EncryptMessage.java:47)
         at oracle.tip.adapter.b2b.callout.CalloutExecuteWorker.doWork(CalloutExecuteWorker.java:424)
         at oracle.tip.adapter.b2b.callout.CalloutExecuteWorker.run(CalloutExecuteWorker.java:333)
         at java.lang.Thread.run(Thread.java:534)
    I have configured the property "password" in the "Callout Properties" & "Callout Usage". I think no properties reaching the "CalloutContext" in the callout class.
    Please help me in this.
    Regards,
    Vithal
    Edited by: Vithal R on 03-Jun-2009 08:07

    Hi Vithal,
    Did you try with sample callouts -
    http://download-uk.oracle.com/docs/cd/B14099_19/integrate.1012/b19370/callouts.htm
    For your case, make sure -
    You are following below steps to create the property -
    http://download.oracle.com/docs/cd/B14099_19/integrate.1012/b19370/callouts.htm#BEIFDECJ
    You have selected the appropriate callout usage while creating the agreement.
    Callout Directory : Just mention the folder and not the jar.
    Mention the appropriate jar file in the Libray name section of the "create call out"
    Let us know the result please.
    Regards,
    Anuj
    Edited by: Anuj Dwivedi on Jun 4, 2009 11:39 AM

  • Getting Error while using CallTarget class

    I am getting following error while using the CallTarget.
    "Exception in thread "main" java.lang.NullPointerException
    at org.apache.tools.ant.taskdefs.Ant.init(Ant.java:147)
    at org.apache.tools.ant.taskdefs.CallTarget.init(CallTarget.java:85)
    at org.apache.tools.ant.taskdefs.CallTarget.setTarget(CallTarget.java:150
    at AntCallTarget.main(AntCallTarget.java:7)"
    Can anyone please help me solve this problem.
    The code where i am getting this error is
              CallTarget antCall = new CallTarget();
              antCall.setTarget("Main");

    I am getting following error while using the CallTarget.
    "Exception in thread "main" java.lang.NullPointerException
    at org.apache.tools.ant.taskdefs.Ant.init(Ant.java:147)
    at org.apache.tools.ant.taskdefs.CallTarget.init(CallTarget.java:85)
    at org.apache.tools.ant.taskdefs.CallTarget.setTarget(CallTarget.java:150
    at AntCallTarget.main(AntCallTarget.java:7)"
    Can anyone please help me solve this problem.
    The code where i am getting this error is
              CallTarget antCall = new CallTarget();
              antCall.setTarget("Main");

  • Getting error while backing up SQL database using powershell

    I am trying to backup SQL database but strange thing is taking lpace, few databases i can backup with powershell but few i am getting error
        Exception calling "SqlBackup" with "1" argument(s): "Backup failed for Server 
        'Server1'. "
        At C:\_Scripts\defaultbackup.ps1:40 char:1
        + $smoBackup.SqlBackup($server)
        + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : FailedOperationException
        $dbToBackup = "test"
        #clear screen
        cls
        #load assemblies
        #note need to load SqlServer.SmoExtended to use SMO backup in SQL Server 2008
        #otherwise may get this error
        #Cannot find type [Microsoft.SqlServer.Management.Smo.Backup]: make sure
        #the assembly containing this type is loaded.
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | 
        Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") 
        | Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-  
        Null
        #create a new server object
        $server = New-Object ("Microsoft.SqlServer.Management.Smo.Server") "(local)"
        $backupDirectory = $server.Settings.BackupDirectory
        "Default Backup Directory: " + $backupDirectory
        $db = $server.Databases[$dbToBackup]
         $dbName = $db.Name
         $timestamp = Get-Date -format yyyyMMddHHmmss
        $smoBackup = New-Object ("Microsoft.SqlServer.Management.Smo.Backup")
        #BackupActionType specifies the type of backup.
        #Options are Database, Files, Log
        #This belongs in Microsoft.SqlServer.SmoExtended assembly
        $smoBackup.Action = "Database"
        $smoBackup.BackupSetDescription = "Full Backup of " + $dbName
        $smoBackup.BackupSetName = $dbName + " Backup"
        $smoBackup.Database = $dbName
        $smoBackup.MediaDescription = "Disk"
        $smoBackup.Devices.AddDevice($backupDirectory + "\" + $dbName + "_" + $timestamp +   
        ".bak",   
        "File")
        $smoBackup.SqlBackup($server)
        #let's confirm, let's list list all backup files
        $directory = Get-ChildItem $backupDirectory
       $smoBackup.Devices.AddDevice($backupDirectory + "\" + $dbName + "_" + $timestamp + ".bak", "File")
    $smoBackup.SqlBackup($server)
    #let's confirm, let's list list all backup files
    $directory = Get-ChildItem $backupDirectory
    #list only files that end in .bak, assuming this is your convention for all backup files
        $backupFilesList = $directory | where {$_.extension -eq ".bak"}
        $backupFilesList | Format-Table Name, LastWriteTime
        $backupFilesList = $directory | where {$_.extension -eq ".bak"}
        $backupFilesList | Format-Table Name, LastWriteTime
    I read on internet that by using this in the script this problem can be sorted but i am
    not sure where exactly to put this line in above script set the ConnectionContext.StatementTimeout to 0
                  

    Hi Srk,
    I found the similar issue in this article, which had been sovled by adding the script below:
    $server = New-Object ("Microsoft.SqlServer.Management.Smo.Server") $dbInstance
    $server.ConnectionContext.StatementTimeout = 0
    Refer to:
    Exception calling "SqlBackup" with "1" argument(s)
    Please feel free to let me know if this method can not work.
    Best Regards,
    Anna Wang

  • Getting Error while using  LKM File to Oracle(SQLLDR) KM in ODI

    Hi All ,
    Could anyone please help me out on this error which i am getting while using LKM File to Oracle(SQLLDR)
    My Scenario :
    1. I have my CSV file created in one location with some records .
    2. Created a new interface having this CSV file as source(File Technology) and Table as target (Oracle technology)
    3. Here i want to get the contents from csv and store into the target table by using SQLLDR .For that i am using this KM- LKM File to Oracle(SQLLDR)
    4. By Executing the Interface i am getting following error at step 6 -call sqlldr
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (most recent call last):
      File "<string>", line 22, in <module>
    Load Error: See E:\demo1\file/SALES.log for details
      at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
      at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:322)
      at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2472)
      at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:47)
      at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:1)
      at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
      at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577)
      at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468)
      at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
      at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
      at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
      at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
      at java.lang.Thread.run(Thread.java:662)
    Caused by: Traceback (most recent call last):
      File "<string>", line 22, in <module>
    Load Error: See E:\demo1\file/SALES.log for details
      at org.python.core.PyException.fillInStackTrace(PyException.java:70)
      at java.lang.Throwable.<init>(Throwable.java:181)
      at java.lang.Exception.<init>(Exception.java:29)
      at java.lang.RuntimeException.<init>(RuntimeException.java:32)
      at org.python.core.PyException.<init>(PyException.java:46)
      at org.python.core.PyException.doRaise(PyException.java:219)
      at org.python.core.Py.makeException(Py.java:1166)
      at org.python.core.Py.makeException(Py.java:1170)
      at org.python.pycode._pyx2.f$0(<string>:59)
      at org.python.pycode._pyx2.call_function(<string>)
      at org.python.core.PyTableCode.call(PyTableCode.java:165)
      at org.python.core.PyCode.call(PyCode.java:18)
      at org.python.core.Py.runCode(Py.java:1204)
      at org.python.core.Py.exec(Py.java:1248)
      at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:172)
      at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
      ... 19 more
    Here the sales.log file is not created in the above directory .I am not getting  where it is actually went wrong.
    I searched for the solution and i could not find any.Please help me out as it is high priority for me.
    I tried to run SQL*Loader through command prompt and i am able to generate the data in the target table and not getting it through ODI.
    Atleast is there any workaround .Please suggest me.
    Environment Details: ODI_11.1.1.7.0, Oracle DB 11g
    Thanks,
    keerthi

    Which agent are you using to execute?
    Standalone? If standalone, did you start it with OPMN?  I've seen such issues with standalone agent started with OPMN.
    Generally these kind of issues occur when you try to run with standalone agent started with OPMN.
    Because OPMN does not have access to the environment shell variables PATH or ORACLE_HOME and therefore the sqlldr.exe binary (or other Oracle product binary) is not found for execution.
    In this case, you need to specify PATH and ORACLE_HOME variables in opmn.xml file like below for your agent(say "MyStandaloneAgent" in this case)
    <ias-component id="MyStandaloneAgent">
    <process-type id="odiagent" module-id="CUSTOM">
      <environment>
         <variable id="ORACLE_HOME" value="C:\oracle\product\11.2.0\client_1"/>
          <variable id="PATH" value="C:\oracle\product\11.2.0\client_1\BIN;$PATH"/>
    After that, start and stop the agent and try the execution once again.

  • Receiver File Error while using Dynamic Configuration

    Hi All,
    My Scenario is from SAP IDOC --> PI --> FIle...
    In the mapping i have used the dynamic variable substitution for the receiver file....
    The Dyanamic file will be alwasy generated irrespective of the condition for the Mapping...
    Now Whenever SAP sends IDOC then file to be created . If the condition is met then there is no problem the file is being created...
    But if condition is not met then the error is being thrown in the Communication Channel...
    Error occurred while connecting to the FTP server "10.1.999.222:21": java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure '' found in document', probably configuration error in file adapter (XML parser error)'
    Note the payload has the dyanmic file generated....
    And when i tested the mapping by coping the payload then
    I am getting the target with empty ...but with MT_ProductMaster node...
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_ProductMaster xmlns:ns0="http://xyz/Ix_ProductMaster/WMS"></ns0:MT_ProductMaster>
    and the error i think bcz of this payload ... but i dont have any option to remove this .... because if condition not met then the root node always will be created...
    In CC File  Content conversion i have given like this
    Record setStructure  FileHeader,FileDetail,FileTrailer
    FileHeader.fieldSeparator |
    FileHeader.endSeparator |'nl'
    FileDetail.fieldSeparator |
    FileDetail.endSeparator |'nl'
    FileTrailer.fieldSeparator |
    FileTrailer.endSeparator |
    and my MT structure is
    MT_ProductMaster 1.1
    FileHeader  0...1
    FileDetail 0....unbounded
    FileTrailer 0...1
    Please help me on how to ignore the empty root node... do i need to handle something else???
    Regards,
    Sridhar Reddy

    Hey
    Record setStructure FileHeader,FileDetail,FileTrailer
    FileHeader.fieldSeparator |
    FileHeader.endSeparator |'nl'
    FileDetail.fieldSeparator |
    FileDetail.endSeparator |'nl'
    FileTrailer.fieldSeparator |
    FileTrailer.endSeparator |
    and my MT structure is
    MT_ProductMaster 1.1
    FileHeader 0...1
    FileDetail 0....unbounded
    FileTrailer 0...1
    of course you will get error in content conversion if file is missing any of the parameters expected by FCC.
    Right now the Content conversion is expecting several values in your payload(even if blank values) but you don't have any of them hence you get this error.
    If you want to deliver empty file,you need to map all the receiver side nodes to some default,so that it is populated to that default (could be blank) if no values are present,then when this comes to content conversion,it will assume the blank value as node and do correct conversion.
    If you dont have values in payload but have specified parameters for it on content conversion,then you will get errors as you mentioned in your first post.
    Thanks
    Aamir

  • Getting error while using TRIM method in collections

    Hi Experts,
    While using TRIM method I am getting below error. Am I doing any mistake here ?
    DB : Oracle 11g
    SQL> declare
      2
      3    type emp_tab is table of employees%rowtype index by binary_integer;
      4    l_emp_tab emp_tab;
      5
      6  begin
      7
      8   select * bulk collect into l_emp_tab from employees;
      9   l_emp_tab.trim(5);
    10   dbms_output.put_line(l_emp_tab.count);
    11
    12  end;
    13  /
    l_emp_tab.trim(5);
    ERROR at line 9:
    ORA-06550: line 9, column 2:
    PLS-00306: wrong number or types of arguments in call to 'TRIM'
    ORA-06550: line 9, column 2:
    PL/SQL: Statement ignored
    Thanks in advance for all your help.
    Cheers,
    Suri

    Gerard, and to Unkonwn epxpert ;-)
    Thanks for the reply. I am aware about extend method. But not sure about TRIM. Once again thanks for your help.
    Cheers,
    Suri

  • ORA-06550 error while executing Dynamic Sql

    EXECUTE IMMEDIATE 'BEGIN :out := ' || lv_formula || '; END;' using out RESULT ;
    here lv_formula:= ((capcost * rate / 100) + (ob + (ob * interestrate / 100)))
    lv_formula is varchar2(360);
    and capcost,rate,ob & interestrate are my column names . Here I m declaring variables same as these columns and datatype is number.
    I am not getting any compilation error. syntax is correct
    while executing this sql i m getting ora-06550.
    can any one help me for resolving this error.
    Thanks In Advance
    hoping for more respose

    Thanks Billy for your response,
    but i still didn't get my desired solution so i am pasting my whole plsql code here. so that u can get better picture.
    /* Formatted on 2010/11/22 15:23 (Formatter Plus v4.8.5) */
    PROCEDURE xb (
    l_refno IN VARCHAR2,
    l_billtyp IN VARCHAR2,
    infor IN VARCHAR2,
    aresult OUT NUMBER
    IS
    --A NUMBER:=10; B NUMBER :=5;
    lv_formula VARCHAR2 (270); --:=(A+B)*2+5;
    l_agtmnt VARCHAR2 (18);
    l_type VARCHAR2 (2);
    RESULT NUMBER;
    refno afxbrmst.refno%TYPE;
    billtyp afxbrmst.billtyp%TYPE;
    ob afxbrmst.ob%TYPE;-- := 45283;
    status afxbrmst.status%TYPE -- := 0;
    dueamt afxbrmst.dueamt%TYPE -- := 0;
    duedate afxbrmst.duedate%TYPE;
    frequency afxbrmst.frequency%TYPE;
    lastrevrate afxbrmst.lastrevrate%TYPE -- := 0;
    penaltyamt afxbrmst.penaltyamt%TYPE -- := 0;
    accounted afxbrmst.accounted%TYPE;
    lastbillraised afxbrmst.lastbillraised%TYPE;
    noofstaff afxbrmst.noofstaff%TYPE;
    items afxbrmst.items%TYPE;
    area afxbrmst.area%TYPE;
    LENGTH afxbrmst.LENGTH%TYPE -- := 0;
    interest afxbrmst.interest%TYPE -- := 0;
    capcost NUMBER; afxbrmst.capcost%TYPE; :=1;
    -- := 1509432;
    periodfrom afxbrrate.periodfrom%TYPE;
    periodto afxbrrate.preiodto%TYPE;
    rcsrate afxbrrate.rcsrate%TYPE -- := 0;
    length_area afxbrrate.length_area%TYPE;
    rate afxbrrate.rate%TYPE --:= 0;
    -- :=3;
    erate afxbrrate.erate%TYPE -- := 0;
    feamount afxbrrate.feamount%TYPE -- := 0;
    interestrate afxbrrate.interestrate%TYPE -- := 0;
    -- :=12;
    fiamount afxbrrate.fiamount%TYPE --:= 0;
    penaltyrate afxbrrate.penaltyrate%TYPE -- := 0;
    l_ob afxbrmst_test.ob%TYPE -- := 0;
    l_capcost afxbrmst.capcost%TYPE -- := 0;
    raise_application_trigger EXCEPTION;
    inti INTEGER;
    BEGIN
    --break;
    lv_formula :=
    TO_NUMBER ((capcost * rate / 100) + (ob + (ob * interestrate / 100)));
    --infor;
    l_agtmnt := l_refno;
    l_type := l_billtyp;
    BEGIN
    SELECT a.refno, a.billtyp, a.ob, a.status, a.dueamt, a.duedate,
    a.frequency, a.lastrevrate, a.penaltyamt, a.accounted,
    a.lastbillraised, a.noofstaff, a.items, a.area, a.LENGTH,
    a.interest, a.capcost
    INTO refno, billtyp, ob, status, dueamt, duedate,
    frequency, lastrevrate, penaltyamt, accounted,
    lastbillraised, noofstaff, items, area, LENGTH,
    interest, capcost
    FROM afxbrmst_test a
    WHERE billtyp = l_type AND refno = l_agtmnt;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    END;
    BEGIN
    SELECT b.periodfrom, b.preiodto, b.rcsrate, b.length_area, b.rate,
    b.erate, b.feamount, b.interestrate, b.fiamount, b.penaltyrate
    INTO periodfrom, periodto, rcsrate, length_area, rate,
    erate, feamount, interestrate, fiamount, penaltyrate
    FROM afxbrrate b
    WHERE billtype = l_type;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    END;
    EXECUTE IMMEDIATE 'BEGIN :out := ' || lv_formula || '; END;'
    USING OUT RESULT; --USING OUT RESULT;
    aresult := RESULT;
    END;
    -- Procedure
    here i m passing the parameter through my form builder and calling this procedure.
    can you tell me where i am making wrong
    Thanks again

  • Getting error while using the data element in ztable

    though i specified the length as 20 in dataelement when i am entering the dataelement i am getting this error
    while i used help i got the following information
    Number of positions < minimum number (1) for data type CHAR
    Message no. DO253
    Diagnosis
    A minimum length is required for the specified data type.
    This minimum length is not reached by the specified number of positions.
    Procedure
    Increase the number of positions or select a more appropriate data type with the possible entries help F4.

    This is strange, you shouldn't even be able to activate the dataelement type char with a length of 0. Revisit your data element and make sure that the length shows to be greater than 0 and reactivate your data element to make sure the newest version is active. In case you are referencing a domain in your data element do the same with the domain after validating that everything is correct (you can also use the check function). Then go back to your table and reenter the data element before activating your table.
    Hope that helps,
    Michael

  • Getting error while using as_access_pub.Create_SalesTeam API

    Hi,
    I am getting this error while executing this API in a procedure which is triggered from a business event.
    "User id 0 is invalid. The user cannot be identified in Resource Manager."
    The error does not occur when I execute the procedure stand-alone from a PL/SQL client. What could be the reason ? Any help would be appreciated.
    Thanks
    Ramya

    Hi,
    thanks for the response. I tried doing that FND_APPS.Initialize... explicitly by passing user_id,resp_id and resp_app_id, still its giving the same error.
    Also note that the API works fine from our development instance (without fnd_apps.initialize), whereas it does not work from our testing instance (with or without fnd_apps.initialize)
    Thanks
    Ramya

  • Getting Error while using HttpAuthManager present in  cdb_devkit.

    Hi,
    I am using the classes present in cdb_devkit in my application. I am using HttpAuthManager class in order to retrieve the Fdksession from existing Http Session of CDB.However while using the HttpAuthManager class:
    HttpAuthManager ham = HttpAuthManager.getInstance();
    I am getting the error when this statement is being executed.
    Error:*"FDK Configuration not initialized! Delay this call until the node and servers are initialized!"*.
    Can anyone please tell me what this error indicate and provide me the solution for resolving this error.
    This is very urgent for me. Thanks in advance.
    Thank You,
    Ravi kumar.

    Gerard, and to Unkonwn epxpert ;-)
    Thanks for the reply. I am aware about extend method. But not sure about TRIM. Once again thanks for your help.
    Cheers,
    Suri

  • Getting error while Using BAPI Interface in VB

    Hi,
    I m getting error message while creating object of SAP.BAPI.1
    Error message is "out of memory : run time error 7".
    do I need to install any patch to my local PC? If yes then from where could i get that patch.
    Plz help me out.
    Thanks & Regards,
    Sagar

    Hi Sagar,
    Please varify the version of SAP client you use. I have noticed that this error with SAP Frontend Package 6.20, and was able to over come the follwing issue by upgrading to the SAP Frontend Package 6.40.
    Regards,
    Randima

Maybe you are looking for