Wrapping c# assembly in  pl sql and calling it as function

hi guys i trust you are ok, i am working on a where i have oracle as a database i wanted to load a strored procedure which is a c # assembly but im getting error when i call the function see the code below.
namespace testdll
public static class test
public static string show(string x)
return " Hi "+x+" ,i am a dll from c sharp";
THE ABOVE CODE IS FROM C SHARP WHICH I WILL CONVERT IT TO AN ASSEMBLY
============================================================
CREATE OR REPLACE LIBRARY testdll2 AS
'D:\oraclexe\app\oracle\product\10.2.0\server\BIN\testdll.dll';
THIS CODE IS FOR CREATING A LIBRARY IN ORACLE
=============================================================
set serveroutput on;
create or replace function rundll_func
(cmd in varchar2)
return varchar2
as
language c
library testdll2
name "testdll.test.show"
parameters(cmd string, RETURN STRING)
THIS IS WRAPPER FUNCTION WHICH USES THE LIBRARY CREATED ABOVE
====================================================
set serveroutput on;
CREATE OR REPLACE PROCEDURE calldll
IS
i varchar2(200);
BEGIN
i:= rundll_func();
DBMS_OUTPUT.PUT_LINE (i);
END calldll;
THIS CODE IS A PROCEDURE THAT CALLS THE FUNCTION ABOVE WHICH HAS THE LIBRARY
EXE CALLDLL - when i typre this i get the error
===================================
plsql error mapping function
unable to load symbol from dll
pls help me could the problem be the way i have wrapped my function thank you

user12086108 wrote:
how do i wrapp a c# sharp functionI'm not aware of any support for C# in PL/SQL.
There is support in PL/SQL for java. Is there a way you could do something Java, wrapping the Java in PL/SQL?
Alternately, could you do something with a host call from DBMS_SCHEDULER?

Similar Messages

  • JSPs and calling a DB function/procedure

    I looked at an example written by Oracle and I saw that they put in the <form> tag (in a JSP) an "action" that is really a name of a DB procedure. It was in the form of:
    schemaName.packageName.procedureName
    First: I've tried to do that myself -- just create simple HTML page, have an <input> with the "type" of "text", and in the <form>'s action put the procedure's full 'path' name. Did not work. Am I missing anything? What's the right way to do it?
    What I see in the browser's URL is:
    "http://serverName:portNum/.../pls/portal30/PORTAL30.MYPACKAGE.MYPROCEDURE?" But I see an empty page.
    Second: looking at the actual procedure body of the example, I saw that the procedure's parameters are given the same exact name as the names of the <input>'s in the JSP page. Like:
    <input type="text" name="txtFirstName">
    and in the procedure:
    someProcedureName(txtFirstName integer)
    Is that the way to pass parameters to a DB procedure? (by using the same name)
    Third: Can I call a DB function from a JSP's <form>'s "action" and get the return value somehow? Meaning, I want to know whether the function's operation was successful and no exceptions were thrown. And if there were some exceptions thrown, I want to let the user know somehow.... How?
    A lot of questions, I know, but I still gotta know... :-)
    Thanks!
    Dan

    Dan,
    Sorry for the late answer, hope it's not too late yet.
    1) If you make your DB procudures accessible from a plain browser, you can obviously define that URL as an html form action. Make sure that your procedures are accessible when typing in the URL in your browser. You need to check whether you have privileges to access the procedure, and the DAD settings too.How do I make my DB procedures accessible from a plain browser?
    Is just making a "GRANT" to that procedure to that user enough? And what do I need to do with the DAD?
    Is the "?" question mark in your URL, or has it been added by the forum only? You don't need it as long as you don't want to pass parameters.Question mark was added by the browser..
    3) I'd probably do it through passing the error code to the JSP as a parameter. You find information about reading parameters in the PDK. Yes, but how do I pass it BACK to the browser? I do know how to pass parameters to a "regular" JSP (one that has nothing to do with the portal). But this one involves the DB -- how do I tell my DB function to send an "answer" back to the browser? It would send the function's return value straight to the browser because the browser was the thing that called it in the first place?
    Dan

  • Read item from Java class and call to stored function/procedure of database

    Hi,
    I am looking solution that I was trying to find becasue of I am not expert and novice of ADF so I am getting problem to do. I am trying migrating from oracle forms to JDeveloper[ADF].
    I want to call database stored function from JSF pages by java bean class of a button press event (manually created) and after button event I have called java class which I created manually. But I can not read that values what I given into jsp page.
    question1: How can I read jsp pages items value to java class ?
    question2: How can I call to database stored function/procedure with that parameter?
    question3: How can I use return value of that stored function/procedure ?
    Please reply me .
    Thanks,
    zakir
    ===
    Edited by: Zakir Hossain on Mar 29, 2009 10:22 AM

    ---

  • IPhone 4 vibration, wifi, and calling will not function correctly?

    I have had my iPhone 4 for 6 months now, and I have dropped it a couple of times, but a few days after I dropped it nothing happened. My first problem started in May when I noticed that my phone could not reach the wifi at home or other places quickly as it normally could and when I would go into other rooms I would lose the connection quickly.This made me have to use my 3g more often and I only have a limit of 300MB, I normally do not use it, because of the wifi i have around,but it is getting harder. 2-3 days ago I called the DATA (*3282#) in my phone and got 64.89 out of 300MB. I later used my 3G for awhile, so a day later i called DATA and the same number (64.89 out of 300MB) comes on again. I knew this was a mistake so I called it again and the same number shows up. I KNOW FOR SURE I USED MY 3G, so I dont know why this keeps popping up. Everything else channged (texting and calling) On top of that my vibration started to not work in early June and it's difficult for me to know when someone has texted or called. I have tried going into settings and choosing a different type of vibration, but it does not vibrate overall and yes it is turned on. My version right now is 6.1. Will upgrading help? Everything else works fine, but is there a way I can fix this or do I have to go the Apple Store? I'm also in AT&T.

    For the data usage,
    I have AT&T as well and I found that the Data usage only updates about once a day even though texting updated instantly.
    As for the vibration,
    The vibration motor thing may be broken.
    But I am not sure.

  • Why SQL and CALL SECTION are mutually exclusive in App Engine

    Please give some other reason than deadlocking, as I already know about this.....and if this is the reason, please confirm it....

    A step is the smallest transaction which can be committed in application engine. In a step if you have call section then a new transaction starts which leads to problems in committing the previous transaction if you want to commit step by step hence Call Section and SQL should not be there in same step.
    In small application engine will have problems in step by step commit if we have Call Section and SQL in same step.
    Jayaprakash Tedla
    Sr. Architect - PeopleSoft

  • Dynamic SQL and use of aggregate functions

    Hello Forum members,
    I'm trying to create dynamic SQL in a function module and return the MAX value of a field. 
    I am passing in a parameter called CREATE_FIELD_NAME, and my SQL is
    SELECT MAX(CREATE_FIELD_NAME) INTO (CREATE_DATE) FROM (TABLE_NAME).
    I also tried:
    SELECT MAX((CREATE_FIELD_NAME)) INTO (CREATE_DATE) FROM (TABLE_NAME).
    But abap is not recognizing my variable as a variable in either case, but rather, as a field name.
    Anyone know a way around this?
    Thanks in advance,
    Jeff
    Here is my program:
    FUNCTION ZJLSTEST4.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(TABLE_NAME) LIKE  MAKT-MAKTX
    *"     VALUE(CREATE_FIELD_NAME) LIKE  MAKT-MAKTX
    *"     VALUE(UPDATE_FIELD_NAME) LIKE  MAKT-MAKTX
    *"  EXPORTING
    *"     VALUE(MAX_DATE) LIKE  SY-DATUM
    DATA: CREATE_DATE LIKE MCHA-ERSDA VALUE '19000101',
          UPDATE_DATE LIKE MCHA-LAEDA VALUE '19000101'.
    SELECT MAX(CREATE_FIELD_NAME) INTO (CREATE_DATE) FROM (TABLE_NAME).
    ENDSELECT.
    *SELECT MAX((UPDATE_FIELD_NAME)) INTO (UPDATE_DATE) FROM (TABLE_NAME).
    *ENDSELECT.
    IF CREATE_DATE > UPDATE_DATE.
       MAX_DATE = CREATE_DATE.
    ELSE.
       MAX_DATE = UPDATE_DATE.
    ENDIF.
    IF MAX_DATE = '19000101'.
    MAX_DATE = SY-DATUM.
    ENDIF.
    ENDFUNCTION.

    Max is right, you need the spaces, as in my example.
    You might like to try this:
    data: l_CREATE_FIELD_NAME) LIKE MAKT-MAKTX,
          l_UPDATE_FIELD_NAME) LIKE MAKT-MAKTX.
    DATA: CREATE_DATE LIKE MCHA-ERSDA VALUE '19000101',
    UPDATE_DATE LIKE MCHA-LAEDA VALUE '19000101'.
    concatenate 'MAX(' create_name ')' into l_create_name separated by space.
    concatenate 'MAX(' update_name ')' into l_update_name separated by space.
    SELECT SINGLE (l_CREATE_FIELD_NAME)
    INTO CREATE_DATE FROM (table_name).
    SELECT SINGLE (l_updATE_FIELD_NAME)
    INTO updATE_DATE FROM (table_name).
    IF CREATE_DATE > UPDATE_DATE.
    MAX_DATE = CREATE_DATE.
    ELSE.
    MAX_DATE = UPDATE_DATE.
    ENDIF.
    IF MAX_DATE = '19000101'.
    MAX_DATE = SY-DATUM.
    ENDIF.
    If it still fails please post the latest abap code for us to check.

  • How to execute PL/SQL and branch in APEX 3.0

    I have written an APEX app with the following pages:
    1 - Main page with a "start" button that navigates to page 2
    2 - Page with a Branch "Branch to function returning a page", which has PL/SQL that returns '3' if successful or '4' if there is an error
    3 - Page with HTML to display "Success"
    4 - Page with HTML to display "Error"
    I wrote this as a very simple test to verify how to implement a button to execute a block of PL/SQL and then go to a results page. So, there is almost nothing to it right now - just the four pages described and a small PL/SQL block that actually will always fail because it SELECTs from a table that does not yet exist. The problem is that when I click the button it goes to page 2 properly (the page displays) but I can't tell if the PL/SQL is executed and it does not leave that page. What am I doing wrong? Any help would REALLY be appreciated!

    That's somewhat more complicated. If you create a Page Process (your 'long running process') that fires On Load - After Footer you won't see anything until it's finished.
    So you need an AJAX function to kick off an Application Process and call this AJAX function in the OnLoad of the BODY... And yes, you can show a progress bar or something similar then by checking if your AJAX function is finished yet.
    If you want to go that way you can search this forum on "AJAX ONLOAD" or something similar (or start a new thread).
    Cheers
    Roel

  • Integration of PL/SQL and JSP (Java Server Pages)

    I need to match a web application developed with PL/SQL with another developed in JSP (Java Server Pages) the problem is that the two apps interact with the same databese, an share de same users, I need to know how to get the user and password loged into pl/sql when the user want to use same of de .jsp pages running on another application server?

    Hi Michael Vstling,
    Did you try the java classes library (SDOAPI) that can be downloaded from OTN?
    It may provide you with a better alternative when manipulating geometries in the Java space. There is an adapter in SDOAPI which can convert a JDBC STRUCT object into Java Geometry object defined in SDOAPI, and vice versa.
    There are at least two ways in mixing PL/SQL and Java. The first one, as you mentioned, is to define your custom function in terms of PL/SQL and call it from within your Java program. With SDOAPI, you have the second option, which is to define your own functions in Java using SDOAPI and deploy them as Java stored procedures in db. You can then call them from within your PL/SQL code. In either way performance depends on a lot of things and generally it requires a "try and improve" approach.
    About JPublisher and sdo_ordinate_array it may not be a spatial related problem. Did you try search the Java-related forums first?
    LJ

  • Calling SQL Stored procedure from PLSQL function

    Hi,
    I have created a simple function to return a value that is pulled back from SQL server.
    FUNCTION
    FUNCTION CALC_PASS_FAIL
    i_lidded_sn IN TMP_CHIP_ATTR.LIDDED_SN%TYPE
    RETURN NUMBER
    IS
    tmp_result NUMBER;
    BEGIN
    [email protected](i_lidded_sn,'OadmBarActive',tmp_result);
    RETURN tmp_result;
    END CALC_PASS_FAIL;
    OUTPUT
    --When executed as a procedure, i get the required output:
    DECLARE
    x INT;
    BEGIN
    x:=EQDAS_MISC.CALC_PASS_FAIL('OADM004548');
    dbms_output.put_line(x);
    END;
    0 <------ expected output
    PL/SQL procedure successfully completed.
    When executed as a simple function call, i don't get any output:
    SELECT CALC_PASS_FAIL ('OADM004505') FROM dual;
    Any input will be greately appretiated.
    Thanks,
    Shashi
    PS: I am using the DB Link setup usign DG4MSQL

    just wondering it works as procedure as the function misses double quotes:
    dbo.GetChipPareto
    should be
    "dbo"."GetChipPareto"
    Message was edited by:
    kgronau
    Tested a small example using a function like:
    create or replace function test(
    v_ut1 in varchar2)
    RETURN varchar2
    IS
    v_ut2 varchar2(255);
    BEGIN
    "dbo".OTG_TEST3@dg4msql( v_ut1, v_ut2);
    RETURN v_ut2;
    END test;
    The function calls a SQL Server procedure OTG_TEST3 just returning the passed string and it guarantees data integrity.
    Result using a stored procedure:
    SQL> DECLARE
    2 ret integer;
    3 v_ut1 varchar2(255);
    4 v_ut2 varchar2(255);
    5 BEGIN
    6 v_ut1 :='Hello World';
    7 v_ut2 :='';
    8 "dbo".OTG_TEST3@dg4msql( v_ut1, v_ut2);
    9 dbms_output.put_line('Input value: ' ||v_ut1||' - Output value: '
    ||v_ut2);
    10 END;
    11
    12 /
    Input value: Hello World - Output value: Hello World
    And calling now the function:
    select test('Hello') from dual;
    returns Hello

  • Can we call a php function into coldfusion coding?????????

    can we call a php function into coldfusion??
    if anybody knows that let me know....

    Nope, as IIS can only pass one page to one handler, so it gets passed to ColdFusion *or* PHP. The only way it would work is to have a page with an iFrame containing a PHP page, but that's not calling a PHP function from ColdFusion.
    Dare I ask what it is you're trying to achieve exactly? If it's an extremely complicated function that can't possibly be rewritten, you'd probably want to wrap it up in a webservice and call it from CF.

  • Catalogue of SQL and PL/SQL bad practices: Call for participation

    I started compiling a list of Oracle SQL and PL/SQL bad practices, with the intention of producing a comprehensive catalogue of common and recurring programming mistakes, that can be used as a check-list for code reviews or given to junior developers. I have identified about 30 bad practices so far. For each bad practice, I provided a list of symptoms in the code, an explanation why it causes problems and a list of preferred solutions.
    My goal with this list is primarily to start a discussion about similar recurring issues that other people have noticed. That discussion should lead to a more complete list which the community will then be able to use, hopefully, to learn something from the mistakes of others and to produce better code.
    I would really appreciate your feedback - if you are interested in discussing these practices we can either do it in this forum, or start a separate mailing list.
    You can download the first version of the catalogue in PDF form from http://gojko.net/effective-oracle
    gojko adzic
    http://gojko.net

    exception handler (already covered), the philosophy
    behind not using stored procedures, and having beenHi riedelme,
    I'm not advocating not using stored procedures, but I am advocating not using exclusively stored procedures. I've seen that approach often, typically with people coming from SQL server or Oracle forms backgrounds, I never could understand the reasons behind it. Even for a simple select or update, they would write a stored proc that wraps the call and then require the client to execute a stored proc.
    I think that views are much better for getting the data out of the database in general, and forcing people to use stored procedures with ref output cursors makes little sense. If the only possible interface is a stored proc, then one proc must be created for every required combination of data and every required filtering or grouping method, so there is much much more code in the database, and more code means harder maintenance.
    If client apps can get data out using views, then they can join them with other views, filter or group the data as they require, which means that there is a lot less code in the database to maintain.
    My other problem with stored-proc only approach is when people wrap simple insert/update/delete commands into a stored proc. Again, I'm not advocating using complex instead-of triggers to implement workflows and forcing people to use views, but I simply don't see any benefit of implementing a stored proc to do a simple update. I see a bad side of it because a stored proc needs to be implemented for every combination of columns that a client may need to update and every criteria that can be used for that. If a client is allowed to update a view, there is much less code in the database.
    Views are, in my experience, also a lot easier to maintain and optimise without downtime because they can be revalidated without causing any problems to currently connected clients, where revalidated stored procedure or package will throw an exception the first time a connected client that had called it before calls it again.
    If I'm missing something, please tell me. I'd really love to understand why someone would build a client API exclusively from stored procedures.
    So far, I've been given explanations that it is for security purposes, or for performance. I don't know of any security restriction that can be implemented on a stored procedure or package that cannot be implemented with a view, and if bound variables and statement caching is used, sql statements don't suffer from sql injection and support pre-compilation.
    Again, i'm not advocating throwing stored procs completely out, i'm against using them exclusively and throwing out any chance of SQL access.
    gojko adzic
    http://gojko.net

  • How to store pl/sql statement in varchar and call EXEC on it?

    So this statement works:
    SELECT column_name BULK COLLECT INTO table_column_list FROM all_tab_columns WHERE table_name = conv_tablename AND OWNER IN (SELECT USER FROM DUAL);
    However I want to add conditions like " AND column_name <> 'abc' " at the end. So i tried to store this in a varchar and call EXEC on it:
    select_column_value_sql_stmt := 'SELECT column_name BULK COLLECT INTO table_column_list FROM user_tab_columns WHERE table_name = '''|| conv_tablename || '''' || inexclude_column;
              EXECUTE IMMEDIATE select_column_value_sql_stmt;     
    No matter how I concatenate the conv_tablename part, i get an error. either invalid identifier or unimplemented feature.
    so is there a way to do this at all?
    Thanks in advance.

    Welcome to the forum!
    Wheneve you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    >
    So this statement works:
    SELECT column_name BULK COLLECT INTO table_column_list FROM all_tab_columns WHERE table_name = conv_tablename AND OWNER IN (SELECT USER FROM DUAL);
    However I want to add conditions like " AND column_name 'abc' " at the end. So i tried to store this in a varchar and call EXEC on it:
    select_column_value_sql_stmt := 'SELECT column_name BULK COLLECT INTO table_column_list FROM user_tab_columns WHERE table_name = '''|| conv_tablename || '''' || inexclude_column;
    EXECUTE IMMEDIATE select_column_value_sql_stmt;
    No matter how I concatenate the conv_tablename part, i get an error. either invalid identifier or unimplemented feature.
    so is there a way to do this at all?
    >
    Yes - you can do it but the syntax is different for BULK COLLECT when using EXECUTE IMMEDIATE; the INTO goes AFTER the query, not within it.
    See the example code at this link
    http://unix-oracle-11g.blogspot.com/2011/03/dynamic-sql-execute-immediate-bulk.html
      -- example of dynamic sql with bull collect
      v_sql_stmt := 'SELECT sal FROM emp_t';
      EXECUTE IMMEDIATE v_sql_stmt BULK COLLECT INTO vc_sal;So you won't be able to use a common set of queries for normal vs execute immediate.

  • PL/SQL and Java implementation

    Hi all,
    We need to implement a fast solution for reporting to our existing web application. Application is totally based on stored procedures written in PL/SQL.
    We have already java classes for drawing different types of charts
    named Chartdirector (http://www.advsofteng.com/)
    This library can create chart images in memory.
    I have already read about calling java classes from PL/SQL and SQLJ too.
    My questions are;
    1. Is this safe to include classes to database and create
    reports by using loadjava in real life. I mean not in theory, in real life?
    2. Is there any experiments of the audience about this method?
    3. Would it be any performance problems about this?
    4. Should i prefer to use any Java container and jsps instead of this method?
    I will continue to research for necessary steps after i could see the light :)
    Thank you to all,
    Regards,
    Gokhan

    > 1. Is this safe to include classes to database and create
    reports by using loadjava in real life. I mean not in theory, in real life?
    Yes.
    > 2. Is there any experiments of the audience about this method?
    Experiments and actual implementation - yes. It works. Granted, it does not always work as easy as running the Java code from the command line. But it does work.
    > 3. Would it be any performance problems about this?
    This is a potential problem with any software code.
    4. Should i prefer to use any Java container and jsps instead of this method?
    To be honest, I prefer not using Java for web graphics as I'm not impressed with the quality and flexibility of the graphs generated. I prefer using (and paying for commercial use) for the JPGraph classes for PHP - and using that from PL/SQL (via Zend Core for Oracle).
    Another option is to use SVG and generated SVG directly from PL/SQL. But this requires a browser plugin and SVG also does not look that great. (this is btw what Oracle's HTMLDB does and uses)

  • PL/SQL? Call it P/K!

    What I want to say for PL/SQL is thus:
    1) Functions or procedure of PL/SQL with many parameters are bullshit. Parameter count of normal function should be less than eight.
    2) Performance of PL/SQL is said a little better than simple SQL statement of JDBC, but its difficulty of debug is much worse. I don't like blackbox modules.
    3) I have seen hundreds of "?" as following in a project of some enterprise's import/export management system.
    * Update Exec
    * @param edits DomainWrap
    * @exception IPOException
    public void updateExec( DomainWrap edits ) throws IPOException{
    Connection con = null;
    OracleCallableStatement cstmt = null;
    try {
    con = getConnection();
    String stmt_str = "{? = call PK_M0902_W.F_M0902(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) }";
    if( ((SM0900_App)getAppContext()).isHandlingOldCompanyCode()) {
    stmt_str = "{? = call PK_M0902_W.F_M0902(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) }";
    log.info("CallableStatement:" + stmtstr );
    if( !((SM0900_App)getAppContext()).isHandlingOldCompanyCode()) {
    log.info("COMPANYCD = "+getAppContext().getCompanyCd());
    DomainWrap dm = getDomainDetail();
    _log.info("SHIPPER_CD = "+ dm.getString(SHIPPER_CD));
    int arraySize = edits.size();
    _log.info("ARRAY_SIZE = "+arraySize);
    String[] ArrPoNo = new String[arraySize];
    String[] ArrPartsCd = new String[arraySize];
    String[] ArrIvQty = new String[arraySize];
    String[] ArrIvPrice = new String[arraySize];
    String[] ArrCartonToNo = new String[arraySize];
    String[] ArrGroupNo = new String[arraySize];
    String[] ArrSeq = new String[arraySize];
    String[] ArrAa105TukaKbn = new String[arraySize];
    String[] ArrAa105JyuchuYmd = new String[arraySize];
    String[] ArrDvaiJusinBUpdateDatec14 = new String[arraySize];
    for(int i=0; i<arraySize; i++){
    DomainWrap edit = edits.getDomainRecord(i);
    ArrPoNo[i] = edit.getString(PO_NO_DVAI);
    ArrPartsCd[i] = edit.getString(PARTS_CD_DVAI);
    ArrIvQty[i] = edit.getString(IV_QTY);
    ArrTaniKbn[i] = getNullToSpace(edit,TANI_KBN);//CT0198
    ArrNetWeight[i] = edit.getString(NET_WEIGHT_2);
    ArrGrossWeight[i] = edit.getString(GROSS_WEIGHT_2);
    ArrIvM3[i] = edit.getString(IV_M3_2);
    //ArrCartonShu[i] = edit.getString(CARTON_SHU);
    ArrCartonShu[i] = getNullToSpace(edit,CARTON_SHU);//CT0198
    ArrCartonDepth[i] = edit.getString(CARTON_DEPTH);
    ArrCartonWidth[i] = edit.getString(CARTON_WIDTH);
    ArrCartonHeight[i] = edit.getString(CARTON_HEIGHT);
    ArrHacOlUpdateDateIn[i] = edit.getString(OL_UPDATE_DATE_4);
    ArrSoNo[i] = getNullToSpace(edit,PO_NO);//CT0198
    ArrGroupNo[i] = getNullToSpace(edit,GROUP_NO);//CT0198
    ArrSeq[i] = getNullToSpace(edit,EDA_NO);//CT0198
    ArrAa105TukaKbn[i] = edit.getString(TUKA_KBN_2);
    ArrAa105JyuchuYmd[i] = edit.getString(JYUCHU_YMD);
    ArrDvaiJusinBUpdateDatec14[i] = edit.getString(OL_UPDATE_DATE_3);
    _log.info("PO_NO["+i+"] = "+ArrPoNo);
    int colcnt = 1;
    int COMPANY_CD_COL = 0;
    int RET_COL = colcnt++;
    if ( !((SM0900_App)getAppContext()).isHandlingOldCompanyCode()) {
    COMPANY_CD_COL = colcnt++;
    int SHIPPER_CD_COL = colcnt++;
    int SHIPPER_CD_F_COL = colcnt++;
    int REIV_CD_COL = colcnt++;
    int COMP_CD_COL = colcnt++;
    int MASTER_BL_COL = colcnt++;
    int MASTER_BL_F_COL = colcnt++;
    int HOUSE_BL_COL = colcnt++;
    int ETA_YMD_COL = colcnt++;
    int ETD_YMD_COL = colcnt++;
    int FLIGHT_NO1_COL = colcnt++;
    int FLIGHT_ETA1_COL = colcnt++;
    int FLIGHT_ETD1_COL = colcnt++;
    int FLIGHT_NO2_COL = colcnt++;
    int FLIGHT_ETA2_COL = colcnt++;
    int GRAND_TOTAL_COL = colcnt++;
    int PO_NO_COL = colcnt++;
    int PARTS_CD_COL = colcnt++;
    int IV_QTY_COL = colcnt++;
    int SYORI_YMD_COL = colcnt++;
    int JOB_ID_COL = colcnt++;
    int USER_ID_COL = colcnt++;
    int TERMINAL_ID_COL = colcnt++;
    int OB_KBN_COL = colcnt++;
    int HAC_OL_UPDATE_DATE_IN_COL = colcnt++;
    int SO_NO_COL = colcnt++;
    int DVAI_JUSIN_H_UPDATE_DATE_COL = colcnt++;
    int DVAI_JUSIN_B_UPDATE_DATE_COL = colcnt++;
    cstmt = ( OracleCallableStatement )(con.prepareCall(stmt_str));
    Connection oraconn = cstmt.getConnection();
    ArrayDescriptor descVc01 = ArrayDescriptor.createDescriptor("WRP_VC01", oraconn);
    ArrayDescriptor descVc20 = ArrayDescriptor.createDescriptor("WRP_VC20", oraconn);
    cstmt.registerOutParameter( 1, OracleTypes.NUMBER );
    if (! ((SM0900_App)getAppContext()).isHandlingOldCompanyCode() ) {
    cstmt.setString( COMPANY_CD_COL, getAppContext().getCompanyCd() );
    cstmt.setString( SHIPPER_CD_COL, dm.getString(SHIPPER_CD) );
    //cstmt.setString( SHIPPER_CD_F_COL, dm.getString(SHIPPER_CD) );
    cstmt.setString( SHIPPER_CD_F_COL, getNullToSpace(dm,SHIPPER_CD));//CT0198
    cstmt.setString( REIV_CD_COL, dm.getString(REIV_CODE) );
    cstmt.setString( COMP_CD_COL, dm.getString(COMPANY_CODE) );
    cstmt.setString( MASTER_BL_COL, dm.getString(MASTER_BL_NO) );
    //cstmt.setString( MASTER_BL_F_COL, dm.getString(MASTER_BL_NO) );
    cstmt.setString( MASTER_BL_F_COL, getNullToSpace(dm,MASTER_BL_NO));//CT0198
    cstmt.setString( KEIJO_YMD_COL, dm.getString(KEIJYO_YMD) );
    cstmt.setString( LCH_OL_UPDATE_DATE_COL, dm.getString(OL_UPDATE_DATE_2) );
    //cstmt.setString( MEDIATION_COL, dm.getString(CHUKAI_KBN) );
    cstmt.setString( MEDIATION_COL, getNullToSpace(dm,CHUKAI_KBN));//CT0198
    cstmt.setString( PRICE_BASIS_COL, dm.getString(TATENE_KBN) );
    //cstmt.setString( POL_COL, dm.getString(FNZM_PORT_CD_2) );
    //cstmt.setString( POL_EDI_COL, dm.getString(FNZM_PORT_CD) );
    //cstmt.setString( POD_COL, dm.getString(NIAGE_PORT_CD_2) );
    //cstmt.setString( POD_EDI_COL, dm.getString(NIAGE_PORT_CD) );
    cstmt.setString( CNTN2_SYUBETU_COL, getNullToSpace(dm,CNTN_SYUBETU_2));//CT0198
    cstmt.setBigDecimal( CNTN2_HONSU_COL, getBigDecimalZero(dm, CNTN_NO_2) );
    cstmt.setString( CNTN3_SYUBETU_COL, getNullToSpace(dm,CNTN_SYUBETU_3));//CT0198
    cstmt.setBigDecimal( CNTN3_HONSU_COL, getBigDecimalZero(dm, CNTN_NO_3) );
    cstmt.setString( TUKA_KBN_COL, dm.getString(TUKA_KBN) );
    cstmt.setBigDecimal( GRAND_TOTAL_COL, getBigDecimalZero(dm, TOTAL_AMT) );
    //set Arrays
    ARRAY poNoArray = new ARRAY(descVc16, oraconn, ArrPoNo);
    ARRAY partsCdArray = new ARRAY(descVc11, oraconn, ArrPartsCd);
    ARRAY ivQtyArray = new ARRAY(descVc09, oraconn, ArrIvQty);
    ARRAY seqArray = new ARRAY(descVc02, oraconn, ArrSeq);
    ARRAY aa105TukaKbnArray = new ARRAY(descVc02, oraconn, ArrAa105TukaKbn);
    ARRAY aa105JyuchuYmdArray = new ARRAY(descVc08, oraconn, ArrAa105JyuchuYmd);
    ARRAY dvaiJusinBUpdateDatec14Array = new ARRAY(descVc14, oraconn, ArrDvaiJusinBUpdateDatec14);
    cstmt.setArray( PO_NO_COL, poNoArray );
    cstmt.setArray( PARTS_CD_COL, partsCdArray );
    cstmt.setArray( CARTON_HEIGHT_COL, cartonHeightArray );
    cstmt.setInt( ARRAY_SIZE_COL, arraySize );
    cstmt.setString( SYORI_YMD_COL, getAppContext().getOnlineDate() );
    cstmt.setString( JOB_ID_COL, SM0900_Const.PGID );
    cstmt.setString( USER_ID_COL, getAppContext().getUserId() );
    cstmt.setString( TERMINAL_ID_COL, getAppContext().getTerminalId());
    cstmt.setString( OB_KBN_COL, IPOConst.OLKBN );
    cstmt.setArray( HAC_OL_UPDATE_DATE_IN_COL, hacOlUpdateDateInArray );
    cstmt.setArray( SO_NO_COL, soNoArray );
    cstmt.setArray( GROUP_NO_COL, groupNoArray );
    cstmt.setArray( SEQ_COL, seqArray );
    cstmt.registerOutParameter( GRD_ROW_CNT_COL, OracleTypes.NUMBER );
    cstmt.registerOutParameter( ERR_IDX_COL, OracleTypes.NUMBER );
    cstmt.registerOutParameter( ERR_MSGID_COL, OracleTypes.CHAR );
    cstmt.setString( DVAI_JUSIN_H_UPDATE_DATE_COL, dm.getString(OL_UPDATE_DATE) );
    cstmt.setArray( DVAI_JUSIN_B_UPDATE_DATE_COL, dvaiJusinBUpdateDatec14Array );
    cstmt.execute();
    String ret_col = cstmt.getString( RET_COL );
    Those are extremely ugly and they resemble as alien's home. Oracle PL/SQL forced such shit-of-fish codes. It doesn't receive any class nor a structure which bundles several simple data types from Java. Parameters must be completely separated and scattered to Integer or String.
    In fact, such whole absurd steps mean breaking off of data between Java and P?/?Q? modules.
    Debugging the system is playing a chess or othello game with blindfold.
    Can you trust on them?
    4) Without invention of way of passing any Java class directly as (in and out)parameter, and being away from debugging tool which is (as using Eclipse for regular Java codes) on up-to-date source code level and executable from web application server (I mean that module unit test tool is not enough. Whole application test is needed), then PL/SQL will be exactly no use for rapid and secure development in few years.
    5) PL/SQL is just a burden for systems. It will be defeated by Java servlet, JDBC and Eclipse.
    6) Oracle should support Java directly as main way of solution and you have to wipe the poor garbage legacy of PL/SQL out. Change them into Java modules.

    1) Very few PL/SQL programmers would consider it good form to have procedures with excessive numbers of parameters. In any language, though, it's possible to write poor code.
    2) Initially, you're right-- the performance of properly defined SQL statements via JDBC is little different than the performance of PL/SQL stored procedures. Frequently, however, SQL statements in Java applications do not take advantage of bind variables, which will significantly limit their scalability. Maintaining SQL statements in client applications makes it significantly more difficult on the support side-- if you find a bug in a stored procedure, you can fix the bug in one place-- if you find a bug in embedded SQL, you have to fix the code everywhere the client is deployed. Maintaining PL/SQL stored procedures also makes optimization easier-- frequently your DBA will be able to boil down a stored procedure to a couple of SQL statements and vastly improve performance (i.e. INSERT INTO <<table name>> SELECT <<column list>> from <<other table>> rather than looping over a cursor doing single-row inserts). Finally, PL/SQL stored procedures enable reuse-- when the next application wants to access the database, it doesn't have to rewrite your SQL.
    3) If the alternative to the bind variables (?'s) is a bunch of literals, I'll spend the extra time writing the code for the tremendous increase in scalability.
    4-6) You can certainly pass classes from Java to PL/SQL and back. You can also write Java stored procedures, rather than writing PL/SQL stored procedures). Oracle has been one of the leading proponents of Java.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Creating parameters dynamically and calling a procedure but strange issue

    Okay I have the following program that is calling a procedure(data_compare_utility)[pasted below] and data_compare_table_setup table definition and data(isert scripts) are pasted below :
    DECLARE
    --FP_OLD_TABLE VARCHAR2(200);
    --FP_NEW_TABLE VARCHAR2(200);
    --FP_DATA_COMPARE_ID NUMBER(10) := 1;
    --FP_RESTRICTION_CLAUSE VARCHAR2(500) := 'WHERE W_INSERT_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'') OR W_UPDATE_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'')';
    --FP_RESTRICTION_CLAUSE_4_INS VARCHAR2(500) := 'WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')';
    cursor c_data_compare_table_setup
    is
    select table_name, old_schema_name, new_schema_name, data_compare_id, restriction_clause, restriction_clause_ins from DATA_COMPARE_TABLE_SETUP;
    r_of_data_compare_table_setup c_data_compare_table_setup%rowtype;
    Lv_args_4_data_compare_utility varchar2(500);
    BEGIN
    --FP_OLD_TABLE := 'BIAPPS_11.RAHUL_EMPLOYEES';
    --FP_NEW_TABLE := 'RAHULKALRA.RAHUL_EMPLOYEES';
    open c_data_compare_table_setup;
    Loop
    fetch c_data_compare_table_setup into r_of_data_compare_table_setup;
    exit when c_data_compare_table_setup%NOTFOUND;
    --exec RAHULKALRA.P_COMPARE_DATA_UTILITY
    Lv_args_4_data_compare_utility := ''''||r_of_data_compare_table_setup.OLD_SCHEMA_NAME||'.'||r_of_data_compare_table_setup.TABLE_NAME||''','''||r_of_data_compare_table_setup.NEW_SCHEMA_NAME||'.'||r_of_data_compare_table_setup.TABLE_NAME||''','||r_of_data_compare_table_setup.DATA_COMPARE_ID||','''||r_of_data_compare_table_setup.RESTRICTION_CLAUSE||''','''||r_of_data_compare_table_setup.RESTRICTION_CLAUSE_INS||'''';
    P_COMPARE_DATA_UTILITY(Lv_args_4_data_compare_utility);
    commit;
    End Loop;
    dbms_output.put_line('rahul');
    dbms_output.put_line(''''||r_of_data_compare_table_setup.OLD_SCHEMA_NAME||'.'||r_of_data_compare_table_setup.TABLE_NAME||''','''||r_of_data_compare_table_setup.NEW_SCHEMA_NAME||'.'||r_of_data_compare_table_setup.TABLE_NAME||''','||r_of_data_compare_table_setup.DATA_COMPARE_ID||','''||r_of_data_compare_table_setup.RESTRICTION_CLAUSE||''','''||r_of_data_compare_table_setup.RESTRICTION_CLAUSE_INS||'''');
    --P_COMPARE_DATA_UTILITY('BIAPPS_11.RAHUL_EMPLOYEES','RAHULKALRA.RAHUL_EMPLOYEES',1,'WHERE W_INSERT_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'') OR W_UPDATE_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'')','WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')');
    --P_COMPARE_DATA_UTILITY('BIAPPS_11.RAHUL_EMPLOYEES','RAHULKALRA.RAHUL_EMPLOYEES',1,'WHERE W_INSERT_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'') OR W_UPDATE_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'')','WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')');
    close c_data_compare_table_setup;
    END;
    Procedure : compare_data_utility:
    CREATE OR REPLACE procedure RAHULKALRA.p_compare_data_utility(fp1_old_table in varchar2, fp2_new_table in varchar2, fp3_data_compare_id in number, fp4_restriction_clause in varchar2, fp5_recrtiction_clause_4_ins in varchar2)
    as
    Lv_common_column_names varchar2(2000);
    Lv_primary_column_name varchar2(50);
    Lv_insert_data_compare_log varchar2(2000);
    --Lv_counter number(10);
    Lv_row_id_for_data_compare_log number(10);
    Lv_old_table_record_count number(10);
    Lv_old_table_rec_cnt_query varchar2(200);
    Lv_new_table_record_count number(10);
    Lv_new_table_rec_cnt_query varchar2(200);
    begin
    select max(row_id) into Lv_row_id_for_data_compare_log from data_compare_log;
    Lv_old_table_rec_cnt_query := 'Select count(*) from '||fp1_old_table||' '||fp4_restriction_clause;
    dbms_output.put_line(Lv_old_table_rec_cnt_query);
    execute immediate Lv_old_table_rec_cnt_query into Lv_old_table_record_count;
    Lv_new_table_rec_cnt_query := 'Select count(*) from '||fp2_new_table||' '||fp4_restriction_clause;
    execute immediate Lv_new_table_rec_cnt_query into Lv_new_table_record_count;
    dbms_output.put_line(fp5_recrtiction_clause_4_ins);
    if (Lv_row_id_for_data_compare_log is null)
    then
    Lv_row_id_for_data_compare_log := 1;
    else
    Lv_row_id_for_data_compare_log := Lv_row_id_for_data_compare_log + 1;
    end if;
    Lv_insert_data_compare_log := 'insert into data_compare_log values('||Lv_row_id_for_data_compare_log||',''comparing data for '||fp1_old_table||' and '||fp2_new_table||''','''||fp1_old_table||''','''||fp2_new_table||''',TO_DATE('''||to_char(sysdate,'DD-MON-YY HH24:MI:SS')||''',''DD-MON-YY HH24:MI:SS''),'||fp3_data_compare_id||','||Lv_old_table_record_count||','''||'Select count(*) from '||fp1_old_table||' '||fp5_recrtiction_clause_4_ins||''','||Lv_new_table_record_count||','''||'Select count(*) from '||fp2_new_table||' '||fp5_recrtiction_clause_4_ins||''')';
    dbms_output.put_line(Lv_insert_data_compare_log);
    execute immediate Lv_insert_data_compare_log;
    commit;
    -- tested : dbms_output.put_line(Lv_insert_data_compare_log);
    Lv_common_column_names := f_fetch_common_column_names(fp1_old_table,fp2_new_table,fp3_data_compare_id);
    -- tested : dbms_output.put_line(Lv_common_column_names);
    Lv_primary_column_name := f_extract_pkey_column_names(fp1_old_table, fp2_new_table);
    dbms_output.put_line(Lv_primary_column_name);
    p_compare_data(fp1_old_table,fp2_new_table,Lv_common_column_names,Lv_primary_column_name,fp4_restriction_clause,fp3_data_compare_id);
    end;
    CREATE TABLE RAHULKALRA.DATA_COMPARE_TABLE_SETUP
    TABLE_ID NUMBER(10),
    TABLE_NAME VARCHAR2(100 BYTE),
    OLD_SCHEMA_NAME VARCHAR2(100 BYTE),
    NEW_SCHEMA_NAME VARCHAR2(100 BYTE),
    RESTRICTION_CLAUSE VARCHAR2(500 BYTE),
    RESTRICTION_CLAUSE_INS VARCHAR2(500 BYTE),
    DATA_COMPARE_ID NUMBER(10)
    Insert into DATA_COMPARE_TABLE_SETUP
    (TABLE_NAME, OLD_SCHEMA_NAME, NEW_SCHEMA_NAME, DATA_COMPARE_ID, RESTRICTION_CLAUSE, RESTRICTION_CLAUSE_INS)
    Values
    ('W_CHNL_TYPE_D', 'BIAPPS_11', 'RAHULKALRA', 1, 'WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')', 'WHERE W_INSERT_DT >= TO_DATE(''''''''01/JAN/2012'''''''',''''''''DD/MON/YYYY'''''''') OR W_UPDATE_DT >= TO_DATE(''''''''01/JAN/2012'''''''',''''''''DD/MON/YYYY'''''''')');
    Insert into DATA_COMPARE_TABLE_SETUP
    (TABLE_NAME, OLD_SCHEMA_NAME, NEW_SCHEMA_NAME, DATA_COMPARE_ID, RESTRICTION_CLAUSE, RESTRICTION_CLAUSE_INS)
    Values
    ('RAHUL_EMPLOYEES', 'BIAPPS_11', 'RAHULKALRA', 1, 'WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')', 'WHERE W_INSERT_DT >= TO_DATE(''''''''01/JAN/2012'''''''',''''''''DD/MON/YYYY'''''''') OR W_UPDATE_DT >= TO_DATE(''''''''01/JAN/2012'''''''',''''''''DD/MON/YYYY'''''''')');
    I am facing the following error for this command when I call P_compre_data_utility procedure from my anonymous block:
    P_COMPARE_DATA_UTILITY(Lv_args_4_data_compare_utility); -- the error is pasted below
    if I do a dbms_output.put_line(Lv_args_4_data_compare_utility) and then copy paste its output and call P_COMPARE_DATA_UTILITY, the procedure is getting executed, here is that command :
    P_COMPARE_DATA_UTILITY('BIAPPS_11.RAHUL_EMPLOYEES','RAHULKALRA.RAHUL_EMPLOYEES',1,'WHERE W_INSERT_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'') OR W_UPDATE_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'')','WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')');
    Error:
    ORA-06550: line 27, column 7:
    PLS-00306: wrong number or types of arguments in call to 'P_COMPARE_DATA_UTILITY'
    ORA-06550: line 27, column 7:
    PL/SQL: Statement ignored
    Question : just want to know whats wrong with : P_COMPARE_DATA_UTILITY(Lv_args_4_data_compare_utility);
    please help me.
    Regards
    Rahul

    Mac_Freak_Rahul wrote:
    Hi All,
    I am really sorry, my head is so aching since I am not a regular plsql coder and to save my life I need to write this code for data comparison between 2 tables .. further sorry about calling p_data_compare utility stupidly : P_COMPARE_DATA_UTILITY(Lv_args_4_data_compare_utility);
    I am calling it now using :
    execute immediate 'exec P_COMPARE_DATA_UTILITY('||Lv_args_4_data_compare_utility||')';If you are sure the call works then, exec would not work since it is a SQLPLUS command.
    try
    execute immediate 'BEGIN P_COMPARE_DATA_UTILITY(''||Lv_args_4_data_compare_utility||''); END;';
    PS: I can manually give table names to my utility , just need 60 tables to compare but would be great if I can work it out this eay.
    2) I can sound very stupid since my head is aching I am not a regular plsql coder but from now on I would be one, please helpJust for your sake, to Compare 60 tables (Supposing you just want to verify count of records), you are writing an entire procedure; You might have completed this activity by now doing the manual way. By taking this way, you are investing time to generate a correct code (as you just mentioned not being a regular plsql developer) you are stuck with some un-identifiable issues.
    As an alternate way, I would suggest you to export the data, after ordering, into a spreadsheet and then validate. Also, since it looks like you are comparing the data in the same database between schemas, you can also use the SQL Navigators Data Compare utility and there are many more readily available in market.
    I would wish you the best if you still prefer taking the approach.

Maybe you are looking for

  • Year 09 macbook pro can't find HDD!

    2009 Macbook Pro M4 128 SSD Work fine before. Suddenly happend, system not responding. hold power button to turn OFF, then ON again can't find HDD, suspect is SSD HDD problem try plug it on other computer,see all data still there, do HDD verify with

  • Weblogic 11g Error

    Hello , We are having an Spring based application which was running in weblogic 8.1 , we are migrating to weblogic 11g . I created all the configurations in 11g as it was in 8.1 . But I am getting a set of errors as shown below while deploying the ap

  • Problems with image scaling

    I'm facing a real problem with image scaling I've used several algorithms but it all has defects but the most common thing is the out of memory error after several enlargments... does any one know a solution... note: I've used several packages to do

  • Getting an odd CalDAV password prompt?  Mine was linked to Yahoo password change

         Today I couldn't send mail via the iPad.  Instead of alterting me that the password was wrong, it told me that my current outgoing server was wrong.  It identified the current server as something like                     apple.yahoo.smtp.    yad

  • WAD - Tab Strips - document.getElementById(...)  is null or no object

    Hello to everybody, i  have a problem with the wad, i would like to create a tab strip, i have copied the HTML Coding from another blog. When i started the Query i alway receive the message "document.getElementById(...) ist Null oder kein Object". Wh