procedure of data base with IN/OUT parameters

Hello

I have a procedure with multiple OUTPUT parameters,
but I don't know how to get the values of these parameters in the calling procedure.

What I mean is I can just get the value of a function of a procedure of appeal as: -.

declare
number of val1;
Start
val1: = func_get_num;
end;

How can I get the values of the PARAMETERS of a procedure in a similar way?

You have to pass the placeholding variables in the procedure is completed by the procedure.

for example

declare
    val1 number;
begin
    proc_get_num(val1);
end;

Tags: Database

Similar Questions

  • Procedure call to ODI with in & out parameter

    Hi all

    Anyone has idea, how to call to oracle ODI with setting procedure. Later I want to assign parameters to variables of ODI.

    Thank you

    SD

    Hello

    Take a look at the post below. It will be useful.

    http://odiexperts.com/how-to-use-PLSQL-procedures-and-functions-in-ODI/

    Thankss,

    Ajay

  • Application of data base with Datefields

    Hello

    I have a question about dates and the query.

    What I would do is:

    I have a (Access) database with information from the user, one of the fields is DateOfBirth (date and time standard field)

    On our Intranet homepage, I want to show the user which has his birthday today.

    So I came up with the date julienne. It is a generated number that represents the date.

    If I can compaire date (number of Julian) database with the date (julian) function DayOfYear (Now ()).

    I can do a selction of data display.

    I know I should use the "CreateODBCDate" in a query, but I can't seem to get the right syntax for my request.

    What I did is the following:

    < cfset DateToday = Now() >

    < cfset Julian = DayOfYear (DateToday) >

    < cfquery name = "RsBirthday" datasource = "DSN" >
    SELECT Firstname, LastName, date of birth
    AMONG the people
    WHERE #createODBCDate (DateToday) # = Date of birth
    < / cfquery >

    I know the above is not correct, but I tried for several hours, I can't get my head around this!

    Can someone help me out here?

    Concerning

    Richy

    RichyVN wrote:

    WHERE #createODBCDate (DateToday) # = Date of birth

    Your problem is that this logic will only find people who are born today.  So unless your database is less full feed then aged 24 and is updated immediately at birth, then you are likely to return all records.

    What you want to do is to compare values of day and month but not the year of the date data value time.  Day() and month() functions CFML and appropriate database versions that apply to your DBMS would be what you want.  Something like this pseduo code, but you'll need correspond to functions of database to your database tool.

    WHERE dbDay(BirthDate) = #day(dateToday)# AND dbMonth(BirthDate) = #month(DateToday)#
    

    Post edited by: Ian Skinner corrected the order in my username WHERE clause so that the database functions are on the left and the values are right in the normal expected progression.

  • With the help of a data base with VeriStand BOX

    Hello

    I use a BMS that communicate via CAN with VeriStand. I imported the database of the device with NI-XNET (with 3 nodes CAN) and I can see some parameters of acquisition under veristand correctly.

    But now I want to order a State request and check if the command is well transmitted.

    To do this, I sent a node and try to see the information in another node and it does not work.

    So is this the proper way to check transmission CAN or is there another way?

    Thank you very much

    Hi Vincent,.

    If I understand correctly, what you're doing are a loopback test. It is indeed a good practice for communication. Have you connected your ports CAN directly together? In some cases, depending on the hardware you are using, you may need an external power supply for the transmission CAN occur.

    In all cases, you can also check your good communication using the tool called NI XNET Bus monitor.

    Does that answer your question?

    Good day

    M junior

  • GR 11, 2 data base with 10203 surveillance WHO

    Hi gurus,

    I'll be able to monitor 11 GR 2 database using WHO/GC 10203 DEFAULT repository version 10104?

    What version of the agent should I have to install?

    Thank you

    822424 wrote:
    I have a standlone 11 GR 2 and its monitored by 10203 GC. How is he's being watched if it does not work.

    Is it just the features that I will not be able to see

    You can track and you can or can not deal with issue.

    But this isn't a combination of supported according to Oracle and if you face any issue, Oracle Support won't help you.

    It is preferable to opt for the certified combination.

    Concerning
    Rajesh

  • Run the statement in a stored procedure with Out parameters and

    Hi all

    I have a stored procedure that calls a select statement. Here it is...

    CREATE OR REPLACE PROCEDURE BLABLA_VIEW_PROCEDURE

    * (BLABLA_KEY IN NUMBER, *)
    XML_OUTPUT ON VARCHAR)
    AS
    BEGIN
    SELECT SYS. XMLTYPE.getStringVal (OBJECT_VALUE) in XML_OUTPUT FROM BLABLA_VIEW WHERE extractValue (OBJECT_VALUE, ' / BLABLA_TYPE/BLABLA_KEY ') = 2876;
    END;

    Is to have both IN and OUT parameters as described above. I am able to compile and run the procedure.

    The problem I want to share with everyone is...
    I want to run the stored procedure together with a single EXEC command.

    I tried different ways using the EXEC command but of no use.

    Could someone help me?
    Thanks in advance.

    Published by: user10763276 on June 3, 2010 15:47

    Please visit the following...

    sudhakar@ORCL>CREATE OR REPLACE PROCEDURE BLABLA_VIEW_PROCEDURE
      2  (BLABLA_KEY IN NUMBER,
      3  XML_OUTPUT OUT VARCHAR)
      4  AS
      5  BEGIN
      6  XML_OUTPUT := BLABLA_KEY || ' and whatever else...';
      7  END;
      8  /
    
    Procedure created.
    
    sudhakar@ORCL>
    sudhakar@ORCL>var XML_OUTPPUT varchar2(100);
    sudhakar@ORCL>exec BLABLA_VIEW_PROCEDURE (9151, :XML_OUTPPUT);
    
    PL/SQL procedure successfully completed.
    
    sudhakar@ORCL>print XML_OUTPPUT;
    
    XML_OUTPPUT
    --------------------------------------------------------------------------------
    9151 and whatever else...
    
    sudhakar@ORCL>
    

    Post tells you...

    var OUTPUT VARCHAR
    exec BLABLA_VIEW_PROCEDURE (9151, :OUTPUT);
    print OUTPUT
    

    VARCHAR is not a valid TYPe to declare. Use VARCHAR2 (nnn) where nnn is a number.
    VR,
    Sudhakar B.

  • Calling a procedure with IN and OUT parameters

    Hello

    I usually call my procedures using the following

    declare the variable msg_erreur varchar2 (50)
    exec simple_msg('ABC,'ABC','ABC',:error_msg);

    CREATE OR REPLACE PROCEDURE SIMPLE_MSG)
    ID IN VARCHAR2,
    URL IN VARCHAR2,
    THE LIST IN VARCHAR2,
    MSG_ERREUR OUT VARCHAR2

    *************************************************************
    Now my question is, I try to call a proc that has IN OUT parameters. Can someone guide me on how to call the d.a. thanks

    CREATE OR REPLACE PROCEDURE SIMPLE_MSG)
    ID IN VARCHAR2,
    URL IN VARCHAR2,
    THE LIST IN VARCHAR2,
    NAME IN VARCHAR OUT,
    MSG_ERREUR OUT VARCHAR2

    Hello

    OUTSIDE of the parameters are passed as OUT was: you must pass a variable.

    If you set the IN OUT parameter before calling the procedure, and then either
    (a) use the separate EXEC command:

    EXEC  :name := 'Original name';
    EXEC  simple_msg ('ABC', 'ABC', 'ABC', :name, :error_msg);
    

    or

    (b) use a PL/SQL anonymous block, like this:

    BEGIN
        :name := 'Original name';
        simple_msg ('ABC', 'ABC', 'ABC', :name, :error_msg);
    END;
    /
    

    The parameter can be either a variable binding (as illustrated above), or a local variable (which may only be used in the block).

  • ADF is intended for the data base designed with vertical diagram?

    Hello

    I want to know if ADF 11 g is intended for the data base designed with vertical scheme where even the names of columns will be stored in a generic table?

    Thanks in advance.

    Published by: user8925296 on April 12, 2010 10:06

    The short answer is no...

    What do you call a 'vertical plan', it's what others have called for a schema of entity-attribute-value or universal data model. I advise you to do some research open minded on these types of patterns if you develop an application before continuing. Great sound in practice, they have very inherent ease of use and scalability problems. [url http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:2314483800346542969] This could be a good starting point...

    John

  • Photos - photos of iCloud - several users share data bases

    Hi hoping someone can point me in the right direction here as it is driving me crazy!

    New Mac mini, OS X and photos app.

    Basically, I want to share a unique data base of Photos between two users on the same Mac accounts. Have followed all the advice online, I'm always running into difficulty. I put the database on an external SSD with permissions in place for any user access to the base (but only one at a time of course).

    All very well so far, but here comes the question. I want pictures of iCloud enabled on one of the accounts with complete download of all pictures to iCloud, when I get out of the photos, the photolibraryd process remains active. This means that when I change the account and you are trying to access the photos, I can't because photoslibraryd in the other account is accessed again. To work around this I started to enter photoslibraryd monitor and the murder of activity as well as the Photos itself before you log in to the second account and to access the Photos. This seems to work (but is a bit of a pain if I forgot!) - which is a lot more pain, it's that if I add some photos in the second account and then go back to the first, rather than synchronize the new photos with iCloud, product photos across the entire library 20,0000 resynchronization photo! It's bad!

    I have approached the wrong way? Is there a better way to achieve what I want - that is entirely database of shared photos between two users on the same Mac (with photo stream enabled on both accounts for these devices which have not iCloud photo activated) and iCloud photo enabled on one of the Mac accounts - without killing the process or any what fees General massive sync?

    Grateful for any help.

    Thank you very much

    Rich.

    It is not possible to share a library of photos between several users, if the library in question is your system library. If you cannot share the library used as the iCloud photo library with others.  If you want to share photos with others, use a separate library of Photos to share and transfer photos from there to your iCloud library.

    I found this in the documentation for PowerPhotos:

    : https://www.fatcatsoftware.com/powerphotos/Help/sharing%20a%20library%20between% 20multiple%20user%20accounts%20on%20one%20mac.html

    Share a library between several user accounts on a Mac

    Photos is not designed with use multi-user in mind, which makes it very difficult to create a configuration where only one library of Photos are accessed through accounts on your Mac. If you want to share a library in this way, the following restrictions will be applied (for the bottom of discussion, we have two users named A and B we want to share a library):

    1. Account that a single user can never open a library given in Photos at the same time. Before you can use the shared library as long as the user has, make sure to leave Photos as user B.
    2. None of the user accounts that access the library may designate as their "library system". The library system is actually open at any time by OS X in the background, as long as that user is connected, even while quitting smoking pictures not free the library so that another user can open. You must designate another library system library, or completely close the session user B before trying to access the library as user A. Note that this also prevents having this synchronization of library with iCloud.
    3. The library cannot be stored on your internal drive or any other drive where the permissions are respected. Fighting against the permissions on OS X is a losing battle. While you can play whack-a-mole to try to correct the permissions on the library before you open it, then something goes wrong and it is likely that you will be unable to access a part of your library. You should keep the library on an external drive and in the read window information in the Finder, make sure the checkbox "Ignore permissions on this volume" is checked.

    Re: How to share your photo on the same Mac without iCloud library

  • How to perform this procedure. .pls help with example

    / * It displays a warning * /.
    -How to remove this warning


    CREATE PROCEDURE EMP_TITLE_GENERATOR (EMP_GENDER IN (1) TANK, EMP_TITLE OUT VARCHAR2)
    IS
    BEGIN
    EMP_TITLE: = Decode(EMP_GENDER,'M','Mr','F','Ms','INVALID');
    EXCEPTION
    WHILE OTHERS THEN
    DBMS_OUTPUT. PUT_LINE (SQLERRM);
    END;

    Published by: 923746 on April 18, 2012 19:58

    Published by: 923746 on April 18, 2012 19:59
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    
    SQL> CREATE PROCEDURE EMP_TITLE_GENERATOR (EMP_GENDER IN VARCHAR2,EMP_TITLE OUT VARCHAR2)
      2  IS
      3  begin
      4  select DECODE(EMP_GENDER,'M','Mr','F','Ms','INVALID') into emp_title from dual;
      5  EXCEPTION
      6  WHEN OTHERS THEN
      7  dbms_output.put_line(sqlerrm);
      8  END;
      9  /
    
    Procedure created.
    
    SQL> set serveroutput on
    SQL> DECLARE
      2    EMP_GENDER VARCHAR2(200);
      3    EMP_TITLE VARCHAR2(200);
      4  BEGIN
      5    EMP_GENDER := 'F';
      6
      7    EMP_TITLE_GENERATOR(
      8      EMP_GENDER => EMP_GENDER,
      9      EMP_TITLE => EMP_TITLE
     10    );
     11    DBMS_OUTPUT.PUT_LINE('EMP_TITLE = ' || EMP_GENDER);
     12    DBMS_OUTPUT.PUT_LINE('EMP_TITLE = ' || EMP_TITLE);
     13  END;
     14  /
    EMP_TITLE = F
    EMP_TITLE = Ms
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    
  • SQL procedure does not work with 'current cursor' Oracle 11 g

    Hi all
    I've written a procedure that should update all rows for a single column on a given table.
    Here is the code:

    CREATE OR REPLACE PROCEDURE "xxx". "" loop_update_autowert_x ".
    (
    number of startwert
    column_name VARCHAR2,
    table_name varchar2
    )
    AS

    stmt varchar2 (2000);
    stmt2 varchar2 (2000);
    number of zaehler;
    number of sum_gesamt;
    TYPE obj_ref_type IS REF CURSOR;
    obj_cur obj_ref_type;
    Start
    stmt2: = ' select rownum, rowid of | table_name | "for update";
    Obj_cur OPEN FOR stmt2;
    dbms_output. Enable (1000000);
    dbms_output.put_line (' ist Startwert: ' | startwert);
    dbms_output.put_line (' ist column name: ' | column_name);
    dbms_output.put_line (' ist Table name: ' | table_name);
    loop
    extract the obj_cur in zaehler, my_rowid;
    exit WHEN obj_cur % NOTFOUND;
    sum_gesamt: = zaehler + startwert;
    stmt: = "update". table_name | 'set ' | column_name | ' = ' || sum_gesamt | "WHERE the current of obj_cur";
    dbms_output.put_line (stmt);
    immediately execute stmt;
    end loop;
    close obj_cur;
    end;

    the error I get is:
    Anmeldung bei der data base Oracle Test2.
    ORA-03001: Funktion nicht solution
    ORA-06512: in "xxx.loop_update_autowert_x", line 29
    ORA-06512: In line 10
    Startwert ist: 5
    Column name ist: one
    Table Name is: T
    Update T set a = 6 WHERE the currents of obj_cur
    Process finished.
    Abmeldung von der data base Oracle Test2.

    have anyone an idea what is wrong or this construction with the clause "cursor open for the statement" is not possible with the current cursor location

    thx for help
    Best regards
    Hans-Peter

    When informed of the cursor works with static cursors and static sql only.

    ----------
    Sybrand Bakker
    Senior Oracle DBA

  • steps for Data Guard with a primary eve and 2

    Hello

    Database: 10.2.0.4, 11.2.0.1
    Operating system: Windows, Unix

    A > primary database
    B > database ensures 1
    C > database ensures 2

    I want to configure * 2 Eve * databases for the single primary database.
    Allows to take, A, B and C are my machines. My Data Guard configuration will be like, * archive logs will be mobile * A to B and A to C.

    If I do all passage between and B , now that b is primary and remaining has and C are pending data bases. At this point also, Archives of the newspapers should move from B to A and B to C. In addition, even should arrive from C to A and C to B, if I make the passage between B and C. If all goes well, then I'll do switchback to the main database (A) primary.

    How should I mention PFILE in all machines , parameters like
    LOG_ARCHIVE_DEST_1 = LOCATION = < PATH > - LOCAL path ARCHIVE
    LOG_ARCHIVE_DEST_2 = SERVICE =
    LOG_ARCHIVE_DEST_3 = SERVICE =
    FAL_SERVER =
    FAL_CLIENT =
    STANDBY_FILE_MANAGEMENT =

    In my tnsnames.ora , primary, standby1 standby2 my service entrances and are even in all of my machines.

    Please suggest me, how can configure my pfiles in machines?

    Thank you
    Therese

    Please don't forget to update the thread with useful or correct, if you find the answer either.

    Kind regards
    SQuadri

  • perform an immediate function with parameter out

    How to perform a function with parameter in the statement immediately execute?
    declare
       vRunFunctie   varchar2(100) := 'startfunction';
       vParmIn1      varchar2(100) := 'AAA';
       vParmIn2      varchar2(100) := 'HHH';
       vParmOut1     number;
       vParmOut2     varchar2(100);
    begin
       --
       execute immediate 'select '||vRunFunctie||'('''||vParmIn1||''','''||vParmIn2||''',:vParmOut2) from dual' into vParmOut1 using vParmOut2;
       --
       dbms_output.put_line('vParmOut1['||vParmOut1||']');
       dbms_output.put_line('vParmOut2['||vParmOut2||']');
    end;
    /
    error: ORA-06572 startfunction function has arguments

    the statement looks like this in pl/sql:
    vParmOut1 := startfunction(vParmIn1, vParmIn2, vParmOut2);
    --vParmOut1 := startfunction('AAA', 'HHH', vParmOut2);
    Thank you.
    L.

    Update:
    You are not using bind variables with your dynamic code. That is a major mistake and the #1 reason for poor database performance.
    It is a fundamental flaw in programming to design a function that includes output parameters. This is simply and plainly wrong.
    Output parameters are also not supported by the SQL language - it does not support "procedure" like code units and call methods. 
    I know that the function should not have out parameters. But its programmed that way already...

    You try something like

    declare
       vRunFunctie   varchar2(100) := 'startfunction';
       vParmIn1      varchar2(100) := 'AAA';
       vParmIn2      varchar2(100) := 'HHH';
       vParmOut1     number;
       vParmOut2     varchar2(100);
    begin
       --
       execute immediate 'begin :x := ' || vRunFunctie || '( :p1,  :p2, :vParmOut2 ); end;' using out vParmOut1, vParmIn1, vParmIn2, out vParmOut2;
       --
       dbms_output.put_line('vParmOut1['||vParmOut1||']');
       dbms_output.put_line('vParmOut2['||vParmOut2||']');
    end;
    / 
    
  • Data Base Transaction is blocked...

    We have problems with the Production SAP events.

    Database Time out exceptions are thrown in the newspapers:



    Here's the exception:

    [23/10/10 16:26:34:490 EDT] 00000053 SystemOut O DEBUG, October 23, 2010 16:26:34, 489, [XELLERATE. SERVER], class/method: tcDataBase/eventPreInsert entered.
    [23/10/10 16:26:34:490 EDT] 00000053 SystemOut O DEBUG, October 23, 2010 16:26:34, 490, [XELLERATE. SERVER], class/method: tcDataBase/tcDataBase to the left.
    [23/10/10 16:26:34:499 EDT] 00000053 SystemOut O DEBUG, October 23, 2010 16:26:34, 499, [XELLERATE. SERVER], class/method: tcDataBase/readPartialStatement entered.
    [23/10/10 16:26:34:499 EDT] SystemOut O INFO 00000053, October 23, 2010 16:26:34, 499, [XELLERATE. DATABASE], DB read: select * NCE where rce_key = 446949
    [23/10/10 16:26:34:500 EDT] 00000053 SystemOut O DEBUG, October 23, 2010 16:26:34, 500, [XELLERATE. Select DATABASE], * NCE where rce_key = 446949
    [23/10/10 16:26:34:510 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 510, [XELLERATE. SERVER], class/method: tcRCE/reapplyRules entered.
    [23/10/10 16:26:34:510 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 510, [XELLERATE. DATA base], select usr_key from usr where USR_LOGIN =? and USR_STATUS! = "Deleted".
    [23/10/10 16:26:34:512 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 512, [XELLERATE. SERVER], class/method: tcDataBase/readPartialStatement entered.
    [23/10/10 16:26:34:512 EDT] SystemOut O INFO 00000052, October 23, 2010 16:26:34, 512, [XELLERATE. DATABASE], DB read: select rce_key, orc_key, rcp_rowver rcp where rce_key = 446949
    [23/10/10 16:26:34:513 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 513, [XELLERATE. DATA base], select rce_key, orc_key, rcp_rowver rcp where rce_key = 446949
    [23/10/10 16:26:34:514 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 514, [XELLERATE. SERVER], class/method: tcDataBase/readPartialStatement entered.
    [23/10/10 16:26:34:514 EDT] SystemOut O INFO 00000052, October 23, 2010 16:26:34, 514, [XELLERATE. DATABASE], DB read: select rce_key, usr_key, rcu_rowver of the rcu where rce_key = 446949
    [23/10/10 16:26:34:514 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 514, [XELLERATE. DATA base], select rce_key, usr_key, rcu_rowver of the rcu where rce_key = 446949
    [23/10/10 16:26:34:516 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 516, [XELLERATE. SERVER], class/method: tcDataObj/record is entered.
    [23/10/10 16:26:34:516 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 516, [XELLERATE. SERVER], class/method: tcDataObj/updated came.
    [23/10/10 16:26:34:516 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 516, [XELLERATE. SERVER], class/method: tcRCE/eventPreUpdate entered.
    [23/10/10 16:26:34:516 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 516, [XELLERATE. SERVER], class/method: tcRCE/checkClosed entered.
    [23/10/10 16:26:34:517 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 517, [XELLERATE. SERVER], class/method: tcRCE/checkClosed to the left.
    [23/10/10 16:26:34:517 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 517, [XELLERATE. SERVER], class/method: tcRCE/setActionPerStatus entered.
    [23/10/10 16:26:34:517 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 517, [XELLERATE. SERVER], class/method: tcRCE/setActionPerStatus to the left.
    [23/10/10 16:26:34:517 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 517, [XELLERATE. SERVER], class/method: tcRCE/checkAssignees entered.
    [23/10/10 16:26:34:517 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 517, [XELLERATE. SERVER], class/method: tcRCE/checkAssignees to the left.
    [23/10/10 16:26:34:517 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 517, [XELLERATE. SERVER], class/method: tcDataBase/readPartialStatement entered.
    [23/10/10 16:26:34:517 EDT] SystemOut O INFO 00000052, October 23, 2010 16:26:34, 517, [XELLERATE. DATABASE], DB read: select evt.evt_key, evt.evt_name, dob dob evt.evt_package, evt evt and dvt dvt where dob.dob_key = dvt.dob_key and dvt.evt_key = evt.evt_key and (dob.dob_name = 'com.thortech.xl.dataobj.tcRCE' or dob.dob_name = dob.dob_name = 'com.thortech.xl.dataobj.tcDataObj' or 'com.thortech.xl.dataobj.tcTableDataObj') and dvt.dvt_pre_update_sequence > 0 stopped by dvt.dvt_pre_update_sequence
    [23/10/10 16:26:34:517 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 517, [XELLERATE. DATABASE], select evt.evt_key, evt.evt_name, evt.evt_package dob dob, evt evt, dvt dvt where dob.dob_key = dvt.dob_key and dvt.evt_key = evt.evt_key and (dob.dob_name = 'com.thortech.xl.dataobj.tcRCE' or dob.dob_name = dob.dob_name = 'com.thortech.xl.dataobj.tcDataObj' or 'com.thortech.xl.dataobj.tcTableDataObj') and dvt.dvt_pre_update_sequence > 0 by dvt.dvt_pre_update_sequence order
    [23/10/10 16:26:34:521 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 521, [XELLERATE. SERVER], class/method: tcRCE/eventPreUpdate to the left.
    [23/10/10 16:26:34:521 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 521, [XELLERATE. SERVER], class/method: tcDataSet/hasUpdatedColumns entered.
    [23/10/10 16:26:34:521 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 521, [XELLERATE. SERVER], class/method: entered tcTableDataObj:getAllowedOperation.
    [23/10/10 16:26:34:521 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 521, [XELLERATE. SERVER], class/method: tcTableDataObj:getAllowedOperation - data: mstableName - value: NCE
    [23/10/10 16:26:34:522 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 522, [XELLERATE. SERVER], class/method: tcTableDataObj:getAllowedOperation: another entry.
    [23/10/10 16:26:34:522 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 522, [XELLERATE. SERVER], class/method: tcTableDataObj:getAllowedOperation:if entered moData.isNull.
    [23/10/10 16:26:34:522 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 522, [XELLERATE. SERVER], class/method: entered tcTableDataObj:preWrite.
    [23/10/10 16:26:34:522 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 522, [XELLERATE. SERVER], class/method: tcTableDataObj:preWrite left.
    [23/10/10 16:26:34:522 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 522, [XELLERATE. SERVER], class/method: entered tcTableDataObj:getPreparedStatementForUpdate.
    [23/10/10 16:26:34:522 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 522, [XELLERATE. SERVER], class/method: entered tcTableDataObj:getWhere.
    [23/10/10 16:26:34:522 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 522, [XELLERATE. SERVER], class/method: tcTableDataObj:getWhere - data: psKeyName - value: rce_key
    [23/10/10 16:26:34:522 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 522, [XELLERATE. SERVER], class/method: tcTableDataObj:getWhere - data: msKeyValue - value: 446949
    [23/10/10 16:26:34:522 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 522, [XELLERATE. SERVER], class/method: tcTableDataObj:getWhere left.
    [23/10/10 16:26:34:522 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 522, [XELLERATE. SERVER], class/method: tcTableDataObj:getPreparedStatementForUpdate left.
    [23/10/10 16:26:34:523 EDT] 00000052 SystemOut O DEBUG, October 23, 2010 16:26:34, 523, [XELLERATE. DATABASE], NCE update set RCE_STATUS =?, RCE_LAST_ACTION =?, RCE_UPDATE =?, RCE_rowver =? where rce_key = 475759and RCE_rowver = HEXTORAW('0000000000000000')
    [23/10/10 16:27:34:534 EDT] SystemOut O ERROR 00000052, October 23, 2010 16:27:34, 533, [XELLERATE. DATABASE], class/method: tcDataBase/writeStatement some problems: ORA-02049: timeout: distributed transaction waiting for lock

    java.sql.SQLException: ORA-02049: timeout: distributed transaction waiting for lock
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)

    Appreciate any help!



    Thank you
    IOM want to Be

    Published by: OimWannaBe on October 29, 2010 12:31

    I agree with what Martin said more sense...

    Also to check this on metalink

    ORA-02049 Timeout: Distributed Transaction waiting for lock during the creation of the user or the change. [466568.1 ID]

    Thank you
    Suren

  • Tables created in a stored procedure cannot be used with dynamic SQL? The impact?

    There is a thread on the forum which explains how to create tables within a stored procedure (How to create a table in a stored procedure , however, it does create a table as such, but not how to use it (insert, select, update, etc.) the table in the stored procedure.) Looking around and in the light of the tests, it seems that you need to use dynamic SQL statements to execute ddl in a stored procedure in Oracle DB. In addition, it also seems that you cannot use dynamic SQL statements for reuse (insert, select, update, etc.) the table that was created in the stored procedure? Is this really the case?

    If this is the case, I am afraid that if tables cannot be 'created and used"in a stored procedure using the dynamic SQL, as is the case with most of the servers of DB dynamic SQL is not a part of the implementation plan and, therefore, is quite expensive (slow). This is the case with Oracle, and if yes what is the performance impact? (Apparently, with Informix, yield loss is about 3 - 4 times, MS SQL - 4 - 5 times and so on).

    In summary, tables created within a stored procedure cannot be 'used' with dynamic SQL, and if so, what is the impact of performance as such?

    Thank you and best regards,
    Amedeo.

    Published by: AGF on March 17, 2009 10:51

    AGF says:
    Hi, Frank.

    Thank you for your response. I understand that the dynamic SQL is required in this context.

    Unfortunately, I am yet to discover "that seeks to" using temporary tables inside stored procedures. I'm helping a migration from MySQL to Oracle DB, and this was one of the dilemmas encountered. I'll post what is the attempt, when more.

    In Oracle, we use [global temporary Tables | http://www.psoug.org/reference/OLD/gtt.html?PHPSESSID=67b3adaeaf970906c5e037b23ed380c2] aka TWG these tables need only be created once everything like a normal table, but they act differently when they are used. The data inserted in TWG will be visible at the session that inserted data, allowing you to use the table for their own temporary needs while not collide with them of all sessions. The data of the TWG will be automatically deleted (if not deleted programmatically) when a) a commit is issued or b) the session ends according to the parameter that is used during the creation of the TWG. There is no real need in Oracle to create tables dynamically in code.

    I noticed that many people say that the "Creation of the tables within a stored procedure" is not a good idea, but nobody seems necessarily explain why? Think you could elaborate a little bit? Would be appreciated.

    The main reason is that when you come to compile PL/SQL code on the database, all explicit references to tables in the code must correspond to an existing table, otherwise a djab error will occur. This is necessary so that Oracle can validate the columns that are referenced, the data types of those columns etc.. These compilation controls are an important element to ensure that the compiled code is as error free as possible (there is no accounting for the logic of programmers though ;)).

    If you start to create tables dynamically in your PL/SQL code, so any time you want to reference this table you must ensure that you write your SQL queries dynamically too. Once you start doing this, then Oracle will not be able to validate your SQL syntax, check the types of data or SQL logic. This makes your code more difficult to write and harder to debug, because inevitably it contains errors. It also means that for example if you want to write a simple query to get that one out in a variable value (which would take a single line of SQL with static tables), you end up writing a dynamic slider all for her. Very heavy and very messy. You also get the situation in which, if you create tables dynamically in the code, you are also likely to drop tables dynamically in code. If it is a fixed table name, then in an environment multi-user, you get in a mess well when different user sessions are trying to determine if the table exists already or is the last one to use so they can drop etc. What headache! If you create tables with table names, then variable Dynamics not only make you a lot end up creating (and falling) of objects on the database, which can cause an overload on the update of the data dictionary, but how can ensure you that you clean the tables, if your code has an exception any. Indeed, you'll find yourself with redundant tables lying around on your database, may contain sensitive data that should be removed.

    With the TWG, you have none of these issues.

    Also, what is the impact on the performance of the dynamic SQL statements in Oracle? I read some contrasting opinions, some indicating that it is not a lot of difference between static SQL and SQL dynamic in more recent versions of Oracle DB (Re: why dynamic sql is slower than static sql is this true?)

    When the query runs on the database, there will be no difference in performance because it is just a request for enforcement in the SQL engine. Performance problems may occur if your dynamic query is not binding variable in the query correctly (because this would cause difficult analysis of the query rather than sweet), and also the extra time, to dynamically write the query running.

    Another risk of dynamic query is SQL injection which may result in a security risk on the database.

    Good programming will have little need for the tables of dynamically created dynamically or SQL.

Maybe you are looking for