dbTalk Databases Forums  

datatype for string

comp.databases.informix comp.databases.informix


Discuss datatype for string in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
eferreyra
 
Posts: n/a

Default datatype for string - 08-09-2011 , 08:57 AM






Hi, i need to store in a column the text from a exception or log, can
be up to 2048 chars probly, im using a TEXT column and works fine
from .NET provider (also JDBC, ODBC) but cant get a INSERT from
Informix 4gl i read that cant be done ?

Cant use CHAR because the space it trashes, cant use VARCHAR is too
small...

I cant make a LOAD statement, and cant use c funtions or external
modules...

Suggestions ?

IDS: IBM Informix Dynamic Server Version 11.50.UC6
4GL: IBM INFORMIX-4GL Version 7.32.UC4

Reply With Quote
  #2  
Old   
Art Kagel
 
Posts: n/a

Default Re: datatype for string - 08-09-2011 , 09:21 AM






Use LVARCHAR it's like VARCHAR but can hold up to a bit under 32K bytes.

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.



On Tue, Aug 9, 2011 at 9:57 AM, eferreyra <eferreyra (AT) gmail (DOT) com> wrote:

Quote:
Hi, i need to store in a column the text from a exception or log, can
be up to 2048 chars probly, im using a TEXT column and works fine
from .NET provider (also JDBC, ODBC) but cant get a INSERT from
Informix 4gl i read that cant be done ?

Cant use CHAR because the space it trashes, cant use VARCHAR is too
small...

I cant make a LOAD statement, and cant use c funtions or external
modules...

Suggestions ?

IDS: IBM Informix Dynamic Server Version 11.50.UC6
4GL: IBM INFORMIX-4GL Version 7.32.UC4
_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

Reply With Quote
  #3  
Old   
Alexandre Marini
 
Posts: n/a

Default Re: datatype for string - 08-09-2011 , 09:27 AM



Hello,
I think Mr Art meant NCHAR, informix 4gl 7.32 doesn´t support LVARCHAR
variables, I just read.

Character Data Types

4GL supports four simple data types for storing character string values.
The TEXT data type (see "TEXT" on page 3-41) can store text strings of upto
two gigabytes ( = 231 bytes). However, TEXT is not classified here as a
character data type, because 4GL manipulates TEXT values in a different way
from how CHAR, VARCHAR, NCHAR, or NVARCHAR values are processed.

Character Types Description
CHAR ( size ),
CHARACTER ( size )
Strings of length size, for size up to 32,767 bytes
VARCHAR ( size, reserved ) Strings of length ? size, for size ? 255 bytes
NCHAR ( size ) Strings of length size, for size up to 32,767 bytes
NVARCHAR ( size, reserved ) Strings of length ? size, for size ? 255 bytes

Regards!

Em 09/08/2011 10:21, Art Kagel escreveu:
Quote:
Use LVARCHAR it's like VARCHAR but can hold up to a bit under 32K bytes..

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com
http://www.advancedatatools.com>)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own
opinions and do not reflect on my employer, Advanced DataTools, the
IIUG, nor any other organization with which I am associated either
explicitly, implicitly, or by inference. Neither do those opinions
reflect those of other individuals affiliated with any entity with
which I am affiliated nor those of the entities themselves.



On Tue, Aug 9, 2011 at 9:57 AM, eferreyra <eferreyra (AT) gmail (DOT) com
mailto:eferreyra (AT) gmail (DOT) com>> wrote:

Hi, i need to store in a column the text from a exception or log, can
be up to 2048 chars probly, im using a TEXT column and works fine
from .NET provider (also JDBC, ODBC) but cant get a INSERT from
Informix 4gl i read that cant be done ?

Cant use CHAR because the space it trashes, cant use VARCHAR is too
small...

I cant make a LOAD statement, and cant use c funtions or external
modules...

Suggestions ?

IDS: IBM Informix Dynamic Server Version 11.50.UC6
4GL: IBM INFORMIX-4GL Version 7.32.UC4
_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org <mailto:Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list




_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list

--

Alexandre Marini

Tecnologia da Informação - DBA

SEFAZ-MS / SGI-UGSR / Sistemas IBM-Informix

<Cert-Info-Mgmt_color.jpg>

IBM Certified System Administrator - Informix Dynamic Server V10 / V11 /
V11.70

IBM Information Management Informix Technical Professional v3

Reply With Quote
  #4  
Old   
Art Kagel
 
Posts: n/a

Default Re: datatype for string - 08-09-2011 , 09:34 AM



No, I meant LVARCHAR. NCHAR is just CHAR with programmable sorting rules,
it is fixed length. Enrique wants a variable length column. However, while
you cannot have an LVARCHAR in I4GL/R4GL, you can, as Enrique has already
discovered, have a CHAR(32763) column which does correctly auto-cast from/to
LVARCHAR (unlike TEXT), so you can work with LVARCHAR columns in 4GL using
CHAR variables. In addition, since 4GL is being replaced by 4Js Genero
officially or by Querix Lycia or Aubit4GL unofficially and since these 4GL
clones all support LVARCHAR type variables, it is a viable datatype to use
going forward.

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.



On Tue, Aug 9, 2011 at 10:27 AM, Alexandre Marini <amarini (AT) fazenda (DOT) ms.gov.br
Quote:
wrote:

Hello,
I think Mr Art meant NCHAR, informix 4gl 7.32 doesn´t support LVARCHAR
variables, I just read.

Character Data Types

4GL supports four simple data types for storing character string values.
The TEXT data type (see “TEXT†on page 3-41) can store text strings of up
to
two gigabytes ( = 231 bytes). However, TEXT is not classified here as a
character data type, because 4GL manipulates TEXT values in a different way
from how CHAR, VARCHAR, NCHAR, or NVARCHAR values are processed.

Character Types Description
CHAR ( size ),
CHARACTER ( size )
Strings of length size, for size up to 32,767 bytes
VARCHAR ( size, reserved ) Strings of length ≤ size, for size ≤ 255 bytes
NCHAR ( size ) Strings of length size, for size up to 32,767 bytes
NVARCHAR ( size, reserved ) Strings of length ≤ size, for size ≤ 255 bytes

Regards!

Em 09/08/2011 10:21, Art Kagel escreveu:

Use LVARCHAR it's like VARCHAR but can hold up to a bit under 32K bytes.

Art

Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
Blog: http://informix-myview.blogspot.com/

Disclaimer: Please keep in mind that my own opinions are my own opinions
and do not reflect on my employer, Advanced DataTools, the IIUG, nor any
other organization with which I am associated either explicitly, implicitly,
or by inference. Neither do those opinions reflect those of other
individuals affiliated with any entity with which I am affiliated nor those
of the entities themselves.



On Tue, Aug 9, 2011 at 9:57 AM, eferreyra <eferreyra (AT) gmail (DOT) com> wrote:

Hi, i need to store in a column the text from a exception or log, can
be up to 2048 chars probly, im using a TEXT column and works fine
from .NET provider (also JDBC, ODBC) but cant get a INSERT from
Informix 4gl i read that cant be done ?

Cant use CHAR because the space it trashes, cant use VARCHAR is too
small...

I cant make a LOAD statement, and cant use c funtions or external
modules...

Suggestions ?

IDS: IBM Informix Dynamic Server Version 11.50.UC6
4GL: IBM INFORMIX-4GL Version 7.32.UC4
_______________________________________________
Informix-list mailing list
Informix-list (AT) iiug (DOT) org
http://www.iiug.org/mailman/listinfo/informix-list




_______________________________________________
Informix-list mailing listInformix-list (AT) iiug (DOT) or...//www.iiug.org/mailman/listinfo/informix-list



--

Alexandre Marini

Tecnologia da Informação - DBA

SEFAZ-MS / SGI-UGSR / Sistemas IBM-Informix

http://Cert-Info-Mgmt_color.jpg>****

IBM Certified System Administrator - Informix Dynamic Server V10 / V11 /
V11.70****

IBM Information Management Informix Technical Professional v3****

** **

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.