Storing issue for special character in table in rhomobile - ruby

using CGI escape i able to save some special character in DB. But I faced a critical issue related to column size.
In one case data size in one column is 12 character. when user inserted 11 spacial character in a view form. then if I escape those spacial character and try to save those whole string in DB, then it is giving a error and that is because of the length if character after escaping 11 spacial character is more than table'c column size(i.e 12 char).
How to solve this type of error ?

Here is the documentation for storing in Database with RhoMobile.
Using the Local Database with Rhom

Related

Text Fields Acceptable in SQL Loader

Are there any reserved text characters in SQL Loader ?
Any special characters like &,_" etc which cannot be loaded in Oracle table columns ?
My file column seperator is a pipe {|} character and I will escape to accept this too in my text columns but are there any other reserved characters which I cannot use in the data fields to be interfaced ?
There are none, as far as I can tell.
However, I'd suggest you to choose delimiters wisely because if text you're loading contains delimiters, you'll have problems in figuring out whether e.g. a pipe sign is a delimiter, or part of text to be loaded.
If you can prepare input data so that values are optionally enclosed into double quotes, you'd be able to avoid such problems. However, why having it complicated if it can be simple?

Problem when COPY INTO TABLE is performed with special characters into the files

I have a file with a column data something like this. As can be seen there is a special character in between.
The original datatype was varchar(60). When COPY INTO TABLE is performed then it is throwing an error. I change the collation to utf-8 and still doing the same. Is there a way to solve this problem?
ABC COMPANY ▒ Sample Data
Thanks!

Integration services string length need to be truncated

I'm using integration services (SSIS), at the moment I'm getting the data from an excel source, the string Description comes with a length greater than 15 chars: the problem is that I can't find a way to truncate this data in order to save it in the database (the column database is varchar(15) and I can't change it).
I was trying to use a derived column in order to truncate the data with no success.
Add a derived column transformation and use the SUBSTRING function to get only the first 15 characters of the string. Read about the Substring function in SSIS here SUBSTRING SSIS Expression
Your expression in the derived column would look something like SUBSTRING(Description, 0, 15)

Remove padding added by legacy DB2 databases on query results

I have the following setup.
'Apps/Reports' <---------> 'DB2 Connect' <------------> 'Legacy DB2 on AS400'
`Hibernate` `native calls`
When data is retrieved from by the application, it will be padded with extra spaces if the length is less that the column length. Of note when running a query, if the WHERE cause parameter is not padded, its automatically padded with extra spaces such that the query will retrieve the same records for a padded and non-padded parameter.
Is there a way (preferably on IBM DB2 Connect or connection string parameter) to remove extra whitespaces from a resultset?
You could implement an hibernate UserType that automatically trim the strings. There are good exmaples on
https://forum.hibernate.org/viewtopic.php?t=928294
http://java.dzone.com/articles/annotating-custom-types
http://santescas.blogspot.de/2014/02/creando-un-usertype-de-hibernate-que-se.html
Are the columns in the iSeries defined as CHAR()? I'm assuming so, because this is how CHAR() works -- it's a fixed field length, not a variable field length (that's what VARCHAR is for).

Strings are appended with special characters when returned from the database

I am using NHibernate to query an Oracle 8i database. The problem is that all the strings in the returned objects are postfixed with special characters. For e.g.
CUSTOMER,ONE�������
The nhibernate field type is AnsiString and the Oracle datatype is CHAR(20) and the Character set is CHAR_CS. I am totally new with Oracle so i don't have a clue whats going on :(
CHAR(20) means the field is padded as necessary to be exactly 20 characters long. The padding character is a blank.
There must be a problem somewhere in your character set settings if padding characters appear as question marks. You may find more insight on your problem here.
What you need here is to trim the returned strings, or better yet move to VARCHAR2(20).
I couldn't find a proper solution for this issue but changing the nhibernate driver from 'OracleClientDriver' to 'OleDbDriver' solved this issue. Still if anyone knows how to tackle this issue properly please let me know as I don't like using the OldDbDriver for accessing Oracle because of possible compatibility issues.

Resources