11-06-2007
Mysql CHAR vs VARCHAR
Looking for any advise from a DBA/DA. When should you use CHAR and when should you use VARCHAR when designing a table. From my readings seems like VARCHAR will accept any length string even though you define a length to it, so I setup gadget VARCHAR(10) I could actually put something with 20 characters in there. Thanks for any advise on this. Bill
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
How to replace any character in a file with a newline character using sed ..
Ex:
To replace ',' with newline
Input:
abcd,efgh,ijkl,mnop
Output:
abcd
efgh
ijkl
mnop
Thnx in advance.
Regards,
Sasidhar (5 Replies)
Discussion started by: mightysam
5 Replies
2. Programming
Hello,
I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it:
char* getext(char *file)
{
char *extension;
int i, j;... (5 Replies)
Discussion started by: pallak7
5 Replies
3. UNIX for Advanced & Expert Users
Hi ,
I need to sort a file based on multiple columns All the columns are of varchar type
can any one give me the command to sort for varchar columns?
Thanks (3 Replies)
Discussion started by: laxmi131
3 Replies
4. Programming
hello everybody!
i have aproblem! i dont know how to concatenate const char* with char
const char *buffer;
char *b;
sprintf(b,"result.txt");
strcat(buffer,b);
thanx in advance (4 Replies)
Discussion started by: nicos
4 Replies
5. Programming
Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially):
xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’:
xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’
The same error with all c++ constructors - gcc 4.4.4.
If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies
6. UNIX and Linux Applications
After doing a yum install mysql mysql-server on Fedora 14 I wasn't able to fully install the packages correctly. It installed MySQL 5.1. I was getting the following error when running the:
mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)... (3 Replies)
Discussion started by: jastanle84
3 Replies
7. Programming
Pointers are seeming to get the best of me and I get that error in my program.
Here is the code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define REPORTHEADING1 " Employee Pay Hours Gross Tax Net\n"
#define REPORTHEADING2 " Name ... (1 Reply)
Discussion started by: Plum
1 Replies
8. UNIX for Beginners Questions & Answers
hallo,
yould you guys help me?
im using bash script
i have file getnumber.csv
cat getnumber.csv
234198
654639
eht4v4
453nbddme
43
455fr
i try this
cat getnumber.csv | sed 's/*//g'
but the result is :
234198 (5 Replies)
Discussion started by: kivale
5 Replies
LEARN ABOUT DEBIAN
class::dbi::test::sqlite
Class::DBI::Test::SQLite(3pm) User Contributed Perl Documentation Class::DBI::Test::SQLite(3pm)
NAME
Class::DBI::Test::SQLite - Base class for Class::DBI tests
SYNOPSIS
use base 'Class::DBI::Test::SQLite';
__PACKAGE__->set_table('test');
__PACKAGE__->columns(All => qw/id name film salary/);
sub create_sql {
return q{
id INTEGER PRIMARY KEY,
name CHAR(40),
film VARCHAR(255),
salary INT
}
}
DESCRIPTION
This provides a simple base class for Class::DBI tests using SQLite. Each class for the test should inherit from this, provide a
create_sql() method which returns a string representing the SQL used to create the table for the class, and then call set_table() to create
the table, and tie it to the class.
METHODS
set_table
__PACKAGE__->set_table('test');
This combines creating the table with the normal Class::DBI table() call.
create_sql (abstract)
sub create_sql {
return q{
id INTEGER PRIMARY KEY,
name CHAR(40),
film VARCHAR(255),
salary INT
}
}
This should return, as a text string, the schema for the table represented by this class.
perl v5.12.4 2005-05-24 Class::DBI::Test::SQLite(3pm)