JSF, TopLink and NVarchar

I'm using JSF with Toplink for our website. One of our tables has NVarchar2 column which supports UTF16 as national character set.
Previous in JDBC we were setting statement.setFormOfUse(1, Const.NCHAR) to force updating or inserting this column as NChar.
How can I do that here, since I don't have a connection or control over these statements.
i.e. How can I force insertion for NVarchar in toplink.
Thanks.

Thank you Doug for your information. I tried to see some examples but I could figure out how to implement it in my code. I'm new in that technology.
the example:
// Create TypeConversionConverter instance
TypeConversionConverter typeConversionConverter = new TypeConversionConverter();
typeConversionConverter.setDataClass();
typeConversionConverter.setObjectClass();
// Set TypeConversionConverter on ArrayMapping
ArrayMapping arrayMapping = new ArrayMapping();
arrayMapping.setValueConverter(typeConversionConverter);
arrayMapping.setAttributeName("responsibilities");
arrayMapping.setStructureName("Responsibilities_t");
arrayMapping.setFieldName("RESPONSIBILITIES");
orDescriptor.addMapping(arrayMapping);
My Table is: Brand, and the NVarchar2 Field is : Unicode_Name.
Can you help me out please.
Also what is orDescriptor ? from where can I get it. the only descriptor I know in my project is faces-config.xml.
Thank you for your help in advance.

Similar Messages

  • Deploying jdeveloper's jsf toplink ejb application to jboss4.0.4

    hi java/j2ee developers,
    we developed a application using jdeveloper ide using jsf,toplink and ejb technologies, when we deploying this application to jboss4.0.4 application server we are getting the following exception
    org.jboss.deployment.DeploymentException: Failed to parse WEB-INF/web.xml; - nested throwable: (org.jboss.deployment.DeploymentException: expected one local-home tag)
    at org.jboss.web.AbstractWebContainer.parseMetaData(AbstractWebContainer.java:749)
    at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:356)
    if anybody knows how to solv e this one, please give us the reply as soon as possible,Thanks In Advance.we are waiting for your kind information.Thank you once again.

    Basically I started to develop this system inside Oracle AS and then when it came time to passing a request to a new page, it crapped out on me on the App. Server. So instead of trying to fix the problem there and then I continued to develop outside Portal and inside Jdeveloper. After a week or two once all my stuff worked perfectly I try and take it back into Portal but only the first JSP of all my Portlets would show up, because as soon as I would submit a form and the action directed me to a new page and Portal would be lost/confused. Obviously I shouldn't have done it that way but none the less...
    So now I'm reading through the documentation you pointed me towards and it seems I have to qualify my parameters and then "attach" them to the url which the form will pass to the actioned page. I'm importing numerous classes (...urlUtils, etc) in order to qualify the parameters and then build this url without affecting any parameters currently present that my portlet does not own.
    What I'm rambling towards here is all this separation of logic and presentation and the whole nine, implies different people can develop different parts of a 'system' mostly independant of one another...so in my situation I shouldn't in huge trouble yet, since underlying everything is a working system. My issue is with oracle and the App Server. If I take my code which works great outside of the App. Server and I fully qualify parameters and make sure my form actions are constructed using the UrlUtils in order to fully qualify them as well, and then I make sure page parameters are mapped to the proper portlet parameter values....should my system work on the App Server (assuming everything is done properly)....or am I still missing something.

  • JDeveloper, Toplink, and ADF advice.

    We have application that was completely developed JDeveloper 10.1.3/4 with Toplink, JSF, ADF, and Session Facade; extremely similar to the SRDemo.
    I am want to upgrade to JDeveloper 11g; however, the ADF Faces JSF will be migrated to Apache MyFaces Trinidad.
    1. Why would this be better than migrating to ADF Faces 11g? Pros and cons?
    2. Is Apache MyFaces Trinidad the future of Oracle's ADF?
    3. What would be the best approach for upgrade to Toplink and ADF 11g?
    Thank you.

    1. Why would this be better than migrating to ADF Faces 11g? Pros and cons?It won't be better than using ADF Faces 11g - it is just more feasible for automatic conversion - we can't do automatic conversion from ADF FAces 10.1.3 to ADF Faces 11g since the UI capabilities are so drastically different. We migrate to Trinidad to allow you to combine Trinidad and ADF Faces 11g in the same application. (You can't use ADF Faces 10.1.3 and 11g in the same application).
    2. Is Apache MyFaces Trinidad the future of Oracle's ADF?No. ADF Faces Rich Client is the present and future. Those are based on Trinidad.
    3. What would be the best approach for upgrade to Toplink and ADF 11g?The basic thing to do is open the application in JDeveloper 11g - things should work after the migration.
    Then you can start leveraging new capabilities such as the new ADF Faces 11g UI in new parts of the application.
    You might want to ask on the TopLink forum if they have any specific migration tips.

  • Desktop Conference 2005 includes Java, TopLink and more

    Checkout Desktop Conference 2005 (www.desktopconference2005.org or www.odtug.com) for information on Desktop Conference 2005, the virtual conference webcast sponsored by Oracle, ODTUG, and BIDW SIG of OAUG. It's powered by Oracle's Collaboration Suite Web Conferencing and features all-star presenters and exceptional technical content February 15-17. Since it's virtual, there's no need to travel. All you need is a PC and internet connection.
    Java/J2EE topics include J2EE, Web Services, JSF, Struts, ADF, BPEL, Frameworks, TopLink and more. Java/J2EE experts include Rod Johnson, Bruce Tate, Richard Monson-Haefel, Paul Dorsey, Toon Koppelaars, and Sri Rajan.
    Oracle Java/J2EE experts include Dai Clegg, Duncan Mills, Avrom Faderman, Steven Davelaar, Frank Nimphius, Tugdual Grall, Sue Harper, Jonas Jacobi, Anuj Jain, Stacen Anderson, Katarina Obradovic-Sarkic, and David Shaffer.
    Great keynotes addresses include Oracle's Thomas Kurian, Senior VP, Development OAS. The conference has a lot to offer so I hope you can check it out. Thanks. Maggie Tompkins

    There are several sessions done by the JDeveloper Product Management as well as several sessions done by othre users of JDeveloper. Check out both the Java track and the Oracle track.
    See the detailed agenda here:
    http://www.desktopconference2005.org/03-agenda/index.html
    Can be a nice opportunity to "go" to a conference if your company is on a tight travel budget.

  • TopLink and Stored Procedures

    Hi all
    We are migrating an application made with MS ASP's to a full blown J2EE application using ADF, JSF and toplink, atm we've used the mapping abilities from toplink and have saved lots of work, however i'd like to know if there's aw ay to map the Stored procedures the same way you map the tables. This would be a great time saving routine, if not available we might have to write it but I thought we would ask here first. Any pointers?
    greetings!

    TopLink does fully support invoking stored procedures for any query. It is not available in the graphical mapping editors but is available through the API. Look in the documentation for StoredProcedureCall.
    Doug

  • Why exactly is a JSF IMP and a API, what is the difference?

    Why exactly is a JSF IMP and a API, what is the difference?
    I understand that JavaServer Faces technology is a framework for building user interfaces for web applications with a set of APIs for UI components and a custom tag library for expressing a JavaServer Faces interface within a JSP page.
    But, why is there a jsf-impl.jar and a jsf-api.jar?
    A clarification would be appreciated.
    Thanks,

    CowKing: Thank you.
    In a discussion, when a developer refers to RI, they mean the jsf-api.jar only?
    I don't need the jsf-impl.jar in my compile class path nor in my SJSAS 8.2 domain library directory either?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • JSF 2 and Primefaces with  WLS 11gR1(10.3.6) problem

    Hi all,
    I would like to create a web application in OEPE, which uses JSF 2 and Primefaces 3.2 and then deploy & develop onto WLS.
    I added the primefaces jar to WEB-INF/lib.
    See my publishing stacktrace below.
    (I tried using the Shared JSF libraries and including jsf-api and impl in WEB-INF/lib, but neither of these options worked.)
    Do you have any ideas what I am doing wrong? Thanks,
    András Liter
    <2012.04.14. 21:32:21 CEST> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Unexpected exception when attempting to tear down the Mojarra runtime
    java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
         at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)
         at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)
         at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:104)
         at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:309)
         at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:482)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.EventsManager.notifyContextDestroyedEvent(EventsManager.java:200)
         at weblogic.servlet.internal.WebAppServletContext.destroy(WebAppServletContext.java:3225)
         at weblogic.servlet.internal.ServletContextManager.destroyContext(ServletContextManager.java:247)
         at weblogic.servlet.internal.HttpServer.unloadWebApp(HttpServer.java:461)
         at weblogic.servlet.internal.WebAppModule.destroyContexts(WebAppModule.java:1545)
         at weblogic.servlet.internal.WebAppModule.deactivate(WebAppModule.java:509)
         at weblogic.application.internal.flow.ModuleStateDriver$2.previous(ModuleStateDriver.java:387)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
         at weblogic.application.internal.flow.ModuleStateDriver.deactivate(ModuleStateDriver.java:141)
         at weblogic.application.internal.flow.ScopedModuleDriver.deactivate(ScopedModuleDriver.java:206)
         at weblogic.application.internal.flow.ModuleListenerInvoker.deactivate(ModuleListenerInvoker.java:261)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$2.previous(DeploymentCallbackFlow.java:547)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:192)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:184)
         at weblogic.application.internal.BaseDeployment$2.previous(BaseDeployment.java:677)
         at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:63)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
         at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:59)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
         at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:149)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    >
    <2012.04.14. 21:32:21 CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1334431938841' for task '32'. Error is: 'weblogic.application.ModuleException: '
    weblogic.application.ModuleException:
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1520)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:484)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
         Truncated. see log file for complete stacktrace
    Caused By: java.io.FileNotFoundException: \Oracle\Middleware\Oracle_OSB1\soa\connectors\FileAdapter.rar!fileAdapter.jar (The system cannot find the file specified)
         at java.util.zip.ZipFile.open(Native Method)
         at java.util.zip.ZipFile.<init>(ZipFile.java:127)
         at java.util.jar.JarFile.<init>(JarFile.java:135)
         at java.util.jar.JarFile.<init>(JarFile.java:72)
         at com.sun.faces.facelets.util.Classpath.getAlternativeJarFile(Classpath.java:252)
         Truncated. see log file for complete stacktrace

    Hi --
    I just tried using OEPE 11.1.1.8.0 against a WLS 10.3.6.0 install to build and deploy a JSF 2.0 application and it worked successfully.
    The project is here if you want to take a look:
    http://dl.dropbox.com/u/15657493/oepe-test-jsf2.zip
    The only minor gotcha I found was that I needed to reorder the libraries on the project so that the Shared-Library[jsf] was higher than the WebLogic System Library - this then let me use the JSF 2.0 programming API successfully instead of the 1.2 version that is included in the WLS System Library.
    Here's a couple of screen shots of the facet and project as well as the overall development environment:
    http://dl.dropbox.com/u/15657493/oepe-jsf-facet.png
    http://dl.dropbox.com/u/15657493/oepe-project-libs.png
    http://dl.dropbox.com/u/15657493/oepe.png
    For that zip file error, one thing perhaps is to Check your CLASSPATH setting to see if it has an entry for that FileAdapter.rar. I don't know why it's causing that problem but if it's in the CLASSPATH try removing it and then starting the server.

  • JSF, Springs and Hibernate

    Hi,
    I am a newbie. I would like to know the books i need to refer to, inorder to learn JSF, springs and hibernate.
    Thank you,

    The_Matrix wrote:
    CeciNEstPasUnProgrammeur wrote:
    How about learning Java first?
    At least for JSPs, there are free online tutorials from Sun. There are likely to be similar resources for Spring and Hibernate.I Know Java. I am a Sun Certified Java Programmer. I also know know J2EE. I am trying to learn the new technologies. Therefore i mentioned that i am a newbie, it was pertianing to JSF, Springs and Hibernate. Not to Java.In that case:
    Core Java Server Faces (2nd edition)
    Java Persistence with Hibernate
    Pro Spring 2.5
    Expert Spring MVC and Web Flow
    Together with the product documentation those should make a decent bit of reading.

  • JSF Implementation and accessibility

    I'm using de Sun JSF Implementation and having some troubles with accessibility issues. The HTML generated by the renderers are validated to WAI (Web Accessibility Initiative)? Should I reimplement the renderers to attempt to use screen readers, for example?

    Which implementation version exactly? Which problem exactly? There were fairly a lot of fixes regarding '508 compliance' during the existence of the JSF 1.2 implementation. Pick the latest, currently 1.2_10, and see if it solves your problem.

  • Jsf-api and jsf-ri logging

    The source code is available for the jsf-api and the jsf-ri libraries. Reading through some of it, I noticed that commons-logging was being used such as log.warn and log.debug.
    How can we "turn it on"? It looks as though log.warn is already written to the SunAppServer8 log file within JSC. I changed all of the app server log levels to FINE via the server's property sheet, but it had no effect. Thanks.
    Message was edited by:
    jeff.daily

    See if this helps:
    http://wiki.java.net/bin/view/Projects/SunJSFImplFaq#TurnOnLogging
    Sandip

  • BUG!?! Toplink and XE in Jdev 10g Rel 3 SU4

    Good ... evening/morning ... everyone! :-)
    Trying to follow (teach using) the tutorial on creating an Web App using Toplink
    and ADF Faces. After creating the Map I am getting problems on the Java object
    generation. I get the exception:
    java.lang.NullPointerException
    at oracle.ideimpl.log.TabbedLogManager.getMsgPag (TabbedLogManager.java:101)
    at oracle.toplink.addin.log.POJOGenerationLoggingAdapter.updateTask(POJOGenerationLoggingAdapter.java:42)
    at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.fireTaskUpdated(MappingCreatorImpl.java:1049)
    at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:231)
    at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:201)
    at oracle.toplink.addin.wizard.jobgeneration.JobWizard$1.construct(JobWizard.java:401)
    at oracle.ide.util.SwingWorker$1.run(SwingWorker.java:119)
    at java.lang.Thread.run(Thread.java:595)
    and JDev get in a endless loop in the generation progress dialog. The only
    difference from the tutorial setting is XE instead of a full server!
    Hope someone have some hints; just let me know if further details of the setting
    is needed!
    Dan.

    Good ... evening/morning ... everyone! :-)
    Trying to follow (teach using) the tutorial on creating an Web App using Toplink
    and ADF Faces. After creating the Map I am getting problems on the Java object
    generation. I get the exception:
    java.lang.NullPointerException
    at oracle.ideimpl.log.TabbedLogManager.getMsgPag (TabbedLogManager.java:101)
    at oracle.toplink.addin.log.POJOGenerationLoggingAdapter.updateTask(POJOGenerationLoggingAdapter.java:42)
    at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.fireTaskUpdated(MappingCreatorImpl.java:1049)
    at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:231)
    at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:201)
    at oracle.toplink.addin.wizard.jobgeneration.JobWizard$1.construct(JobWizard.java:401)
    at oracle.ide.util.SwingWorker$1.run(SwingWorker.java:119)
    at java.lang.Thread.run(Thread.java:595)
    and JDev get in a endless loop in the generation progress dialog. The only
    difference from the tutorial setting is XE instead of a full server!
    Hope someone have some hints; just let me know if further details of the setting
    is needed!
    Dan.

  • Toplink and VPD

    Hi,
    In a three-tier architecture, has anyone successfully implemented VPD in combination with Toplink and a ConnectionPool?
    When all my web-users are connecting to the database with the same (connection pool) credentials, how, when and where do I tell my database who is really logged in (web-user) and thus how to set the specific VPD for that web-user?
    Thanks. I already read another post on this forum mentioning that VPD support would be included in an upcoming release of TopLink.
    Re: toplink and Oracle VPD
    I also heard of a patch to download. Can anyone verify this?

    Just to add an extra question: Is it true that when one is using chained Toplink actions in a request-response cycle that each action will fetch its own connection from the pool and thus for each time a connection is fetched the VPD needs to be set again?
    This in contrast with BC4J, where all actions in a request-response cycle will share the same application module and thus the same connection.
    Bottom line: how to configure Toplink so that for each fetched connection it tells the database: "Hey, its me again, please set the application context (VPD) to my own personal values, so I will only see my own records"?
    . And to clean it up nicely: just before the connection is released to the pool: "Ok, I'm done, please reset the application context, so other users will not be bothered by my context".
    Hard to believe nobody has tried this before.

  • What are the difference between TopLink and TopLink Essentials...?

    What are the difference between TopLink, TopLink Essentials, EclipseLink and TopLink Essentials-GlassFish?
    What is the difference of their functions?
    Edited by: qkc on Nov 21, 2009 10:52 AM

    Difference between TopLink and ToPLink Essentials:
    TopLink Essentials are the reference implementation (RI) of JPA, is an open source effort that is licensed under the Common Development and Distribution License (CDDL) v1.0. It can be freely downloaded and used under the terms of this license agreement. This means, you can only use it for the management of persistence and orm with Java EE and Java SE. The binary distribution of TopLink consist of 2 jars:
    * toplink-essentials-agent.jar: contains Java Persistence API; XML Schemas and TopLink essentials implementation
    * toplink-essentials.jar: contains java agent class requires in a standolane Java SE application
    In addition to TopLink Essentials that makes the JPA implementation alive, Oracle offers its Oracle TopLink product (10.1.3) that contains an earlier preview binary of JPA and also offers developers additional object-relational capabilities, object-XML mapping (JAXB), non-relational mapping using Java 2.0 Connector Architecture (JCA).
    Let's wait other person to answer these questions.

  • ADF Faces: is mixing JSF RI and ADF Faces tags supported?

    Hi,
    I'm looking at ADF Faces as a future possibility for our application that is currently based on JSF RI.
    When looking at the ADF Faces demo it strikes me that all pages are almost completely built up from ADF Faces tags.
    For instance
    af:form
    af:commandButton
    af:inputText
    are used instead of the equivalent core jsf tags f:form, f:commandButton and f:inputText
    I'm wondering if this is mandatory if we would like to use some ADF Faces components mixed within our existing application.
    In other words: are ADF Faces tags supported in the environment of conventional JSF tags? And mixing ADF Faces JSF components with JSF components by other vendors?
    Another thing that strikes me is that pages are constructed using ADF Faces tags for any and all markup content.
    I guess this is meant to support several different clients (normal browser applications, mobile clients, voice activation over telephone) using different renderers.
    In my experience abstracting markup this way inherently means loss of control over the exact markup that is sent to the client. This is not acceptable for all projects and customers.
    Is embedding ADF Faces tags within template HTML, within f:verbatim tags or not, supported?
    Regards,
    Joost de Vries

    You absolutely can mix JSF RI and ADF Faces tags. This is very much supported! You can swap in <h:form> and <h:commandButton> and <h:inputText>. Our versions support some features that the JSF tags do not, as described in our release notes.
    Your point about using tags to produce all markup is a very cogent one. For some projects, absolute control over HTML will be a necessary requirement, so we do support that style of development. But we believe strongly that the future does not lie in constant handcoding of HTML, but instead in building more powerful, flexible, and reusable components and assembling those into pages. This was one of the themes of a talk I gave with two coworkers at this past JavaOne.
    -- Adam Winer (JSF EG member and ADF Faces lead)

  • Len function and nvarchar

    Hi we run 2012 enterprise and to be proactive i thought i'd ask the community what the len function will return on our nvarchar(30) col when our foreign partners start populating with chars that really need to occupy 2 bytes per visible char. 
    I already see that len does an rtrim.   That's interesting but let's say they send a col value that occupies all 30 display positions with characters that require 2 bytes each?
    Why do i ask?  First of all I see that our unicode data that contains chars that otherwise only require 1 byte count a fully populate column as len 30.  But I see max length in sql's meta data = 60.  And I will be applying the len function
    to this column in some of our etl and need to anticipate correctly the behavior that i will see under any condition including a mix of chars that would otherwise occupy 1 byte together with chars that require two bytes in storage.
    Depending on the answer i may need to know from the community what function I would use to count visible chars instead of used bytes?  Its the visible chars I really want to count.

    As other have said: len() returns the number of characters and there is no difference between characters from Latin or Chinese scripts.
    What I like to add is that is not that simple that varchar = 1 byte per character and nvarchar = 2 byte per character. In varchar characters from East Asian scripts typically take up two bytes per character; obviously you need the right collation for that.
    And with nvarchar, if you use any of the new _SC collations that were added in SQL 2012, a character can take up two or four bytes. However an nvarchar(30) is not 30 characters - it's 60 bytes.
    In case you use _SC collations, I should add that the characters that take up four bytes are fairly exotic. I believe that all living languages are well served by the base plane in Unicode.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • Preference pane under the apple won't show

    Console messages: says posix_spawn...Library/application support/ spotify/spotifywebhelper".,,,):No such file or directory Exixted with exit code 1 Throttling respawn: Will start in 10 seconds.

  • My ICloud Contacts are Outdated and bringing me problems ...

    Basically my ICloud Contacts are outdated and I´m losing lots of new contacts that I have on my Iphone 5. I´ve recovered my IP5 Contacts several times by means of intializing my phone but ICloud keeps on bringing me the Old Ones. Is there a way to ma

  • Problem in MD81 Tcode.

    Hi Gurus, When the PP consultant is trying to Create Individual Items using MD81, it is giving the error " Item category not available in the table T184" But from the SD side, I have assigned the item category to the sales document type. also the fie

  • DATABASE.FULLTEXT indexer stuck on Delete

    I've run into an issue with our Database Fulltext Indexer on UCM 10g. The Automatic Update Cycle seems to be 'stuck' on Deleting metadata for a piece of content that is no longer in the system. The indexer State is "Clean Up" and the Status is Active

  • Why do my Contribute connection keys not work?

    I am using CS4  The connection keys that I create as a Contribute administrator do not work.  Now sure why that is, because my own connection as administrator DOES work. When I generate the connection key, I check "include the FTP username and passwo