No DDL in Oracle XAConnection - why?

As stated in
http://edocs.bea.com/wls/docs60/oracle/trxjdbcx.html#1080134
Oracle doesn't support ddl-Statements (create, drop etc.) in a XAConnection.
Is this a bug? DB2 does support ddl.
Does anyone know why?
I'm using Oracle 8i Release 3 (8.1.7) for Windows NT and even if I use the
OCI8Driver directly without an AppServer this occurs.
Thanks
Stefan.

manuel.leiria wrote:public String toString(){
StringBuffer sb = new StringBuffer();
sb.append("[") ;
sb.append("knr: " + knr + "; name: " + name + "; strasse: " + strasse + "; plz: " + plz + "; ort: " + ort );
sb.append("]") ;
return sb.toString();
Either use String Builder or string concatenation not both. The string concatenation adds a second String Builder to the mix.
You only really need a String Builder if you have a loop.

Similar Messages

  • DDL in stored procedures: why not?

    Hi all...
    I am an Oracle beginner and am using 8i to return data from oracle to ASP pages via ADO and ODBC.
    I created the necessary packages in my Oracle tablespace and they contained DDL - I have a very complex query which I don't want to have to encapsulate in one select statement. I want to create a number of temporary tables to store the intermediate data returned from the DB. Therefore I need to be able to have 'create table <name> as...' in my package. Once all the tables have been created I then want to drop them at the end of the procedure. This seems perfectly reasonable to me - what is the use of a stored procedure if you can create or drop a table?!?!
    So, my question is this: why is it that you can't have DDL in a package or stored procedure? I'm pretty sure both SQL Server and Sybase allow DDL in a stored proc - so why doesn't Oracle allow it?
    And if you really can't have DDL in an sp then what is the alternative?
    Hoep someone can help out a rank beginner here - thanks!!
    Mike.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Rasmus Mencke ([email protected]):
    Hi,
    You can use dynamic sql, it is very easy to do what you are trying to accomplease.
    Procedure test is
    sql_stmt varchar2(200); -- Variable to hold sql string
    BEGIN
    -- Create the SQL Statement
    sql_stmt := 'create table tmp (id number(1), text varchar2(200));'
    -- Fire the SQL Statement
    execute immediate sql_stmt;
    sql_stmt := 'drop table tmp';
    execute immediate sql_stmt;
    END;
    <HR></BLOCKQUOTE>
    Thanks Rasmus - I tried it but got errors. As you can see from the code below I am using a cursor to store the data to return to ADO in tables. To give you an idea of what I want to do here is my package body spec:
    CREATE OR REPLACE PACKAGE BODY Network_Elements_Report
    AS
    Procedure GetNetworkElements (
    i_Node IN VARCHAR2,
    NE_Node OUT tblNE_Node,
    NE_Type OUT tblNE_Type,
    EHA OUT tblEHA,
    Status OUT tblStatus,
    Curr_Func OUT tblCurr_Func,
    TP_Name OUT tblTP_Name,
    Order_Name OUT tblOrder_Name,
    Required_Start OUT tblRequired_Start,
    Required_End OUT tblRequired_End,
    Trail_Name OUT tblTrail_Name);
    SQL_stmt varchar2(200);
    IS
    CURSOR nerep_cur IS
    -- Just a simple execute immediate test!
    -- Actual SQL to go here much more
    -- complicated!!
    SQL_stmt := 'create table tmp as select * from nerep4;';
    execute immediate SQL_stmt ;
    SELECT NE_Node, NE_Type, EHA, Status, Curr_Func, TP_Name,
    Order_Item_Name, Required_Start, Required_End, Trail_Name
    FROM tmp
    WHERE NE_Node = i_Node
    SQL_stmt = 'drop table tmp;';
    execute immediate SQL_stmt ;
    recCount NUMBER DEFAULT 1;
    BEGIN
    FOR NE_Rec IN nerep_cur
    LOOP
    NE_Node(recCount) := NE_Rec.NE_Node;
    NE_Type(recCount) := NE_Rec.NE_Type;
    EHA(recCount) := NE_Rec.EHA;
    Status(recCount) := NE_Rec.Status;
    Curr_Func(recCount) := NE_Rec.Curr_Func;
    TP_Name(recCount) := NE_Rec.TP_Name;
    Order_Name(recCount) := NE_Rec.Order_Item_Name;
    Required_Start(recCount) := NE_Rec.Required_Start;
    Required_End(recCount) := NE_Rec.Required_End;
    Trail_Name(recCount) := NE_Rec.Trail_Name;
    recCount := recCount + 1;
    END LOOP;
    END GetNetworkElements;
    END Network_Elements_Report;
    When I run this I get Oracle error:
    "PLS-00103: Encountered the symbol "CURSOR" when expecting one of the following..." etc, etc.
    What have I got wrong here? Also, given that the actual SQL I want to execute is around 40 lines long and it creates 4 temp tables, can I store this is a seperate .SQL file and use execute immediate to use the contents of the SQL file? eg: execute immediate nerep.sql - I guess I mean like some sort of 'include' file.
    Hope this is slightly clearer than mud!!
    Thanks for your help...
    Mike.
    Bear in midn that
    The actual SQL I will have in

  • Getting objeects ddl in Oracle 8i

    Hi ,
    i believed there's no dbms_metadata package in 8i but how can i get the objects' ddl besides the export/import utility ?
    tks & rgds

    You need to stick to some custom SQL/PLSQL scripts then as mentioned e.g. in
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1464804639878#1817586421806
    But as Tom suggests: Why discard the export/import utilities?

  • Oracle 8i, Why would it accept date of 00-JUN-01 without an error

    I have an application (On Track for Training) written in power builder and using sqlnet. When the user signs on to the Oracle 8i Database, using ODBC driver 8.1.5.5, some of my users send an invalid date into a controlkey field. The format has a 00 day in the date field (00-JUN-01). We get no errors when the date gets stored - but it screws up my application for anyone else trying to sign into it. When the program sees that invalid date, it bombs out. Any record those users save while using the system also stores this invalid date format with no errors from Oracle. They only get an error when they try to view the record after it has been saved.
    Any ideas as to what could be looking like a valid date to Oracle but really is a 00 day? I just can't understand why it's not erroring out and stopping these people from creating havoc in the system. The software devlopers blame the ODBC driver - but no one seems to be able to tell me what about the ODBC driver could be wrong. I'm thinking it's a Windows/System .dll file that is getting overwritten any time these users install a new piece of software on their system. I just have no idea which ones to look at.
    Any help would be appreciated.

    Wierd! Regardless of what the ODBC driver does, the database should reject an invalid date. The fact that Oracle appears to be storing invalid data would seem to imply that the ODBC driver isn't at fault...
    I would tend to discount the possibility of an overwritten DLL causing this. Nothing that the client does should ever cause a database to store an invalid date. Most of the time, when there's a DLL conflict, the failures are a lot less subtle.
    I'd strongly suggest that you contact Oracle support about this. At a minimum, there's apparently a database bug. Probably, there's some sort of interaction between the ODBC driver, OCI (the API the ODBC driver uses to communicate with the database), and the database that allows the root bug to be manifested. There may even be bugs in the ODBC or OCI layers. It certainly sounds like this is a problem that someone will have to spend a few hours with some debugging tools to figure out what's going on.
    One other route you might try is updating all your components with the latest patchsets-- perhaps the bugs have already been identified & fixed. If you go to <ftp://oracle-ftp.oracle.com/server/patchsets/wgt_tech/server/windowsNT/81patchsets/>, you can grab the latest 8.1.5 and 8.1.6 patchsets (8.1.5.1.1 & 8.1.6.3.4). Update both your client & server with the appropriate patchset. Also, you can grab the 8.1.5.7 ODBC driver off of OTN and install that. If the problem goes away, life is good. If it doesn't, I think you're going to need support's help.
    Justin
    null

  • Use of JDBC to execute ddls in oracle database

    Hi,
    I am knew to the JDBC concepts. My requirement is to execute oracle database ddls from a JSP application. The ddls like 'Alter tablespace...', 'Alter session...' etc.. The application is using JDBC to connect to the database.
    Is there any option available to do this task using JDBC
    If not, then please let me know if there are any other ways to execute such statements from an application.
    Thanks

    shah wrote:
    Is there any option available to do this task using JDBC1. Find PL/SQL code that does this in a stored proc
    2. Run the stored proc from jdbc.
    If you can't do it in a proc then you can't do it from jdbc.
    If not, then please let me know if there are any other ways to execute such statements from an application.You can run scripts via the command line using sqlplus (character mode.)
    Sqlplus is an application.
    You can control any application (character based) in java via Runtime.exec/ProcessBuilder.

  • DDL Replicate Oracle 10gR2 to SQL Server 2005

    Dear Gurus,
    I have configured OGG and it had succeed to have DML transaction from Oracle to SQL Server.
    now i'm configuring DDL replication but have problem when i tried to start replicat program in SQL Server 2005, the status is abended.
    the log shows as below,
    ** Running with the following parameters **
    REPLICAT rora01
    sourcedb dsn_ncli, userid ggs_user, password ********
    2012-04-17 18:02:20 INFO OGG-01552 Connection String: provider=SQLNCLI;init
    ial catalog=gate;data source=BT-70CF7B38342B;user id=ggs_user;password= ********
    HANDLECOLLISIONS
    ASSUMETARGETDEFS
    DISCARDFILE ./dirrpt/rora01.dsc, PURGE
    DDL INCLUDE MAPPED
    DDLOPTIONS REPORT
    MAP hr.*, TARGET ggs_schema.*;
    2012-04-17 18:02:20 ERROR OGG-00899 Table GGS_SCHEMA.GGS_SETUP does not exist.
    Fyi, in hr schema in source database, GGS_SETUP is created after i Install GoldenGate DDL objects in source db. GGS_SCHEMA is schema that replicat schema in target database.
    Please help what should i add in replicat parameter to have this DDL works ?
    Regards,
    Andes
    Edited by: 915856 on Apr 17, 2012 10:16 PM

    Hi Steve,
    in Installation guide there is no explicit line that explain "DDL replication is not supported for SQL Server."
    but now i know, thanks for that.
    i have another question, so DDL replication only support between the same database like Oracle to Oracle, SQL Server to SQL Server etc. ?
    Regards,

  • Capture DDL for Oracle Scheduled Jobs and job from DBMA_JOBS

    I have trying at this for while and now I am stuck...so I need some help or advice.
    I am doing a DB migration and I need to capture the DDL for all Oracle Scheduled Jobs as well as DBMS_JOBS. Anyone have a good way?
    I took a datapump export last week. Can I run a impdp and capture the DDL for this VIA the sqlfile parameter? If so, how? What would be the script for it. Something like this maybe (par file)?
    directory=DP_IMPORT
    DUMPFILE=dump1.dmp
    SCHEMAS=A,B,C...X,Y,Z
    LOGFILE=JOBS.LOG
    EXCLUDE=TABLE,INDEX,CONSTRAINT
    PARALLEL=4
    INCLUDE=JOBS
    ????

    Hello,
    It's JOB, see following table for possible options , I recommend you to read throught this thoroughly before starting.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_metada.htm#BGBIEDIA
    Regards

  • Biztalk and ddl from Oracle

    I have a number of vendor databases with this same data in slightly different formats (some mssql 2008 som oracle 11g).
    What i need to do is try to map from all these data sets to an authoritative one . For instance DataSet1 from MSSQL2008 might contain a Dr. billing number but the billing address is their home address not the clinic address which I would get from DataSet2
    ona Oracle 11g data base for instance. Is there a way in biztalk to aggregate this data from these dispariate datasources and build an autoratative datasset in BT?
    Currently I have all the relevant datasets defined in DMD format in Oracle  SQl data modeler format is there a way to import that into BT and "link" the relevant fields?

    What you need to do is to convert your DMD into an XSD. The common representation will become the "common" schema. You will use this to build the process/orchestration/action for handling th Data.
    Then for every database you need to connect to, you will use the BizTalk Add Adapter Services (through VS) to generate DB instance specific schema. You will then create a MAP (for each unique instance) where you will map elements from the specific DB instance
    into the "common" schema. You will then create One Receive Port will multiple receive locations (every time you use Add Adapter Services, BizTalk will generate a Binding file for you which can be used to create the receive ports/locations). The MAP will need
    to be assigned to the Port.
    So when BizTalk will get the data from the specific database, the XML will be matched to the appropriate MAP which will convert it into a standard (common) representation.
    Regards.

  • "why the Psoft oracle DB and SID names should be in all upper case

    Customer is having a Question like
    "why the Psoft oracle DB and SID names should be in all upper case (according to the PsoftTools 8.50 Installation for Oracle manual)
    why the Peopletools 8.5 install book states all Oracle SID and database names should be in UpperCase.
    If we use lower case database name, would encounter any problems, what sort of problems?
    i Observed that all the Installation manual for 8.49,50,51 States the Same for Creating of Data base !
    Task 1-6-1: Determining Databases and Database Names
    You should also determine the names of the
    databases at this point, using database names that:
    • Are limited to eight characters, all UPPERCASE.
    • Capture information about the PeopleSoft product line and the type of database
    Please suggest on this !
    Thanks
    Bala

    user13798675 wrote:
    Customer is having a Question like
    "why the Psoft oracle DB and SID names should be in all upper case (according to the PsoftTools 8.50 Installation for Oracle manual)
    why the Peopletools 8.5 install book states all Oracle SID and database names should be in UpperCase.
    If we use lower case database name, would encounter any problems, what sort of problems?
    i Observed that all the Installation manual for 8.49,50,51 States the Same for Creating of Data base !
    Task 1-6-1: Determining Databases and Database Names
    You should also determine the names of the
    databases at this point, using database names that:
    • Are limited to eight characters, all UPPERCASE.
    • Capture information about the PeopleSoft product line and the type of database
    Please suggest on this !
    Thanks
    Balabcm@bcm-laptop:~$ env | grep ORA
    ORACLE_SID=v112
    ORACLE_BASE=/u01/app/oracle
    ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
    bcm@bcm-laptop:~$

  • Why did Oracle get rid of iSQLPlus?

    This is a question for Oracle. Why did you get rid of iSQLPlus without replacing its capbilities? Both SQL Developer and APEX are for developers, but the end user no longer has a web-based method for running SQL queries. What are they to use if they are unable to have the client installed on their server and are not allowed to logon to the Oracle server in order to useSQL Developer's query abilities? How can an administator limit an end-users APEX permissions to query-building only?

    I'm not Oracle, so I won't even give opinions on your question. some advice however - ask your last question on the APEX forum.

  • Why "exp" is invalid in SQL*Plus (Oracle 9i)

    When I run "exp ... " in SQL*Plus(Oracle 9i),why did it say "Unknown Command 'exp'..."??

    exp is not a SQL or SQL*Plus command. It is an application that can be invoked at the command line of your operating system.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • SQL Developer 3.2 - Export DDL challenge

    Hi,
    I would like to Export DDL for approximately 300 of 1000 objects in a schema.  I have the names of all required tables for which I'd like to get the DDL in a table in my personal schema.  Is there a way that I can use this table as a driver for the built-in Export DDL utility or will I need to either go to the schema browser and hand-pick each of the 300 tables and/or from the Tools-Export DDL "Specify Objects" window?
    I would like to make this more automated so that I dont have to keep clicking, scrolling, clicking my way through the list of required objects.  Any thoughts are appreciated, thanks.

    1008686 wrote:
    Hi,
    I would like to Export DDL for approximately 300 of 1000 objects in a schema.  I have the names of all required tables for which I'd like to get the DDL in a table in my personal schema.  Is there a way that I can use this table as a driver for the built-in Export DDL utility or will I need to either go to the schema browser and hand-pick each of the 300 tables and/or from the Tools-Export DDL "Specify Objects" window?
    I would like to make this more automated so that I dont have to keep clicking, scrolling, clicking my way through the list of required objects.  Any thoughts are appreciated, thanks.
    There is no way to use sql developer to do that.
    You can:
    1. do it manually as you suggest
    2. do it manually by writing a script that makes the appropriate DBMS_METADATA calls
    3. use expdp to extract the metadata and create a DDL file.
    The full DDL for a table will include a lot of components that many people don't even want, for example storage clauses.
    The bigger issue you should address is why you don't already have the DDL to begin with. Best practices are to create the DDL and keep it in a version control system; not extract it after the fact.
    I suggest you use the EXPDP utility to extract the DDL into a file so that you have it for future use.
    If you plan to write a script there are plenty of examples on the web that show how to do that. Here is one:
    http://www.colestock.com/blogs/2008/02/extracting-ddl-from-oracle-2-approaches.html

  • Check "Problem: Oracle Database 10g Release 2 can only be installed in new

    Hi All
    Installing 10g software on AIX Box in /oracle/oraHome2,where oracle9i is already installed in /oracle/oraHome1 and oracle inventory is in /oracle/inventory
    In product specific prerequisite screen I am getting the
    check:Oracle Home incompatibilties is failed I am getting the error
    Check complete. The overall result of this check is: Passed
    =======================================================================
    Checking for Oracle Home incompatibilities ....
    Actual Result: Oracle9i Database 9.2.0.1.0
    Check complete. The overall result of this check is: Failed <<<<
    Problem: Oracle Database 10g Release 2 can only be installed in a new Oracle Home
    Recommendation: Choose a new Oracle Home for installing this product
    though I am installing it in different oracle homes why i am getting this error?
    Is it because 10g installation is picking the same oracle inventory /oracle/inventory
    do i need to make different oracle inventory for different oracle homes???????plz confirm..is thats the reason i am getting this error??????
    Thanks inadvance
    Gagan

    I figure out you are trying to install 10gR2 on top of an existing 9iR2 Oracle Home. This is corrected at the Path definition window. Most probably you just click on the <Next> and by default the 9iR2 Oracle Home was selected. You must define a new oracle home for the 10gR2 install.
    ~ Madrid

  • Can not compile php with "-with-oracle=/usr/local/oracle"

    I work on Linux engine with a x86_64 architecture and use Oracle 10g 10.2.0.1 client for x86_64 linux
    so - when i try to compile php with the oracle argument (-with-oracle=/usr/local/oracle) i get everytime the same error:
    checking Oracle version... configure: error: Oracle needed libraries not found
    I think, maybe i have a problem because configure not found my "64 bit libraries"...
    Can someone help me? I am realy helpless...
    thx

    Did you really want the obsolete "oracle" driver - why not use --with-oci8?
    The user comments in http://www.php.net/oci8 have some good info on 64bit configuration.

  • Create MVs in Oracle 10g DB from Oracle 9i DB using DB link

    The tables of an Oracle 10g database is formed mainly (about 90%) from materialized views. These views are created using a database link extracting the data from an existing Oracle 9i database (10g connecting to 9i).
    The MVs created from simple queries does not take much time, but whenever a query contains "joins", time freezes and after four hours no results are registered independently of the database volume or number of transactions.
    But in case the MVs are created in an Oracle 9i database (9i connecting to 9i), the full creation time varies from four minutes to twenty minutes (about 1,200,000 transactions).
    All possible scenarios related to hardware and networking were tested and excluded.
    The resolution of this issue is very urgent because it is preventing our institution from upgrading to Oracle 10g.

    Why post this one into the OTN Feedback Forum rather than a more appropriate like General Database Discussions ?<br>
    <br>
    Nicolas.

Maybe you are looking for

  • XML to URL Encoded (XSLT?)

    I have some data in a Document object and need to convert it to URL encoded format so, for example this: <share> <code>GSK</code> <price>13.34</price> </share> becomes something like... &code=GSK&price=13.34& ... I've been looking into doing this wit

  • External hard drive format that can be usable for both MBP and TVs?

    I recently bought a new MBP and found out I can not copy and paste files to my external hard drive as it appears to be 'Read- Only' because of the format. I then changed the hard drive's format to FAT32, which I was able to write files on it from MBP

  • Naming convention in template css file

    Is there a specific reason for having the theme "name" hardcoded in many css definitions ? For example consider the css for the rows in a report: In the css files for each theme it is defined in a different way: Theme1: td.t1data Theme2: td.t2data Th

  • Parse a XML

    Hello, I'm parsing a xml-like file but I have few problems in using some method; for example: NodeList listOfStates = doc.getElementsByTagName("state"); //I have tags <state attr="value".........>; but what about if I had <State...> or <STATE>???? My

  • More themes questions

    My partner has a new N95 8GB phone. We found a theme she liked which was supposedly for the N95 8GB. We installed the theme using Nokia Suite, but received an error message on installation that the theme is incompatible for that phone continue? Shoul