Use wcf-sql to call procedure

when i use wcf-sql to call store procedure, i got problem:
the store procedure like this:
@variable_1 varchar(300);
@variable_2 varchar(300);
@variable_3 int;
if LEN(@variable_1)<=1
begin
     set @variable_2=0;
end
else
    set @variable_2=substring(@variable_1,1,LEN(@variable_1)-1); 
    set @variable_3= checksum(@variable_2);
when the input parameter @variable_1 is empty value, it will raise two error: 1: invalid length parameter passed to the SUBSTRING function. 2: function "checksum" request at least 1 argument(s).
 it's so strange! how can i avoid this issue?

Hi Jacky,
Substring function can have length as positive integer only.
SUBSTRING ( expression ,start , length )
Length is a positive integer or bigint expression that specifies how many characters of the
expression will be returned. If
length is negative, an error is generated and the statement is terminated. If the sum of
start and
length is greater than the number of characters in
expression, the whole value expression beginning at
start is returned.
Error (invalid length parameter passed to the SUBSTRING function) is result of this.
i.e. when variable_1 = 0, length will return a negative integer.
Error (function "checksum" request at least 1 argument(s)) is because the variable_2 is not assigned any value due to Error 1.
Rachit
       thanks Rachit, but if @variable_1 is empty value,it should not execute
"else" part. this is my question. how can it happen?

Similar Messages

  • Polling records from mulitiple table(61 Tables) using WCF-SQL adapter

    Hi,
    I would like get some suggestion from this forum. I've a scenario, in which I need to poll the records from multiple table(61) which are related and may have one to many relationship. what's the best way to poll the records from SQL table to BizTalk.
    Thanks in advance..
    Regards,
    Karthick

    Karthick,
    Write a SQL stored procedure with joins from your 61 tables (!!!) . Use WCF-SQL adapter to invoke the procedures.
    Following references shall help you:
    Executing Stored Procedures in SQL Server by Using BizTalk Server
    Performing Composite Operations on SQL Server by Using BizTalk Server
    Bing-Results: biztalk wcf sql
    adapter polling stored procedure
    I don’t know your exact requirement. Consider using SQL-SSIS for ETL process depending on your requirements. Anyway if your requirement really needs BizTalk, above suggest
    should solve your problem.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Polling using WCF SQL Adapter

    Hi - I have to develop this in BizTalk
    There is a table in SQL database where BizTalk needs to poll the data using WCF SQL Adapter.
    How and what query/stored proc do I need to write ?
    and how about polling interval should I mention.
    Is there any detailed blog or link which clearly explains this, will be helpful
    MBH

    The first thing that you should remember is that the most effective way of getting data from SQL would be if you could remove the records after reading them. This was something that the native SQL Server adapter supported. For WCF-SQL, the way to achieve
    this is to
    Create a SP which is what you will specify as the execute statement for your adapter. This SP would, on the basis of TOP 1, get the ID, read the record and delete it. Then it would return the read data. You will generate schemas for this SP and deploy them
    for subscribing to the received messages.
    You will create a query that returns the count of records from the said table which you will use as the polling query. This will ensure that the adapter uses this on the configured interval to see if data exists. If it exists, it would use the execute statement
    (invoking your SP) to get the data.
    There is an option to keep executing the SP while data is available. This ensures that if more than ONE record is inserted into your table, all the records would be picked up after the first polling interval (as opposed to poll, pick-up one, poll and then
    pick up the other, etc.). Be careful while setting the polling interval (you cannot go beyond 1 sec) since this depends on your SQL servers ability to process the data.
    With regards to documentation, I'd refer you to
    http://msdn.microsoft.com/en-us/library/dd788532.aspx - Polling SQL Server by using the WCF-SQL Adapter.
    Regards.

  • Error while calling java using pl/sql

    hi..
    i would like to load and call simple java into oracle database. this is my simple java code.
    public class SimpleJava {
    public void main(String[] args) {
    System.out.println("Here we are");
    then, i created .class file and ready to be loaded into oracle database using loadjava utility. i already loaded it successfully into a database. but, when i use pl/sql to call it in SQl*Plus, i got this error.... can anyone help me to solve this problem?
    SQL> create or replace procedure call_simplejava
    2 as language java
    3 name 'SimpleJava.showMessage()';
    4 /
    Procedure created.
    SQL> set serveroutput on;
    SQL> call dbms_java.set_output(50);
    Call completed.
    SQL> execute call_simplejava;
    java.lang.NoSuchMethodException: No applicable method found
    at
    oracle.aurora.util.JRIExtensions.getMaximallySpecificMethod(JRIExtensions.java:4
    33)
    at
    oracle.aurora.util.JRIExtensions.getMaximallySpecificMethod(JRIExtensions.java:4
    75)
    BEGIN call_simplejava; END;
    ERROR at line 1:
    ORA-29531: no method showMessage in class SimpleJava
    ORA-06512: at "GISDB.CALL_SIMPLEJAVA", line 1
    ORA-06512: at line 1

    Hi,
    public class SimpleJava {
    public void main(String[] args) {
    System.out.println("Here we are");
    then, i created .class file and ready to be loaded into oracle database using loadjava utility. i already loaded it successfully into a database. but, when i use pl/sql to call it in SQl*Plus, i got this error.... can anyone help me to solve this problem?Did you run the SimpleJava in your ED or on command prompt??
    I created the same class file but when I said
    java SimpleJava
    It threw the following error
    java.lang.NoSuchMethodException: No applicable method found
    So modify your code
    as
    public class SimpleJava {
       public static void main(String[] args) {
            System.out.println("Here we are");
       }Twinkle

  • Run Authorware using an SQL stored procedure

    I have an Authorware piece that reads a text file, performs
    some calculations, generates a .bmp , writes an output text file,
    and then closes. I would like to trigger this using an SQL Server
    stored procedure. The piece works fine if it is run directly, but
    the stored procedure does not run the Authorware program (though I
    can run a variety of other applications using similar stored
    procedures). Is it possible to call and run Authorware pieces from
    other applications?
    Thanks,
    David

    If I were to make a bet, I would say the issue is related to ODBC. Can you get access to you database using ADO directly? This removes two pieces: the ODBC drivers and the SQL Toolbox.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • SOA DB Adapter - Calling procedure returning PL/SQL types

    Hi All,
    We have a Scenario where we are calling a Procedure from a SOA Composite using normal DB Adapter 'Call Procedure'.
    This procedure is simply querying data from DB and returning a Oracle DB Object.
    Since, the procedure returns a PL/SQL type which cannot be handled directly in SOA. So SOA creates a Wrapper Procedure on top of it.
    This wrapper procedure is basically used to convert, during procedure calls, PL/SQL types to SQL and vice-versa.
    The above said is a standard functionality provided by Oracle.
    Now:
    We are facing a peculiar issue while calling the procedure. Many of the Procedure calls return the expected result many are failing due to error - 'NO DATA FOUND'.
    Out of 100 calls, 34 failed. All the 100 calls have same input, implies that we should expect the same output.
    We also confirmed that there were no other changes done in DB at that time.
    We generated the DB trace and found that for the failed calls we don't get anything in trace.
    That implies the call doesn't even reaches the DB.
    We tried shutting down and starting back our Weblogic datasource. Issue got resolved, all calls start executing successfully!!!
    But again after executing 1000-2000 calls, we again face the same issue. Calls with same input start failing with - 'NO DATA FOUND'.
    We certainly know that its an issue with caching on Weblogic level. But not yet able to prove it.
    We suspect that this caching is done at JDBC level in JPublisher component... Not Sure!!!
    We have done enough RnD to rule out anything on DB or SOA side. Its on Weblogic.
    Anybody out there has any idea on how this Weblogic caching is done and how we can control it?
    --Inder                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Are you in a clustered environment and using coherence?
    You can try to clear cache as mentioned below
    soa_server1->System MBean Browser->Application Defined MBeans->oracle.mds.lcm->Server: soa_server1->Application: soa-infra->MDSAppRuntime->MDSAppRuntime->Operations tab->clearCache
    You may also find this article useful
    http://www.oracle.com/technetwork/articles/soa/data-tier-caching-for-soa-101753.html
    Edited by: user5433411 on Apr 25, 2013 3:37 AM

  • Calling owb workflow job created in oem using pl/sql

    is it possible using pl/sql to call owb workflow job which is created thru oem
    can you pl be kind enough to share a sample.
    thanks

    Hi,
    The same question was just answered by another member a couple a days ago want to run owb mappings thru job schedule :
    sqlplus_exec_template runtime_owner location_name PROCESS process_name "," ","
    sqlplus_exec_template is in "D:\oracle\oraWB\owb\rtp\sql"
    Nikolai Rochnik

  • Using native sql for update

    Hello ,
    I have a reqaust to update a db table declared "outside" our R3 db.
    I mennage to select the data using native sql with a connection to the db.
    Now i need to modify the data on the db.
    Is there a similliar command like "fetch next" ' for update?
    Mybe i need to build a procedure in th "host" db and use its own commands to update?
    Thanks,
    koby

    Hello Kobi,
    Which release of SAP are you woking on?
    If you're on ECC6.0, instead you using Native SQL to call the stored procs of external DBs you can use the [ADBC APIs |http://help.sap.com/abapdocu_702/en/abenadbc_procedure.htm](CL_SQL* classes).
    BR,
    Suhas

  • Executing stored function using Native SQL

    In SAP documentation, I can see how to execute an Oracle stored procedure in an external database using:
    EXEC SQL.
      EXECUTE PROCEDURE procname
    ENDEXEC.
    I want to execute a stored FUNCTION within a package.  I have tried executing it using the syntax for PROCEDURE above and get a "ORA-06550 wrong type or number of arguments" error.  Since the function has one argument in and one argument out, I think I am counting the number of arguments correctly.  Has anyone executed from within ABAP an Oracle function stored in an external database?
    Thanks
    Janice Ishee

    Janice - from help.sap.com:
    Stored Procedures
    The command EXECUTE PROCEDURE proc allows you to call a procedure stored in the database. When you call it, you can pass a list of host variables as parameters. When yuo call a procedure, you must specify for each parameter whether it is an input parameter ( IN), output parameter (OUT) or changing parameter (INOUT).
    Example
    Calling a Procedure:
    DATA Y TYPE I VALUE 300.
    DATA Z TYPE I.
    EXEC SQL.
    INSERT INTO AVERI_CLNT (CLIENT, ARG1, ARG2, ARG3)
    VALUES ('000', 9, 2, 47)
    ENDEXEC.
    EXEC SQL.
    CREATE OR REPLACE PROCEDURE PROC1 (X IN NUMBER) IS
    BEGIN
    UPDATE AVERI_CLNT SET ARG3 = ARG3 + X;
    END;
    ENDEXEC.
    EXEC SQL.
    CREATE OR REPLACE PROCEDURE PROC2 (X IN NUMBER, Y OUT NUMBER) IS
    BEGIN
    SELECT ARG3 INTO Y
    FROM AVERI_CLNT
    WHERE CLIENT = '000' AND ARG1 = 9 AND ARG2 = 2;
    UPDATE AVERI_CLNT SET ARG3 = ARG3 - X;
    END;
    ENDEXEC.
    EXEC SQL.
    EXECUTE PROCEDURE PROC1 ( IN :Y )
    ENDEXEC.
    EXEC SQL.
    EXECUTE PROCEDURE PROC2 ( IN :Y, OUT :Z )
    ENDEXEC.
    IF SY-SUBRC <> 0 OR Z <> 347.
    WRITE: / 'Wrong result for EXECUTE PROCEDURE:', Z.
    ENDIF.
    EXEC SQL.
    DROP PROCEDURE PROC1
    ENDEXEC.
    EXEC SQL.
    DROP PROCEDURE PROC2
    ENDEXEC.
    Rob

  • WCF-SQL and XML EXPLICIT How to generate a schema from add Generated Items...

    Hi
    I have a stored procedure in which it returns a select that I have configured using FOR XML EXPLICIT. The query returns in a single column the exact XML that I require.
    However, When I add generated items (outbound) in Visual Studio against the SP it only gives me a single element which is the column name (a guid) not the structure of the xml. I have tried FOR XML EXPLICIT, XMLDATA with no luck
    Surely there is a way to generate the schema within biztalk for a custom XML structure I want to create.
    Thanks
    Biztalk Developer

    Yes, it is generating you un typed message for the stored procedure . As you are using WCF SQL adapter you don't need to specify the XML auto clause inside your Stored Procedure .
    You can also take referece from  below MSDN blog
    http://blogs.msdn.com/b/biztalkmusings/archive/2009/10/05/a-simple-biztalk-server-2009-wcf-sqlserver-adapter-example.aspx
    Thanks
    Abhishek

  • How do you configure a WCF-SQL adapter to write data from a SQL2012 "always on" database?

    Hi All,
    I have a BizTalk environment. I have to write the data from BizTalk to the database which is configured using ALWAYS ON availability group.
    I use WCF-SQL adapter to write the data. My question is this setup a supported?

    The answer is NO.
    Refer: Can
    I use a BizTalk WCF-SQL send adapter with a SQL 2012 Always on Database?
    A snippet quoted below.
    In summary (in order of preference):
    Disable AlwaysOn Availability Groups / Mirroring on SQL server if you need to connect to this SQL server which has this enabled
    Disable transactions and implement logic to be able to handle duplicates .
    Disable transactions and handle the duplicates or lost messages with custom logic (e.g. Send twice and compare and implement error handling). You need to write your own DTC handling this which
    is probably very complicated.
    Disable transactions and live with risk of duplicates or lost messages without handling duplicates.
    Refer: SQL Server AlwaysOn feature does not support MSDTC transactions.
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • Using temporary tables in stored procedures

    Suppose that I have created a temporary table in a stored procedure using an "EXECUTE IMMEDIATE" statement. When I compile the procedure, that table is not created yet, so the compiler says that the table does not exist.
    What is the way of using temporary tables in stored procedures?

    It's a good practice to avoid using DDL statements being executed from stored procedures. "Truncate Table" via dynamic SQL from stored procedure is a different story and is useful in DSS environments.
    But if you insist on "creating" tables using Dynamic SQL from Stored Procedures then you must also embed your DML statements in Dynamic SQL to avoid compilation errors.
    Example:
    Create or Replace Procedure Proc_TestDynamicSQL is
    Begin
    Execute Immediate 'Create table myTable as select * from user_tables' ;
    Execute Immediate 'Update myTable set table_name = ''Test'' ' ; --two single quotes before and after the string "Test"
    End;
    In this case, Oracle wouldn't care about the table references during compilation.

  • Mainframe data loaded into Oracle tables - Test for low values using PL/SQL

    Mainframe legacy data has been copied straight from the legacy tables into mirrored tables in Oracle. Some columns from the mainframe data had 'low values' in them. These columns were defined on the Oracle tables as varchar2 types. In looking at the data, some of these columns appear to have data that looks like little square boxes, not sure but maybe that is the way Oracle interprets the 'low values' in the original data into varchar. When I run a select to find all rows where this column is not null, it selects these columns. In the results of the select statement, the columns appear to be blank, however, in looking at the data in the column using SQL Developer, I can see the odd 'square boxes'. My guess is that the select statement is detecting that something exists in this column. Long story short, some how I am going to have to test this legacy data on the Oracle table using Pl/Sql to test for 'low values'. Does anyone have any suggestions on how I could do this????? Help! The mainframe data we are loading into these tables is loaded with columns with low values.
    I am using Oracle 11i.
    Thanks
    Edited by: ncsthbell on Nov 2, 2009 8:38 AM

    ncsthbell wrote:
    Mainframe legacy data has been copied straight from the legacy tables into mirrored tables in Oracle. Not a wise thing to do. Mainframe operating systems typically use EBCDIC and Unix and Windows servers use ASCII. The endian is also different (big endian vs little endian).
    Does anyone have any suggestions on how I could do this????? As suggested, use the SQL function called DUMP() to see the actual contents (in hex) of these columns.

  • WCF-SQL Adapter Set up

    Hi,
    I am using Microsoft Biztalk 2010 on Windows Server 2007(SP2). I am want to use WCF-SQL adapter but I am not able to see any adapter when I tried to create new adapter at "Platform Setting -> Adapter -> New Adapter dropdown.".
    Windows Communication Foundation LOB Adapter SDK, Microsoft Biztalk Adapter Pack, Microsoft Biztalk Adapter Pack(x64) are installed on my machine.
    Am I missing something? how to get the WCF-SQL in the list of adapter.
    Thanks, Girish R. Patil.

    Hi Girish,
    Another area to check is machine.config file for binding entries.
    check following for hint  :   http://tech-findings.blogspot.in/2013/06/no-valid-adapters-installed-on-machine.html
    Maheshkumar S Tiwari|User Page|Blog|BizTalk
    Server : How Map Works on Port Level

  • WCF-SQL issue

    Hi All,
    I have two Biztalk applications A & B, where I am using wcf-sql in both of them.
    In A it's working fine , But in B it's giving the following error when I start recieve location.
    WCF-SQL
    System.InvalidOperationException: TransactedBatchingBehavior validation failed. The service endpoint cannot be started. TransactedBatchingBehavior requires a binding that contains a binding element ITransactedBindingElement that returns true for ITransactedBindingElement.TransactedReceiveEnabled.
    If you are using NetMsmqBinding or MsmqIntegrationBinding make sure that ExactlyOnce is set to true. at System.ServiceModel.Description.TransactedBatchingBehavior.System.ServiceModel.Description.IEndpointBehavior.Validate(ServiceEndpoint serviceEndpoint) at
    System.ServiceModel.Description.ServiceEndpoint.Validate(Boolean runOperationValidators, Boolean isForService) at System.ServiceModel.Description.DispatcherBuilder.ValidateDescription(ServiceDescription description, ServiceHostBase serviceHost) at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription
    description, ServiceHostBase serviceHost) at System.ServiceModel.ServiceHostBase.InitializeRuntime() at Microsoft.BizTalk.Adapter.Wcf.Runtime.BtsServiceHostBase.InitializeRuntime() at System.ServiceModel.ServiceHostBase.OnBeginOpen() at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan
    timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfReceiveEndpoint.Enable() at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfReceiveEndpoint..ctor(BizTalkEndpointContext endpointContext,
    IBTTransportProxy transportProxy, ControlledTermination control) at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfReceiver`2.AddReceiveEndpoint(String url, IPropertyBag adapterConfig, IPropertyBag bizTalkConfig)
    Please let me know your suggestions,
    Thanks in Advance.

    Hi,
    Similiar issue is discussed here
    http://social.msdn.microsoft.com/Forums/en-US/6da21689-4aaa-426f-a1c9-ae08e0e1f698/message-order-and-wcfcustom-transport-properties-dialog-box?forum=biztalkr2adapters
    Thanks,
    Deepthi

Maybe you are looking for

  • How to restrist access for a  message type

    how do we  insert A-HQ, HS-Z , 0-9 in the Message type (EDI_MES) for the auth object S_IDOCMONI, here we are just excluding all the values that start with HR. This will not give the users access to HR messages

  • Error regarding Number ranges in MIRO

    Guys   Iam getting the following error while am assigning MIRO can u please suggest me a solution for getting rid of this error In FBN1 am trying assign 51 for my company but it says tat the number overlapps....what shall i do for the following probl

  • BAPI or FM for F-03

    Hi, Does anyone know BAPI or FM for transaction F-03. I have tried POSTING_INTERFACE_CLEARING and BAPI_ACC_DOCUMENT_POST but these doesn't suits my requirement. Looking for help on this. Thanks in advance! Best Regards, Akanksha.

  • When am trying to download acrobot standard its prompting with user login password and its not getting downloaded.

    Hi When am trying to download acrobot standard its prompting with user login password and its not getting downloaded.

  • Flex apps not working in IE6...sometimes

    I have a strange problem that is causing me to go bald.. When I create an application in Flex and run it, IE pops up and I get the message: "Alternate HTML content should be placed here. This content requires the Adobe Flash Player. Get Flash " Flash