Feed aggregator

C++ Problems (no g++, CXX=gcc yields '"/lib/cpp" fails sanity check') (1 reply)

MySQL Forums - Thu, 2008-04-10 16:05
So, whistling along through a default build, the process hit a decided speedbump when make found g++ missing.

No problem, I thought, I'll just set CXX="gcc" in the environment and reconfigure and be on my way. But configure chokes with this and gives the following error:

checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.

As instructed, I did check 'config.log', but I'm afraid I don't see anything that means much to me -- the last bit of the file looks like part of a c header file containing macros, and then a line that says "configure: exit 1." I can see how cpp might be related, but not a specific error.

Any ideas here? What requirements might there be for cpp and what are the sanity tests?

Thanks!

Problem with simple string output in Stored Procedure (no replies)

MySQL Forums - Thu, 2008-04-10 16:02
Hi Folks,

I'm new to Stored procs, so please bear with me :-).

I have a simple table (called pass_classifications) which has a field called 'label'. One of the rows in the 'label' column contains the following string text: "Fees":

mysql> SELECT label FROM pass_classifications;
+----------------------------------------------+
| label |
+----------------------------------------------+
| Maps, imagery and data |
| Reports and publications |
| Licences and resource use |
| Postage, handling and sundry services |
| Professional and technical services |
| Searches of property and other interests |
| Department of Mines and Energy |
| Registration of property and other interests |
| Biosecurity |
| EPA Climate products and publications |
| Fees |
+----------------------------------------------+
11 rows in set (0.00 sec)

I have written a stored proc to iterate over the 11 rows returned from the SELECT statement to return all the "labels". It then does a test for if the label="Fees", and if TRUE, then I want to output some string. However, when I CALL cur2(), I get a NULL for the output.

Here is my code so far:

CREATE PROCEDURE cur2 (OUT strout VARCHAR(50))
BEGIN

DECLARE done INT DEFAULT 0;
DECLARE ctr_label VARCHAR(50);
DECLARE strout VARCHAR(50);

DECLARE cur1 CURSOR FOR
SELECT label FROM pass_classifications ORDER BY label;

DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=1;

SET @strout = 'No, Fees is NOT in';

OPEN cur1;
ctr_loop: LOOP

FETCH cur1 INTO ctr_label;

IF done=1 THEN /* No more rows*/
LEAVE ctr_loop;
END IF;

IF (ctr_label = 'Fees') THEN

SET @strout = 'Yes, Fees are in';

END IF;

END LOOP ctr_loop;
CLOSE cur1;

END;

Here's what happens when I run it:

mysql> CALL cur2(@str);
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT @str;
+------+
| @str |
+------+
| NULL |
+------+
1 row in set (0.00 sec)

This example is not exactly my "end game" (I utlimately want to generate prepared statements), but I am trying to get the hang of this simple string manipulation. Any help would be appreciated.

Cheers, Craig
Cheers, Craig

Multiple columns index - columns from different tables? (no replies)

MySQL Forums - Thu, 2008-04-10 15:56
Hi,

I have the following situation:

table "net" has columns: "id" (autoincrement), "name".
table "node" has columns: "id" (autoincrement), "ip", "net_id"
--where net_id is a foreign key to net.id
table "link" has columns: "id" (autoincrement"), name, node1_id, node2_id.
--where node1_id and node2_id is a foreign key to node.id


I want to create unique indexes on those tables so that following conditions are
assuared:
1.there can not be 2 nodes with the same ip inside the same net.
2.there can not be 2 links with the same name inside the same net.

For condition 1 I know how to create the unique index:
...so the unique index on node table is in this case a multiple column index formed by columns (net_id, ip).

For condition 2: how can I create a unique index ?
I was thinking if it is possible to create a multiple column index formed by
columns link.name and (link.node1)->net_id.
It is possible such a construction ?

Second way would be to add column net_id also in link table.
This is easier.

Thanks,
Dacian

mysql.exe that built from source can't display Chinese (no replies)

MySQL Forums - Thu, 2008-04-10 15:28
Hi,

I built mysql-5.0.51a under Windows using VS2005+SP1 successfully. The server mysqld.exe seems working correctly, however, the client mysql.exe can't display Chinese.

I create an innodb table with character set utf8, then I inserted some data (with some Chinese characters) into it. When I select the result, I can't see any Chinese character (even no "???"). However, the insert operation should succeed because when I use the client tool mysql.exe in the package "mysql-noinstall-5.0.51a-win32.zip" I can see those Chinese characters! So, what the problem may be? Is there anything wrong with my build process? I do it step by step as in the source file "win/README".

Thanks for any suggestion!

Best Regards,
McEase Tu

Full Classname of the JDBC- drive (no replies)

MySQL Forums - Thu, 2008-04-10 15:24
Hi I am still novice to mysql and programming

I would like to know how do I find my Full Classname of the JDBC-drive.

I hope this info will help-

CLASSPATH= C:\Tomcat 5.5\shared\lib\mysql-connector-java-3.1.12-bin.jar

Thanks in advance

Conversion in MySQL++ (no replies)

MySQL Forums - Thu, 2008-04-10 13:47
Is there a way to convert a *single* result into a "normal" variable?

I came across .storein() but that doesn't work for this.

After making a query, using "mysqlpp::StoreQueryResult users = query.store();", and then looping through the result... I'd like the ability to store something like "users[i]["id"]" inside an int, and other types as strings.

I couldn't find anything in the docs. Any suggestions?

Thanks
--Kyle

Single Line Query (no replies)

MySQL Forums - Thu, 2008-04-10 13:16
Hi All,


My Data:

--ID---value
01... 100
01... -50
02... 200
03... -60

What single SQL statement to produce
the result below?

--ID---PosV---NegV
01...100....-50
02...200..... 0
03.....0....-60

thank you all.

ndb size (no replies)

MySQL Forums - Thu, 2008-04-10 13:05
Hi lists,

I am trying to build ndb with two data nodes in a group. My current database size is mixed with myisam and innodb. size of them are

innodb 2.4 GB
myisam 1.6 GB

I tried to calculate the Datamemory and Indexmemory with the perl script ndb_size.pl comes with the mysql. It generated like the following

Parameter Minimum Requirements
* indicates greater than default

DataMemory(KB) 26912096*
IndexMemory(KB) 463704*

does that mean should I have 25GB of RAM to store Datas in memory and and for index 452MB of ram?

please clear me is that really KB in size? and will it take this much ram to store all of them?

Saravanan

Where to get a good 5.0.17a? (3 replies)

MySQL Forums - Thu, 2008-04-10 12:44
Hi,

I upgraded to 5.0.17a OSS RC REV 2972, just downloaded from the download site but it is very buggy. I couldn't use table editor because of software module exceptions. Unfortunately, I lost my 5.0.16 package for me to recover from this problem. From bug search, found 3014 or 3015, but couldn't get those revisions from mirror sites. Anyone can point me the a good 5.0.17? Thanks!

Work in sunny Mexico for one month! (no replies)

MySQL Forums - Thu, 2008-04-10 12:41
Do you need a break? Would you like to take care of your suntan while working? We have the perfect offer: help us set up our MySQL programming, and enjoy Mexico beaches at the same time. We are located in Playa del Carmen (30 minutes South of Cancun), and we are looking for a web developer who has experience in PHP and MySQL programming. We would like to have a developer assist us with the creation of web sites using DREAMWEAVER and incorporating on-line registration forms.

Looking for an experienced web professional ASAP. Please respond by e-mail to rpistor@prodigy.net.mx

howt to configure, create backup database and code java run use mysqldump with java? (no replies)

MySQL Forums - Thu, 2008-04-10 12:22
Dear, All
I would like all people who get my question, please give the idea or especially source code of it.
Kind Regards,
Sokhalay.

msql master and 2 slave: separate port for replication and slave read (no replies)

MySQL Forums - Thu, 2008-04-10 11:52
I am planning to setup mysql with 1 master and 2 slave. Two slave reads will be load balanced. I would like to setup slaves so that each slave have two separate ports, one for reads and other for master->slave replication. How can I set this up?

Help with a query that has me stumped (1 reply)

MySQL Forums - Thu, 2008-04-10 11:24
Im relatively new to Mysql.. have done many simple queries, but have now have one I'm stuck on.

I have 2 tables, one a store table and the other a franchise link table, which indicated which stores have which franchises.

i.e.

StoreID StoreName
------------------
1 StoreA
2 StoreB
3 StoreC

FranchiseID StoreID
---------------------
A 1
B 1
C 1
B 3

I need to do a query to retrieve all stores that have no franchises.

Any help would be appreciated
Thanks
Mark

get a value mulitiple database (no replies)

MySQL Forums - Thu, 2008-04-10 11:12
Hi everyone,

how can i get a value from two different databases using a single query...
(i-e)
Database A: table A -->Reg_no,Name
Database B: table B -->Reg_no,Country

i get a value of "Name" and "Country" from Table A & B
based on "Reg_no"


Thanks !

good open source app showing table relationships? (1 reply)

MySQL Forums - Thu, 2008-04-10 10:22
Is there a good open source application that can import and show the relationship between tables? Or I can draw the relationship?

Many thanks.

flush "global" status (no replies)

MySQL Forums - Thu, 2008-04-10 10:08
Is there not any way to flush or clear all of the status values? I have tuned my database and would really like to reset things back to zero, but I can't find any way to do this. I'm using Community version 5.0.

how to combine databases with same structure but auto-increment fields? (4 replies)

MySQL Forums - Thu, 2008-04-10 09:43
I am combining several databases, each with 20 tables. Many, but not all, tables within each database have auto-increment key id fields and are related to each other using that key auto-increment field.

In other words, there are multiple versions of a database, db1, db2,... Each db* has the same table structure, but each database contains different data. I need to combine the data from all databases all into one database.

How can I combine them without manually changing each insert statement or doing lots of update queries to lots of tables?

Many thanks.

Store Procedure (no replies)

MySQL Forums - Thu, 2008-04-10 09:41
I installed the latest MySQL: 5.1.23-rc-community.

I tried this and it's not working:

CREATE PROCEDURE molo() SELECT 'Molo';
ERROR 1046 (3D000): No database selected

did I install the wrong version?

thanks for the help

sorry-- wrong area (no replies)

MySQL Forums - Thu, 2008-04-10 09:15
reposted in another forum