Firing Stored Procedure Into Database At Runtime

HI All,
I need a help !. I have created a stored procedure that creates a dynamic SP at runtime depending upon certain values stored in my database. Now I want that as soon as the dynamic SP is written in a flat file on the database server it should be compiled into database.
What I am doing right now is :
step1: create a SP
step2: fetch values from database
step3: create a string from it which actually contains syntax for creating another SP
step4: open a new file "test.sql" on the database server
step5: write this string into "test.sql"
step6: close the file "test.sql"
step7: exit SP
This creates a file named "test.sql" on oracle database server.
Now my requirement is to include another step after step6 say
step6.1: compile "test.sql" into the database.
Does any one have idea how to achieve this using SP.
Thanks & regards
Vivek Verma

I don't know which solution you're attempting, but here goes.
You cannot build a procedure using objects (e.g. tables, views) etc when you have been granted rights to them via role. Similarly you cannot use execute immediate to use a system privilege (e.g. CREATE PROCEDURE) if you have been granted it through a role (e.g. CONNECT).
In both cases the relevant solution is to get the grantor (table owner, dba user) to grant the privilege to your account by name.
Cheers, APC

Similar Messages

  • How do I return two values from a stored procedure into an "Execute SQL Task" within SQL Server 2008 R2

    Hi,
    How do I return two values from a
    stored procedure into an "Execute SQL Task" please? Each of these two values need to be populated into an SSIS variable for later processing, e.g. StartDate and EndDate.
    Thinking about stored procedure output parameters for example. Is there anything special I need to bear in mind to ensure that the SSIS variables are populated with the updated stored procedure output parameter values?
    Something like ?
    CREATE PROCEDURE [etl].[ConvertPeriodToStartAndEndDate]
    @intPeriod INT,
    @strPeriod_Length NVARCHAR(1),
    @dtStart NVARCHAR(8) OUTPUT,
    @dtEnd NVARCHAR(8) OUTPUT
    AS
    then within the SSIS component; -
    Kind Regards,
    Kieran. 
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Below execute statement should work along the parameter mapping which you have provided. Also try specifying the parameter size property as default.
    Exec [etl].[ConvertPeriodToStartAndEndDate] ?,?,? output, ? output
    Add a script task to check ssis variables values using,
    Msgbox(Dts.Variables("User::strExtractStartDate").Value)
    Do not forget to add the property "readOnlyVariables" as strExtractStartDate variable to check for only one variable.
    Regards, RSingh

  • Getting result set from stored procedures in database controls in weblogic

    I am calling a stored procedure from database control which actually returns a result set
    when i call the stored procedure like
    * @jc:sql statement="call PROC4()"
    ResultSet sampleProc() throws SQLException;
    it gives me exception saying
    "weblogic.jws.control.ControlException: Method sampleProc is DML but does not return void or int"
    I would appreciate any help
    Thanks,
    Uma

    Thanks for you reply!
    1) The stored procedure has head
    CREATE OR REPLACE PROCEDURE X_OWNER.DISPLAY_ADDRESS
    cv_1 IN OUT SYS_REFCURSOR
    AS
    err_msg VARCHAR2(100);
    BEGIN
    --Adaptive Server has expanded all '*' elements in the following statement
    OPEN cv_1 FOR
    Select ...
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    err_msg := SQLERRM;
    dbms_output.put_line (err_msg);
    ROLLBACK;
    END;
    If I only run select .. in DBArtisan, it display all 2030,000 rows in 3:44 minutes
    2) But when call stored procedure, it will take 80-100 minutes .
    3) The stored procedure is translated from sybase using migration tools, it's very simple, in sybase it just
    CREATE PROCEDURE X_OWNER.DISPLAY_ADDRESS
    AS
    BEGIN
    select ..
    The select part is exact same.
    4) The perl code is almost exact same, except the query sql:
    sybase verson: my $sql ="exec DISPLAY_ADDRESS";
    and no need bind the cursor parameter.
    This is batch job, we create a file with all information, and ftp to clients everynight.
    Thanks!
    Rulin

  • Multiple stored procedure in Database Adapter

    Can I manually create the wsdl for database adapter, which can have multiple operations for different stored procedures?
    I tried creating a wsdl as -
    <definitions
    name="CustomAdapter"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/CustomAdapter/"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/CustomAdapter/"
    xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/xsd/"
    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
    xmlns:hdr="http://xmlns.oracle.com/pcbpel/adapter/db/"
    >
    <import namespace="http://xmlns.oracle.com/pcbpel/adapter/db/" location="DBAdapterOutboundHeader.wsdl"/>
    <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://xmlns.oracle.com/pcbpel/adapter/db/xsd/"
    schemaLocation="myadapter.xsd" />
    </schema>
    </types>
    <message name="args_in_msg_tscp1">
    <part name="InputParameters" element="db:InputParametersTSCP1"/>
    </message>
    <message name="args_in_msg_sample">
    <part name="InputParameters" element="db:InputParametersSAMPLE"/>
    </message>
    <message name="args_out_msg_sample">
    <part name="OutputParameters" element="db:OutputParametersSAMPLE"/>
    </message>
    <portType name="Proc1_ptt">
    <operation name="Proc1">
    <input message="tns:args_in_msg_tscp1"/>
    </operation>
    <operation name="Proc2">
    <input message="tns:args_in_msg_sample"/>
    <output message="tns:args_out_msg_sample"/>
    </operation>
    </portType>
    <binding name="Proc1_binding" type="tns:Proc1_ptt">
    <jca:binding />
    <operation name="Proc1">
    <jca:operation
    InteractionSpec="oracle.tip.adapter.db.DBStoredProcedureInteractionSpec"
    SchemaName="SYSTEM"
    ProcedureName="TSCP1"
    >
    </jca:operation>
    <input>
    <jca:header message="hdr:OutboundHeader_msg" part="outboundHeader"/>
    </input>
    </operation>
    <operation name="Proc2">
    <jca:operation
    InteractionSpec="oracle.tip.adapter.db.DBStoredProcedureInteractionSpec"
    SchemaName="SYSTEM"
    ProcedureName="MYSAMPLEPROC"
    >
    </jca:operation>
    <input>
    <jca:header message="hdr:OutboundHeader_msg" part="outboundHeader"/>
    </input>
    <output/>
    </operation>
    </binding>
    <service name="Proc1">
    <port name="Proc1_pt" binding="tns:Proc1_binding">
    <!--Your runtime connection is declared in
    J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml
    These mcf properties here are from your design time connection and
    save you from having to edit that file and restart the application server
    if eis/DB/System25 is missing.
    These mcf properties are safe to remove.-->
    <jca:address location="eis/DB/DBConn25" UIConnectionName="System25"
    />
    </port>
    </service>
    <plt:partnerLinkType name="Proc1_plt" >
    <plt:role name="Proc1_role" >
    <plt:portType name="tns:Proc1_ptt" />
    </plt:role>
    </plt:partnerLinkType>
    </definitions>
    Then I copied this wsdl and corresponding xsd to my BPEL process and created a partnerlink for this wsdl.
    I added two invoke activities, one for Proc1 operation and other for Proc2 operation.
    When I tried testing this BPEL process, the BPEL process manager was invoking only Proc1 operation for both invoke activities and giving me error as-
    <Faulthttp://schemas.oracle.com/bpel/extensionhttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>null:bindingFault</faultcode>
    <faultstring>business exception</faultstring>
    <faultactor>cx-fault-actor</faultactor>
    <detail>
    <code>1400</code>
    <summary>file:/D:/Morrisons/OracleProducts/product/Oracle_SOA/bpel/domains/TestPOC/tmp/.bpel_MyAdapterTest_1.0_c564165702d743346cadb68bc5bbb594.tmp/CustomAdapter.wsdl [ Proc1_ptt::Proc1(InputParameters) ] - WSIF JCA Execute of operation 'Proc2' failed due to: Error while trying to prepare and execute an API. An error occurred while preparing and executing the SYSTEM.TSCP1 API. Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SYSTEM"."EMPS"."EMPID") ORA-06512: at "SYSTEM.TSCP1", line 4 ORA-06512: at line 1 [Caused by: ORA-01400: cannot insert NULL into ("SYSTEM"."EMPS"."EMPID") ORA-06512: at "SYSTEM.TSCP1", line 4 ORA-06512: at line 1 ] ; nested exception is: ORABPEL-11811 Error while trying to prepare and execute an API. An error occurred while preparing and executing the SYSTEM.TSCP1 API. Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SYSTEM"."EMPS"."EMPID") ORA-06512: at "SYSTEM.TSCP1", line 4 ORA-06512: at line 1 [Caused by: ORA-01400: cannot insert NULL into ("SYSTEM"."EMPS"."EMPID") ORA-06512: at "SYSTEM.TSCP1", line 4 ORA-06512: at line 1 ] Check to ensure that the API is defined in the database and that the parameters match the signature of the API. Contact oracle support if error is not fixable. </summary>
    <detail> Internal Exception: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SYSTEM"."EMPS"."EMPID") ORA-06512: at "SYSTEM.TSCP1", line 4 ORA-06512: at line 1 Error Code: 1400</detail>
    </detail>
    </Fault>
    I want to create only one wsdl for all the strored procedures.

    Can I manually create the wsdl for database adapter, which can have multiple operations for different stored procedures?
    I tried creating a wsdl as -
    <definitions
    name="CustomAdapter"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/CustomAdapter/"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/CustomAdapter/"
    xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/xsd/"
    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
    xmlns:hdr="http://xmlns.oracle.com/pcbpel/adapter/db/"
    >
    <import namespace="http://xmlns.oracle.com/pcbpel/adapter/db/" location="DBAdapterOutboundHeader.wsdl"/>
    <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://xmlns.oracle.com/pcbpel/adapter/db/xsd/"
    schemaLocation="myadapter.xsd" />
    </schema>
    </types>
    <message name="args_in_msg_tscp1">
    <part name="InputParameters" element="db:InputParametersTSCP1"/>
    </message>
    <message name="args_in_msg_sample">
    <part name="InputParameters" element="db:InputParametersSAMPLE"/>
    </message>
    <message name="args_out_msg_sample">
    <part name="OutputParameters" element="db:OutputParametersSAMPLE"/>
    </message>
    <portType name="Proc1_ptt">
    <operation name="Proc1">
    <input message="tns:args_in_msg_tscp1"/>
    </operation>
    <operation name="Proc2">
    <input message="tns:args_in_msg_sample"/>
    <output message="tns:args_out_msg_sample"/>
    </operation>
    </portType>
    <binding name="Proc1_binding" type="tns:Proc1_ptt">
    <jca:binding />
    <operation name="Proc1">
    <jca:operation
    InteractionSpec="oracle.tip.adapter.db.DBStoredProcedureInteractionSpec"
    SchemaName="SYSTEM"
    ProcedureName="TSCP1"
    >
    </jca:operation>
    <input>
    <jca:header message="hdr:OutboundHeader_msg" part="outboundHeader"/>
    </input>
    </operation>
    <operation name="Proc2">
    <jca:operation
    InteractionSpec="oracle.tip.adapter.db.DBStoredProcedureInteractionSpec"
    SchemaName="SYSTEM"
    ProcedureName="MYSAMPLEPROC"
    >
    </jca:operation>
    <input>
    <jca:header message="hdr:OutboundHeader_msg" part="outboundHeader"/>
    </input>
    <output/>
    </operation>
    </binding>
    <service name="Proc1">
    <port name="Proc1_pt" binding="tns:Proc1_binding">
    <!--Your runtime connection is declared in
    J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml
    These mcf properties here are from your design time connection and
    save you from having to edit that file and restart the application server
    if eis/DB/System25 is missing.
    These mcf properties are safe to remove.-->
    <jca:address location="eis/DB/DBConn25" UIConnectionName="System25"
    />
    </port>
    </service>
    <plt:partnerLinkType name="Proc1_plt" >
    <plt:role name="Proc1_role" >
    <plt:portType name="tns:Proc1_ptt" />
    </plt:role>
    </plt:partnerLinkType>
    </definitions>
    Then I copied this wsdl and corresponding xsd to my BPEL process and created a partnerlink for this wsdl.
    I added two invoke activities, one for Proc1 operation and other for Proc2 operation.
    When I tried testing this BPEL process, the BPEL process manager was invoking only Proc1 operation for both invoke activities and giving me error as-
    <Faulthttp://schemas.oracle.com/bpel/extensionhttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>null:bindingFault</faultcode>
    <faultstring>business exception</faultstring>
    <faultactor>cx-fault-actor</faultactor>
    <detail>
    <code>1400</code>
    <summary>file:/D:/Morrisons/OracleProducts/product/Oracle_SOA/bpel/domains/TestPOC/tmp/.bpel_MyAdapterTest_1.0_c564165702d743346cadb68bc5bbb594.tmp/CustomAdapter.wsdl [ Proc1_ptt::Proc1(InputParameters) ] - WSIF JCA Execute of operation 'Proc2' failed due to: Error while trying to prepare and execute an API. An error occurred while preparing and executing the SYSTEM.TSCP1 API. Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SYSTEM"."EMPS"."EMPID") ORA-06512: at "SYSTEM.TSCP1", line 4 ORA-06512: at line 1 [Caused by: ORA-01400: cannot insert NULL into ("SYSTEM"."EMPS"."EMPID") ORA-06512: at "SYSTEM.TSCP1", line 4 ORA-06512: at line 1 ] ; nested exception is: ORABPEL-11811 Error while trying to prepare and execute an API. An error occurred while preparing and executing the SYSTEM.TSCP1 API. Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SYSTEM"."EMPS"."EMPID") ORA-06512: at "SYSTEM.TSCP1", line 4 ORA-06512: at line 1 [Caused by: ORA-01400: cannot insert NULL into ("SYSTEM"."EMPS"."EMPID") ORA-06512: at "SYSTEM.TSCP1", line 4 ORA-06512: at line 1 ] Check to ensure that the API is defined in the database and that the parameters match the signature of the API. Contact oracle support if error is not fixable. </summary>
    <detail> Internal Exception: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SYSTEM"."EMPS"."EMPID") ORA-06512: at "SYSTEM.TSCP1", line 4 ORA-06512: at line 1 Error Code: 1400</detail>
    </detail>
    </Fault>
    I want to create only one wsdl for all the strored procedures.

  • Stored Procedure :  Verify Database message

    Hi,
    I'm new to Crystal Reports and am using the latest Trial version.
    I'm using this against SQL Server stored procedure - which is working fine on SQL Server side. Running it in SQL Server, returns ~9000 rows, using 58 columns, in about 9secs.
    When I try to run this in Crystal Reports, grouping, filtering and designing the report with about 10 fields I get the message:
    "One or more fields could not be found in the result set. Use Verify Database to update the report."
    I've verified the database and everything is up to date.
    I've tried only putting individual fields into the report and this is working fine.
    I've used the Set Database Location and it's pointing to the right location, but I've tried updating this just in case.
    Are there any limits that need to be adjusted within Crystal Reports?
    Any help would be appreciated.
    Thanks,
    Amrit

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551
    You may have to check for null values.

  • Displaying data from stored procedure into textbox fields based on user input.

    I have a stored procedure that is selecting data from a table called "Vendor" in my database.  The data that is being returned are vendor names, vendor addresses, vendor Id's, etc...In my stored proc, I have one parameter that allows
    the user to enter a vendor name and then return all the data for that specific vendor.  The report that I'm building is going to look like a basic form with a bunch of textboxes on the screen labeled Vendor Address, Vendor Id, Vendor City, Vendor State,
    etc...In the report I'm trying to build, the user will enter in a vendor name and then it will return all of the vendor's data based on what the user searches for.  However, the report will only return ONE vendor's data at a time. 
    The problem is that some of the data in the database has very similiar vendor names, but different vendor addresses, vendor Id's, etc...In some instances the vendor name is actually
    exactly the same, but the vendor address, vendor city, vendor Id, is all different.  So what I did was added another parameter in my report that shows a drop down list of vendor names based on the wildcard search the user just did and
    allows the user to select the exact vendor name that he/she is looking for based on what they searched.  The problem I'm having is that I don't know what expression I need to put in each one of my textboxes to retrieve the correct data from
    the vendor table that the user selects from the drop down list.  So what I want to do is return the exact data from the vendor table based on the selection that the user makes from that drop down list.  It's like I somehow have to compare the
    drop down list parameter directly to the dataset but I don't know what expression needs to go in the textbox.  I've tried...=First(Fields!VendorName.Value, "DataSet1").EqualsParameters!DropDownList.Value(0) but I keep getting an error message.
    --Here is an example of the kind of thing the user might search for...when the user searches the word "sprint" it returns three different vendor names to the drop down list.
    1. sprint
    2. sprint
    3. sprint co
    Each one of those three vendor names has a different vendor address, vendor city, vendor ID, etc...but the vendor names are extremely similar and in some cases
    exactly the same. In my report now I can't get the textboxes to return the correct data based on what the user selects.  Any advice at all is greatly appreciated.
    P.S. I didn't even know what SQL Server was a month ago and had zero knowledge of SSRS at all.  I've learned a lot recently, but if you could explain a solution in the easiest way possible I would appreciate it. Thanks!

    Hi Jrcowles,
    If I understand you correctly, you wnat to list all the Vendor Name which like the user typed Vendor Name on a drop-down list, right? If in this case, we can use a cascading parameters to achieve your requirement. I have tested it on my local environment,
    the steps below are for you reference.
    Create an other stored procedure using the query below.
    CREATE PROCEDURE GetVendorName
    @VendorName NVARCHAR(50)
    AS BEGIN
    exec( 'SELECT * FROM Vendor WHERE VendorName LIKE ''%'+@VendorName+'%''')
    END
    Create another dataset DataSet2 and using the new created procedure.
    Create another parameter VendorName2 and check "Allow Multiple Values" for this parameter.
    On the Available Values tab, check "Get values from a query". Select corresponding dataset and field.
    On the Default Values tab, check "Get values from a query". Select corresponding dataset and field.
    The screenshots below are for you reference.
    Reference
    http://technet.microsoft.com/en-us/library/aa337169(v=sql.100).aspx
    http://www.msbiguide.com/2012/02/adding-cascading-parameters-to-ssrs-reports/
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to invoke a stored procedure in database adapter

    Hi All,
    i have created a database adapter which contains a stored procedure, the procedure is merge process,which bring data from another database,
    i have made sure that checking for new records and updating any changes from the source database everything has been taken care in the procedure.
    my question is how to invoke this process, what all process activities need to be associated with the database adapter, to invoke it
    assuming i want to run it every 5 hours,
    any reply would be of great help.
    Regards
    Ananth

    Hi,
    V thanks for you reply, i am v much new to this bpel environment, i tried using invoke but got errors like
    Error(61):
    [Error ORABPEL-10107]: Invalid initial activities
    [Description]: in line 61 of "C:\jdevstudio10134\jdev\mywork\Incremental_refresh\data_incr_refresh\bpel\data_incr_refresh.bpel", Initial activity is invalid. An initial activity must be of a receive or pick activity..
    [Potential fix]: Please re-arrange the BPEL process definition to make sure its initial activity is of a receive or pick activity. (e.g. by adding new receive activity or removing invalid initial activities..
    Error:
    [Error ORABPEL-10063]: missing initial receive activity
    [Description]: in "C:\jdevstudio10134\jdev\mywork\Incremental_refresh\data_incr_refresh\bpel\data_incr_refresh.bpel", there is no receive activity that starts the process.
    [Potential fix]: make sure one of "pick" and "receive" activities have attribute      "createInstance" set to be "yes".
    later i used the service pick, so from pick i am heading to ivoke and later to finally database adapter, but still getting below error
    Error(59):
    [Error ORABPEL-10900]: xml parser error
    [Description]: in line 59 of "file:/C:/jdevstudio10134/jdev/mywork/Incremental_refresh/data_incr_refresh/bpel/data_incr_refresh.bpel", XML parsing failed because file:/C:/jdevstudio10134/jdev/mywork/Incremental_refresh/data_incr_refresh/bpel/data_incr_refresh.bpel<Line 59, Column 19>: XML-24536: (Error) Missing Attribute 'partnerLink'.
    [Potential fix]: Fix the invalid XML.
    Error(59):
    [Error ORABPEL-10900]: xml parser error
    [Description]: in line 59 of "file:/C:/jdevstudio10134/jdev/mywork/Incremental_refresh/data_incr_refresh/bpel/data_incr_refresh.bpel", XML parsing failed because file:/C:/jdevstudio10134/jdev/mywork/Incremental_refresh/data_incr_refresh/bpel/data_incr_refresh.bpel<Line 59, Column 19>: XML-24536: (Error) Missing Attribute 'portType'.
    [Potential fix]: Fix the invalid XML.
    Error(59):
    [Error ORABPEL-10900]: xml parser error
    [Description]: in line 59 of "file:/C:/jdevstudio10134/jdev/mywork/Incremental_refresh/data_incr_refresh/bpel/data_incr_refresh.bpel", XML parsing failed because file:/C:/jdevstudio10134/jdev/mywork/Incremental_refresh/data_incr_refresh/bpel/data_incr_refresh.bpel<Line 59, Column 19>: XML-24536: (Error) Missing Attribute 'operation'.
    [Potential fix]: Fix the invalid XML.

  • Error Stored Procedure Upgrading database from SBO 2007A PL42 to SBO 8.8

    Hi,
    When executing the SBO 8.8 PL00  upgrade procedure for databases for an "old" database 2007A PL 42, upgrtade stops whith an error concerning a missing stored procedure "_TmSp_CorrectWrongDocLineNumberInOINMForIPF which is not found".
    The error details says that it occurs on "Stock Updates" step (just after Checks for Payment) and log file gives the following message here after.
    Does anybody have an idea how to upgrade the 2007A database ?
    Thanks
    Error message in log :
    Upgrade          Error              Technical     Failed to call Stored Procedure TmSpCorrectWrongDocLineNumberInOINMForIPF
    Edited by: Michel Diepart on Oct 24, 2009 10:55 PM

    Hi Paul,
    Thanks for your prompt response on a saturday and so late in the evening
    Concerning the Stored Procedure, I would like to delete it but ... it doesn't exist and that's the problem...
    No such procedure in my database (programmability / Stored procedurefolder in SQL).
    When searching on the forum about this stored procedure, no result.
    Does this stored procedure have a link with something regarding adjustment in stock ?
    "Stock updates" : what table is it in SAP B1 ? If necessary I could save the table, create a sql query to re-create it after delete and try to restart the upgrade procedure but I don't know what is the related table...
    I will also try with another 2007A PL 42 database to see if it works.
    Do you know if anybody has already try to upgrade a 2007 PL42 dabase to SBO 8.8 ?
    Best regards

  • Can't see stored procedure in database explorer

    I'm using mysql 5.0. When I expan the database in database explorer, I can see only tables.  Stored procedure folder is shown there but when i try to expand it..nothing inside it.  
    Anyone knew the solution,  Could u please help??!
    Thanks in advance.

    You'll need to publish the site to your remote server and post a URL here to get any help.  It could be you're testing locally and IE browser security is getting in the way.  Or it may be due to a missing file on server, etc...
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Stored procedure with database link with "from table(...)"

    Hi guys,
    I've been told I can't create views on a database by the design team and so have to use this stored procedure to obtain the values.
    select HAN_ID, HAN_DS, GLOBAL_IN, LOCAL_IN
    from table(cast(ODADMIN.ODP00002_QUERY.Execute001@DBLINK(11312,'EN') as
    ODADMIN.ODP00002_001_Array@DBLINK)) WHERE LOCAL_IN = 'Y';I've been told that it works when you remove the database links (so on the actual database) when you remove the cast part. I've tried it with my link and with/without the cast part but it doesn't work. With the example above I get the error: ORA-00907: missing right parenthesis.
    When I remove the CAST-AS and the additional parenthesis it brings i get the error: ORA-00904: "ODADMIN"."ODP00002_QUERY"."EXECUTE001": invalid identifier
    When I do table( *"* ODADMIN.ODP00002_QUERY.Execute001@MWW_DEV(11312,'EN') *"* )... -- wrapping the call in speech marks I get: ORA-00972: identifier is too long
    Anyone see what's wrong? Thanks for any help.
    Mike

    Hi Ben,
    Asking now. By a view I mean one local to the database; I could create one on APEX but then I use the database link twice instead of just 1.
    His reasoning Ben:
    Firstly, Maintenance. We will have to maintain additional views (at additional code). Secondly, if the view has a JOIN, then you can't update through it (without complexities). If we have to get the View to pass the data to a Procedure (that's a pain). Also, standards..
    All update occur via either a Procedure, or a Base view, across over 1000 tables
    That's the standard, and doing things differently is costly long term
    People will not know how it works, it will have to be explained, maintained..etc.
    If the Application has the Business Rules, then updates via Base Views, that's a more standard way of developing. Also, if you update via this view, you'll update multiple rows in one call, which is in-effficient if only ONE row needs to change. Therefore, single row updates from the Application is more efficient
    The procedure is as follows:
    --SET SERVEROUTPUT ON
    DECLARE
    nPBusLoc       NUMBER(5):=11312;
    sPHanId        VARCHAR2(3):='SB1';
    sPLngId        VARCHAR2(2):='EN';
    sPDesc         VARCHAR2(30);
    sPAllowAlloc   VARCHAR2(1);
    sPShowEnq      VARCHAR2(1);
    sPAllowDel     VARCHAR2(1);
    sPShowScan     VARCHAR2(1);
    sPGlobalLocal  VARCHAR2(1);
    sPReturnCd     VARCHAR2(2);
    sPReturnTx     VARCHAR2(100);                  
    BEGIN
    ODADMIN.ODP00001.getHandlingCodes
                           (nPBusLoc    --  IN   NUMBER
                          ,sPHanId      -- IN   VARCHAR2
                          ,sPLngId      -- IN   VARCHAR2
                          ,sPDesc       -- OUT  VARCHAR2
                          ,sPAllowAlloc -- OUT  VARCHAR2
                          ,sPShowEnq    -- OUT  VARCHAR2
                          ,sPAllowDel   -- OUT  VARCHAR2
                          ,sPShowScan   -- OUT  VARCHAR2
                          ,sPGlobalLocal-- OUT  VARCHAR2
                          ,sPReturnCd   -- OUT  VARCHAR2
                          ,sPReturnTx   -- OUT  VARCHAR2                                    
    DBMS_OUTPUT.PUT_LINE('nPBusLoc                 = '||nPBusLoc              );
    DBMS_OUTPUT.PUT_LINE('sPHanId                  = '||sPHanId               );
    DBMS_OUTPUT.PUT_LINE('sPLngId                  = '||sPLngId               );
    DBMS_OUTPUT.PUT_LINE('sPDesc                   = '||sPDesc                );
    DBMS_OUTPUT.PUT_LINE('sPAllowAlloc             = '||sPAllowAlloc          );
    DBMS_OUTPUT.PUT_LINE('sPShowEnq                = '||sPShowEnq             );
    DBMS_OUTPUT.PUT_LINE('sPAllowDel               = '||sPAllowDel            );
    DBMS_OUTPUT.PUT_LINE('sPShowScan               = '||sPShowScan            );
    DBMS_OUTPUT.PUT_LINE('sPGlobalLocal            = '||sPGlobalLocal         );
    DBMS_OUTPUT.PUT_LINE('sPReturnCd               = '||sPReturnCd            );
    DBMS_OUTPUT.PUT_LINE('sPReturnTx               = '||sPReturnTx            );
    END;
    /Mike
    Edited by: Dird on 27-Aug-2009 01:50

  • Importing Stored procedures into pre-made report

    <p>Hello all,</p><p>i&#39;v got some trouble with some pre-made reports that we wish to start using with embedded java engine.</p><p>Reports are stored procedure based and the built-in connection is ODBC.</p><p>What I&#39;d like to do is to change the datasource to JDBC datasource and run all queryes through there. Is is possible with CR4E ? </p><p> </p><p>Best regards,</p><p>Henrix</p>

    Hi Henrix,
    This is possible, however there is a known issue with the Database Explorer that ships with CR4E in that Stored Procs are not displayed. You can check out the following forum thread if you want more information on this specific issue:
    *http://diamond.businessobjects.com/node/520*
    This issue generally affects creating new reports against Stored Procedures, but it will affect you as well as it will prevent you from using the UI to switch from one database driver to another, Primarily because the Stored Procs won't be displayed in the destination table that you wish to switch to.
    To get around this we will need to create a simple java routine to switch the tables via code. The attached code below will go through all of the tables in the main report and the subreport and assign the new JDBC connection information:
    package com.businessobjects.samples;
    import java.io.IOException;
    import com.crystaldecisions.sdk.occa.report.application.OpenReportOptions;
    import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument;
    import com.crystaldecisions.sdk.occa.report.data.IConnectionInfo;
    import com.crystaldecisions.sdk.occa.report.data.ITable;
    import com.crystaldecisions.sdk.occa.report.data.Tables;
    import com.crystaldecisions.sdk.occa.report.lib.IStrings;
    import com.crystaldecisions.sdk.occa.report.lib.PropertyBag;
    import com.crystaldecisions.sdk.occa.report.lib.ReportSDKException;
    public class ChangeDatasource {
    Â Â Â /**
    Â Â Â * @param args
    Â Â Â * @throws ReportSDKException
    Â Â Â * @throws IOException
    Â Â Â */
    Â Â Â public static void main(String[] args) throws ReportSDKException, IOException {
    Â Â Â Â Â Â //change the next set of variables to match your requirements
    Â Â Â Â Â Â String connectionURL = "jdbc:derby:classpath:/Xtreme";
    Â Â Â Â Â Â String driverName = "org.apache.derby.jdbc.EmbeddedDriver";
    Â Â Â Â Â Â String DB_USER_NAME="bobj";
    Â Â Â Â Â Â String DB_PASSWORD = "bobj";
    Â Â Â Â Â Â String reportName = "MyODBCReport.rpt";
    Â Â Â Â Â Â
    Â Â Â Â Â Â //the next few variables should not need to be changed for JDBC connections
    Â Â Â Â Â Â String SERVER_TYPE = "JDBC (JNDI)";
    Â Â Â Â Â Â String USE_JDBC = "true";
    Â Â Â Â Â Â String DATABASE_DLL = "crdb_jdbc.dll";
    Â Â Â Â Â Â String CONNECTION_URL = connectionURL;
    Â Â Â Â Â Â String DATABASE_CLASS_NAME = driverName;
    Â Â Â Â Â Â
    Â Â Â Â Â Â ReportClientDocument clientDoc = new ReportClientDocument();
    Â Â Â Â Â Â clientDoc.setReportAppServer("inproc:jrc");
    Â Â Â Â Â Â
    Â Â Â Â Â Â // Open report
    Â Â Â Â Â Â clientDoc.open(reportName, OpenReportOptions._openAsReadOnly);
    Â Â Â Â Â Â
    Â Â Â Â Â Â PropertyBag propertyBag = null;
    Â Â Â Â Â Â IConnectionInfo connectionInfo = null;
    Â Â Â Â Â Â ITable origTable = null;
    Â Â Â Â Â Â ITable newTable = null;
    Â Â Â Â Â Â Tables tables = null;
    Â Â Â Â Â Â
    Â Â Â Â Â Â //this next routine iterates through all the tables in the main report
    Â Â Â Â Â Â //if you need to make specific changes to an individual table you can
    Â Â Â Â Â Â //evaluate the name of the current table and change the code accordingly
    Â Â Â Â Â Â tables = clientDoc.getDatabaseController().getDatabase().getTables();
            for(int i = 0;i < tables.size();i+){<br />            origTable = tables.getTable(i);<br />            newTable = (ITable)origTable.clone(true);<br />            newTable.setQualifiedName(origTable.getAlias());<br />            connectionInfo = newTable.getConnectionInfo();<br />            <br />            // Set new table connection property attributes<br />            propertyBag = new PropertyBag();<br /><br />            // Overwrite any existing properties with updated values<br />            propertyBag.put("Server Type", SERVER_TYPE);<br />            propertyBag.put("Use JDBC", USE_JDBC);<br />            propertyBag.put("Database DLL",DATABASE_DLL );<br />            propertyBag.put("Connection URL", CONNECTION_URL);<br />            propertyBag.put("Database Class Name", DATABASE_CLASS_NAME);<br />            connectionInfo.setAttributes(propertyBag);<br /><br />            connectionInfo.setUserName(DB_USER_NAME);<br />            connectionInfo.setPassword(DB_PASSWORD);<br /><br />            // Update the table information<br />            clientDoc.getDatabaseController().setTableLocation(origTable, newTable);            <br />        }<br />    <br />    // Next loop through all the subreports and pass in the same<br />    // information. You may consider creating a separate method which accepts different settings<br />        IStrings subNames = clientDoc.getSubreportController().getSubreportNames();<br />        for (int subNum=0;subNum<subNames.size();subNum) {<br />            tables = clientDoc.getSubreportController().getSubreport(subNames.getString(subNum)).getDatabaseController().getDatabase().getTables();<br />            for(int i = 0;i < tables.size();i+){
    Â Â Â Â Â Â Â Â Â Â Â Â origTable = tables.getTable(i);
    Â Â Â Â Â Â Â Â Â Â Â Â newTable = (ITable)origTable.clone(true);
    Â Â Â Â Â Â Â Â Â Â Â Â newTable.setQualifiedName(origTable.getAlias());
    Â Â Â Â Â Â Â Â Â Â Â Â connectionInfo = newTable.getConnectionInfo();
    Â Â Â Â Â Â Â Â Â Â Â Â // Set new table connection property attributes
    Â Â Â Â Â Â Â Â Â Â Â Â propertyBag = new PropertyBag();
    Â Â Â Â Â Â Â Â Â Â Â Â // Overwrite any existing properties with updated values
    Â Â Â Â Â Â Â Â Â Â Â Â propertyBag.put("Server Type", SERVER_TYPE);
    Â Â Â Â Â Â Â Â Â Â Â Â propertyBag.put("Use JDBC", USE_JDBC);
    Â Â Â Â Â
    Â Â Â Â Â Â Â propertyBag.put("Database DLL",DATABASE_DLL );
    Â Â Â Â Â Â Â Â Â Â Â Â propertyBag.put("Connection URL", CONNECTION_URL);
    Â Â Â Â Â Â Â Â Â Â Â Â propertyBag.put("Database Class Name", DATABASE_CLASS_NAME);
    Â Â Â Â Â Â Â Â Â Â Â Â connectionInfo.setAttributes(propertyBag);
    Â Â Â Â Â Â Â Â Â Â Â Â connectionInfo.setUserName(DB_USER_NAME);
    Â Â Â Â Â Â Â Â Â Â Â Â connectionInfo.setPassword(DB_PASSWORD);
    Â Â Â Â Â Â Â Â Â Â Â Â // Update the table information
    Â Â Â Â Â Â Â Â Â Â Â Â clientDoc.getSubreportController().getSubreport(subNames.getString(subNum)).getDatabaseController().setTableLocation(origTable, newTable);
    Â Â Â Â Â Â Â Â Â Â Â Â }
    Â Â Â Â Â Â Â Â Â }
    Â Â Â Â Â Â
    Â Â Â Â Â Â //save the report with the changes
    Â Â Â Â Â Â clientDoc.save();
    Â Â Â
    Â Â Â }
    Â Â Â
    Â This code is pretty generic, however you can modify it to be specific for each report if necessary.
    Regards,
    Sean Johnson (CR4E Product Manager)
    Rate this plugin @ Eclipse Plugin Central          </p>

  • Multiple result sets from stored procedure into CachedRowSet

    How can you obtain multiple sets of data from a stored procedure that returns multiple result sets, when you'd like to use CachedRowSet rather than ResultSet?
    My database's stored procedures return multiple result sets, but I'm not sure how to manipulate that using CallableStatements and CachedRowSets... I read the RowSet tutorial from java.sun.com but that didn't cover the case of multiple result sets and CallablStatements.
    How might I do this? Thanks a lot.

    SELECT columns..
    FROM table
    FOR XML PATH('NodeName'),('Rootname')
    Thank you for replying.
    I dont have to generate XML from a query. I have to generate from a SP and that too without modifying it.
    Thanks,
    Tauhid
    thats ok you can do like this
    1. Create a table with structure same as SP resultset
    2. Populate table with SP result as per below
    INSERT table
    EXEC SPName param1value,...
    3. Add a query like below
    SELECT columns..
    FROM tablename
    FOR XML PATH('NodeName'),('RootName')
    see
    http://visakhm.blogspot.com/2014/05/t-sql-tips-fun-with-for-xml-path.html
    4. Use sp_send_dbmail to sent it through mail
    http://msdn.microsoft.com/en-IN/library/ms190307.aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Calling stored procedure into Crystal Report

    Could any one help in suggesting how to call the stored procedure with parameters into crystal report?
    i have tried using couple of methods
    I have added this in add command option of Crystal report
    Execute HRMS_DEVP.DPRC_GET_LEAVE_BAL(P_COMP_CODE,P_EMP_CODE,P_LV_CATG_CODE,P_DATE,P_BALANCE)
    WHERE in p_balance i would be retrieving the output.
    Second method i followed is
    SELECT DFUN_GET_LEAVE_BAL(:P_COMP_CODE,:P_EMP_CODE,:P_LV_CATG_CODE,:P_DATE)FROM
    DUAL;

    Hi,
    Have you tried the 'get_value' function?..The syntax is
    declare
    l_dept number(5);
    begin
    l_dept := get_value('dept');
    /* further process */
    end;
    where 'dept' is name of the bind variable.
    -Krishnamurthy

  • How to Split a Stored Procedure into  4 SP's URGENT!!!!!!!!!!!!!!!!

    hi,
    Every thing is set now. But only one issue is left over.
    CREATE OR REPLACE package dyn_query_MBU21
    is
    type r_cur is ref cursor;
    procedure get_query(p_scorecard_id in integer,p_user_id in integer,p_start_bu in integer,p_end_bu IN INTEGER,p_parent_srsid in integer);
    procedure printQuery(p_scorecard_id integer,p_user_id integer,p_start_bu integer,p_end_bu integer,p_parent_srsid integer);
    end dyn_query_MBU21;
    CREATE OR REPLACE package body dyn_query_MBU21
    is
    procedure get_query(p_scorecard_id in integer,p_user_id in integer,p_start_bu in integer,p_end_bu IN INTEGER,p_parent_srsid in integer)
    is
    l_query VARCHAR2(32700);
    v_temp varchar2(300);
    v_strLength integer;
    val integer;
    --p_start_bu INTEGER;
    --p_end_bu INTEGER;
    --v_cur r_cur;
    l_buCount integer default 0;
    BEGIN
    l_query := 'select
    a.PLAN_TO_WIN PTWID,
    a.SPQRC SPQRCID,
    l.NAME Plan_to_Win,
    m.NAME BPD,
    a.metric_id,
    a.NAME Key_Measures,
    a.DESCRIPTION,
    c.DATE_MONTH_DIM_KEY,
    c.CALENDAR_MONTH_NBR,
    c.CALENDAR_YEAR_MONTH_CDE,
    e.SRS_ID,e.YEAR_VALUE,
    f.YTD_VALUE YTD,
    g.CALENDAR_YEAR_NBR,
    h.FIRST_NAME || h.LAST_NAME Scorecard_Owner
    , j.TYPE_NAME Management_Level,
    k.NAME Business_Unit
    , N.SCORECARD_ID
    , N.NAME
    , K.LOC_CURRENCY_ID
    --decode(ltrim(rtrim(k.PARENT_SRS_ID)),' || p_parent_srsid || ', k.NAME) Parent_BU ';
    , decode(ltrim(rtrim(k.PARENT_SRS_ID)),3,''Bill Boggs'') Parent_BU ';
    for x in ( select distinct NAME from SRS_DIM where parent_srs_id = p_parent_srsid and rownum < 20)
    loop
    l_buCount := l_buCount + 1;
    l_query := l_query ||
    ' , decode(ltrim(rtrim(K.NAME)),'''||ltrim(rtrim(x.NAME))||''', D.MONTH_VALUE ) '||replace(to_char(x.NAME),' ','_');
    -- dbms_output.put_line('this is the query'||l_query);
    end loop;
    l_query := l_query ||
    ' FROM
    METRIC_DIM A,TARGET_MONTH B,DATE_MONTH_DIM C,METRIC_SRS_MONTH_EVAL D,TARGET_YEAR E,METRIC_SRS_YTD_EVAL F,DATE_YEAR_DIM G,
    GM_USER_DIM H,USER_PRIV I,SRS_ITEMTYPE_DIM J,SRS_DIM K,PLAN_TO_WIN_DIM L,SPQRC_DIM M,SCORECARD_DIM N
    WHERE
    L.PLAN_TO_WIN_ID= A.PLAN_TO_WIN
    AND M.SPQRC_ID= A.SPQRC
    AND A.METRIC_ID=B.METRIC_ID
    AND B.DATE_MONTH_DIM_KEY=C.DATE_MONTH_DIM_KEY
    AND B.SRS_ID=K.SRS_ID
    AND B.SRS_ID=F.SRS_ID
    AND D.SRS_ID=F.SRS_ID
    AND D.SRS_ID=K.SRS_ID
    AND D.DATE_DIM_KEY=C.DATE_MONTH_DIM_KEY
    AND D.METRIC_ID = B.METRIC_ID
    AND D.METRIC_ID = E.METRIC_ID
    AND D.METRIC_ID = F.METRIC_ID
    and d.SRS_ID=b.SRS_ID
    and d.DATE_DIM_KEY=b.DATE_MONTH_DIM_KEY
    AND E.SRS_ID = F.SRS_ID
    AND G.DATE_YEAR_DIM_KEY = E.DATE_YEAR_DIM_KEY
    AND G.CALENDAR_YEAR_NBR = C.CALENDAR_YEAR_NBR
    AND F.DATE_DIM_KEY = E.DATE_YEAR_DIM_KEY
    AND K.PARENT_SRS_ID =n.SRS_ID
    AND N.SCORECARD_ID= :p_scorecard_id
    AND H.USER_ID = :p_user_id
    AND K.SRS_ID BETWEEN :p_start_bu AND :p_end_bu
    --AND P_PARENT_SRS_ID = :p_parent_srsid1
    -- ANd n.Scorecard_id=2
    -- AND H.USER_ID = 7000001
    AND J.TYPE_ID = :p_parent_srsid
    --AND K.SRS_ID = 8
    GROUP BY
    a.PLAN_TO_WIN,
    a.SPQRC,
    l.NAME,
    m.NAME,
    a.metric_id,
    a.NAME,
    a.DESCRIPTION,
    c.DATE_MONTH_DIM_KEY,
    c.CALENDAR_MONTH_NBR,
    c.CALENDAR_YEAR_MONTH_CDE,
    e.SRS_ID,
    e.YEAR_VALUE,
    f.YTD_VALUE,
    g.CALENDAR_YEAR_NBR,
    h.FIRST_NAME || h.LAST_NAME,
    j.TYPE_NAME,
    K.NAME,
    l.PLAN_TO_WIN_ID,
    m.SPQRC_ID,
    N.SCORECARD_ID,
    N.NAME,
    K.LOC_CURRENCY_ID,
    --decode(ltrim(rtrim(k.PARENT_SRS_ID)),' || p_parent_srsid || ', k.NAME) Parent_BU ';
    , decode(ltrim(rtrim(k.PARENT_SRS_ID)),3,''Bill Boggs'') Parent_BU ';
    for x in (select distinct NAME from SRS_DIM where parent_srs_id = p_parent_srsid and rownum < 20 )
    loop
    l_query := l_query ||' , decode(ltrim(rtrim(K.NAME)),''' || x.NAME || ''', D.MONTH_VALUE ) ';
    end loop;
    l_query := l_query ||'order by a.PLAN_TO_WIN';
    -- open p_cur for l_query using p_scorecard_id,p_user_id,p_start_bu,p_end_bu,p_parent_srsid;
    select (length(l_query)/255) + 1 into v_strLength from dual;
    dbms_output.put_line('String Lenghth is :'||v_strLength);
    for c in 1..v_strLength
    loop
    if c = 1 then
    v_temp := SUBSTR(l_query, 1, 255);
    else
    if length(l_query) > (255 * c) then
    v_temp := SUBSTR(l_query, 255 * (c-1) , 255);
    end if;
    end if;
    dbms_output.put_line(v_temp);
    end loop;
    end get_query;
    procedure printQuery(p_scorecard_id in integer,p_user_id in integer,p_start_bu in integer,p_end_bu IN INTEGER,p_parent_srsid in integer) is
    Begin
    get_query(p_scorecard_id,p_user_id,p_start_bu,p_end_bu,p_parent_srsid);
    End printQuery;
    end dyn_query_MBU21;
    I want to split this procedure into 6 procedures to make it look easier.
    1.getSQLSelect
    2.getSQLFrom
    3.getSQLWhere
    4.getSQLGroupBY
    5.getSQLOrderBY
    add another proc...getSQL that returns all the above procs ie,
    I need to build the entire sql & call "Open Cursor" meaning...getSQLSelect||getSQLFrom()...
    How to do this ?
    Thanks in Advance

    You're missing a comma.

  • CALLING STORED PROCEDURE IN DATABASE FROM FORMS4.5

    Is there any body know how to call stored procedure from Forms 4.5 ?
    I am writing a when-button-pressed trigger.
    Put the stored procedure name on there. But
    it said "stored procedure name is not declared on this scope".
    Thanks a lot
    null

    Try logging in to SQL*Plus and running the procedure, e.g....
    SQL> begin
    database_procedure_name(update_web);
    end;
    If it runs OK there, then it should run from within your form (provided that you are logged in as the same user as the test with SQL*Plus.

Maybe you are looking for

  • Problem in fiscal year

    Hi all, When i'm maintain material at company code using omsy transaction code, i unable to maintain the fiscal year of previous period like year and month in those fields and system showing those fields inactive(grey mode). Could you tell me how to

  • JTable display colmun name vertical

    Hi, i have to display a JTable, but the column width is small and the colmun heading has lot of text and so cannot fit , is there a way i can increase the height of the column header and display the text vertically, just like we can do in Exceel shee

  • Add a "change text size" option in Dashcode

    I am building an RSS widget. I want to figure out a way to have a slider, which a user can slide to change the size of the font in the RSS feed. How do I do this?

  • Will launch in Eclipse, won't launch from command prompt

    I've got a project that works in Eclipse, but won't run from the command line prompt. The command line command that I'm using is this... java -cp /users/shared/RainfallSeriesTranslator/bin ui/LauncherThe error I get is this... Exception in thread "ma

  • Certificate Error when downloading Acrobat for Mac

    I am trying to install the trial version of Adobe Acrobat for my Mac (OS X 10.9.5), and I keep getting this error. I was originally getting a different message, but I have since uninstallated Adobe Air and reinstalled. I deleted all downloads, emptie