CodeSmith Community
Your Code. Your Way. Faster!

The "Unofficial" Oracle Schema Provider For CodeSmith

Latest post 09-26-2006 1:51 PM by onderorgun. 39 replies.
  • 03-24-2006 5:27 AM In reply to

    • stevec
    • Top 500 Contributor
    • Joined on 12-13-2005
    • Newbury, Berks, UK
    • Posts 18
    • Points 435

    Re: RE: The "Unofficial" Oracle Schema Provider For CodeSmith

    ChristianASPNET wrote:
    Hi Steve,

    My first guess is that you will need to recompile the provider using VS2005.  Typically, providers written for previous versions of CodeSmith have to be recompiled to work in later versions.

    Best Regards,
    David

    Thanks for the response David 

    Yeap that's sorted it  Yes [Y]

     

    Cheers,
    Steve C.
    • Post Points: 5
  • 05-15-2006 6:59 AM In reply to

    • tze
    • Not Ranked
    • Joined on 05-12-2006
    • Posts 3
    • Points 10

    Re: The "Unofficial" Oracle Schema Provider For CodeSmith

    Hi,

    i'm trying to load the property set with a oracle schema provider TableSchema property. I saved the property file with the CodeSmith Studio.
    The load operation returns this error: 

    System.ArgumentNullException: Value cannot be null.
    Parameter name: type
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
       at SchemaExplorer.TableSchemaTypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
       at CodeSmith.Engine.CodeTemplate.RestorePropertiesFromXml(String properties, String baseDirectory)
       at CodeSmith.Engine.CodeTemplate.RestorePropertiesFromXmlFile(String xmlFilePath)
       at CodeSmith.Gui.EnhancedPropertyGridControl.LoadPropertySetXMLMenuItem_Click(Object sender, EventArgs e)

    Any suggestions what's going wrong? I'm using CodeSmith 3.1.6 Build 594 with a specific build of the OracleNativeSchemaProvider. The property set element looks like this:

      <property name="SourceTable">
       <connectionString>Data Source=OraDB;User Id=us;Password=pw;Integrated Security=no;</connectionString>
       <providerType>SchemaExplorer.OracleNativeSchemaProvider,SchemaExplorer.OracleNativeSchemaProvider</providerType>
       <table>
        <owner />
        <name>TableName</name>
       </table>
      </property>

    • Post Points: 5
  • 05-17-2006 1:37 AM In reply to

    • tze
    • Not Ranked
    • Joined on 05-12-2006
    • Posts 3
    • Points 10

    Re: The "Unofficial" Oracle Schema Provider For CodeSmith

    Take care where copies of the OracleNativeSchemaProvider.dll exists. The problem was a copy in the directory c:\program files\codesmith\v3.0.

    Now it works fine!

    • Post Points: 5
  • 06-05-2006 8:15 AM In reply to

    • jesuissur
    • Top 500 Contributor
    • Joined on 06-01-2006
    • Posts 9
    • Points 55

    'MemberColumnSchema' fix / Re: The "Unofficial" Oracle Schema Provider For CodeSmith

    Hi,

    For those using the version 3.2.7.955 (and maybe some builds before...) and the "Unofficial" Oracle Schema Provider, this is a fix for the exception [Unexpected SchemaExplorer type 'MemberColumnSchema' encountered].

    In our test, this fix seems to work fine but we've only tested with 2 templates. Then, for those "Unofficial" Oracle Schema Provider's experts, you can review the small update in the file "OracleNativeSchemaProvider.cs" and the public method "GetExtendedProperties".

    We simply added the "MemberColumnSchema" case.

    Attachment contains the updated code source and the SchemaExplorer.OracleNativeSchemaProvider DLL file compiled against the version "3.2.7.955" of SchemaExplorer.
    • Post Points: 35
  • 07-24-2006 1:56 AM In reply to

    • asegela
    • Top 500 Contributor
    • Joined on 03-09-2006
    • Posts 11
    • Points 260

    Re: 'MemberColumnSchema' fix / Re: The "Unofficial" Oracle Schema Provider For CodeSmith

    Hi there,

    I can't get the Oracle Provider running with the NetTiers templates. I downloaded the latest CodeSmith version 3.2.7.955 and recompiled the provided source code against this version. Finally I got the Oracle Provider showing up in the provider list with all tables and views of the database. But there is no code generated and the list of tables disappear after each run.

    There are similar topics on the provider download site covering this subject but I could not find any solution. Is there anyone how solved the problem?

    • Post Points: 35
  • 09-11-2006 2:57 PM In reply to

    • orionMD
    • Top 500 Contributor
    • Joined on 06-17-2006
    • Posts 11
    • Points 235

    Re: 'MemberColumnSchema' fix / Re: The "Unofficial" Oracle Schema Provider For CodeSmith

    I'm having the same issue, were you able to find a solution?

    thanks

    • Post Points: 5
  • 09-13-2006 10:43 AM In reply to

    Re: The "Unofficial" Oracle Schema Provider For CodeSmith

    Hi!

    We've found an issue in the 3.2.7.955 version of the SchemaProvider: If there were multiple columns in a foreign key constraint, it reported these columns incorrectly. I don't know, if there were any fixes for this problem, but here is one:

    To solve the problem, one should change the "sql" string in the "GetTableKeys" function to the following:

    string sql = string.Format(

    @"select

    cols.constraint_name,

    cols.column_name,

    cols.position,

    r_cons.table_name related_table_name,

    r_cols.column_name related_column_name

    from

    all_constraints cons,

    all_cons_columns cols,

    all_constraints r_cons,

    all_cons_columns r_cols

    where cons.OWNER = '{0}'

    and cons.table_name = '{1}'

    and cons.constraint_type='R'

    and cols.owner = cons.owner

    and cols.table_name = cons.table_name

    and cols.constraint_name = cons.constraint_name

    and r_cols.owner = cons.r_owner

    and r_cols.constraint_name = cons.r_constraint_name

    and r_cons.owner = r_cols.owner

    and r_cons.table_name = r_cols.table_name

    and r_cons.constraint_name = r_cols.constraint_name

    and cols.position= r_cols.position

    order by cons.constraint_name, cols.position",

    table.Owner,

    table.Name);

     

    Robert

    • Post Points: 5
  • 09-26-2006 1:50 PM In reply to

    Re: RE: The "Unofficial" Oracle Schema Provider For CodeSmith

     Hi,

      I just started to use codesmith with Oracle database ( version > 9 ) and currenly evaluating.
      I configured oracle-native-shema-provider and tested my connection. It is ok.
      But when I try to create stored procedures witt AllStoredProcedures.cst (shipped with the product), I receive the following error:

    Column 'constraint_name' does not belong to table Table.

    An error of type "ArgumentException" occured while attempting to execute this template.  To enable Just-In-Time debugging on this template set the "Debug" attribute to "True" in the "CodeTemplate" directive and add a "Debugger.Break()" statement in the template.


    System.ArgumentException: Column 'constraint_name' does not belong to table Table.
       at System.Data.DataRow.GetDataColumn(String columnName)
       at System.Data.DataRow.get_Item(String columnName)
       at SchemaExplorer.OracleNativeSchemaProvider.GetTablePrimaryKey(String connectionString, TableSchema table)
       at SchemaExplorer.TableSchema.get_HasPrimaryKey()
       at _CodeSmith.AllStoredProcedures_cst.__RenderMethod1(TextWriter writer, Control control)
       at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
       at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
       at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
       at CodeSmith.Engine.CodeTemplate.RenderToString()
       at ej.s()

     I have tried other templates (Oracle specific) but none of the worked and I always received the same error.

     Do I make something wrong?

     Thanks...
    M. Onder Orgun

    • Post Points: 5
  • 09-26-2006 1:50 PM In reply to

    Re: RE: The "Unofficial" Oracle Schema Provider For CodeSmith

     Hi,

      I just started to use codesmith with Oracle database ( version >  9 ) and currenly evaluating.
      I configured oracle-native-shema-provider and tested my connection. It is ok.
      But when I try to create stored procedures witt AllStoredProcedures.cst (shipped with the product), I receive the following error:

    Column 'constraint_name' does not belong to table Table.

    An error of type "ArgumentException" occured while attempting to execute this template.  To enable Just-In-Time debugging on this template set the "Debug" attribute to "True" in the "CodeTemplate" directive and add a "Debugger.Break()" statement in the template.


    System.ArgumentException: Column 'constraint_name' does not belong to table Table.
       at System.Data.DataRow.GetDataColumn(String columnName)
       at System.Data.DataRow.get_Item(String columnName)
       at SchemaExplorer.OracleNativeSchemaProvider.GetTablePrimaryKey(String connectionString, TableSchema table)
       at SchemaExplorer.TableSchema.get_HasPrimaryKey()
       at _CodeSmith.AllStoredProcedures_cst.__RenderMethod1(TextWriter writer, Control control)
       at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
       at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
       at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
       at CodeSmith.Engine.CodeTemplate.RenderToString()
       at ej.s()

     I have tried other templates (those written for Oracle)  but none of the worked and I always received the same error.

     Do I make something wrong?

     Thanks...
    M. Onder Orgun

    • Post Points: 5
  • 09-26-2006 1:51 PM In reply to

    Re: RE: The "Unofficial" Oracle Schema Provider For CodeSmith

     Hi,

      I just started to use codesmith with Oracle database ( version >  9 ) and currenly evaluating.
      I configured oracle-native-shema-provider and tested my connection. It is ok.
      But when I try to create stored procedures witt AllStoredProcedures.cst (shipped with the product), I receive the following error:

    Column 'constraint_name' does not belong to table Table.

    An error of type "ArgumentException" occured while attempting to execute this template.  To enable Just-In-Time debugging on this template set the "Debug" attribute to "True" in the "CodeTemplate" directive and add a "Debugger.Break()" statement in the template.


    System.ArgumentException: Column 'constraint_name' does not belong to table Table.
       at System.Data.DataRow.GetDataColumn(String columnName)
       at System.Data.DataRow.get_Item(String columnName)
       at SchemaExplorer.OracleNativeSchemaProvider.GetTablePrimaryKey(String connectionString, TableSchema table)
       at SchemaExplorer.TableSchema.get_HasPrimaryKey()
       at _CodeSmith.AllStoredProcedures_cst.__RenderMethod1(TextWriter writer, Control control)
       at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
       at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
       at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
       at CodeSmith.Engine.CodeTemplate.RenderToString()
       at ej.s()

     I have tried other templates (those written for Oracle)  but none of the worked and I always received the same error.

     Do I make something wrong?

     Thanks...
    Onder Orgun

    • Post Points: 5
Page 3 of 3 (40 items) < Previous 1 2 3 | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems