imrank


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting imrank
# 1  
Old 06-14-2009
Tools imrank

Hi Smilie

I created a sp with one IN param.
declared a variable with int type, say
=========================================
> delimiter //
create procedure tst(IN t1 varchar(20)
)
begin
declare c1 int;
set c1 = (select seednum+1 from SeedData where RecId=1);
insert into b2(f1, f2) values (t1, c1);
Update SeedData set seednum=seednum+1;
end;
//
========================================
> CALL tst('Test')


Mysql throw an exception saying f2 cannot be NULL!!!

Indeed in table B2 the field f2 is flagged as NOT NULL
hence int data must be passed on to this field; Which happen to be retrieved by
set c1 statement using Select seednum+1,
Many attempt made to see that the c1 does retrieve value from its query? It does
retrieve the value from query but does not retain for insert statement.

Using Select c1 I can see it has a intended value which I am seeking but when it come to INSERT statement execution there is non or NULL!!

What Is wrong here these statement perfectly running at MS SQL server now I am migrating to MYSQL

Please any advise, tip,where is I am wrong?

Thank in advance.
IK
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question
mysqmail-dovecot-logger(8)				      System Manager's Manual					mysqmail-dovecot-logger(8)

NAME
mysqmail-dovecot-logger - logs dovecot-imapd and dovecot-pop3d traffic to a mysql database SYNOPSIS
mysqmail-dovecot-logger subprogram [ args ... ] DESCRIPTION
mysqmail-dovecot-logger reads the syslog using tail -F, and for each dovecot lines of POP3 and IMAP corresponding to a disconnection, mysq- mail-dovecot-logger writes the total used bandwidth corresponding to the username. Configuration is read from /etc/mysqmail.conf. mysqmail-dovecot-logger uses a table corresponding to this one: CREATE TABLE IF NOT EXISTS pop_access ( id varchar(32) NOT NULL default '', uid int(11) NOT NULL default '65534', gid int(11) NOT NULL default '65534', home varchar(255) NOT NULL default '', shell varchar(255) NOT NULL default '', mbox_host varchar(120) NOT NULL default '', crypt varchar(50) NOT NULL default '', passwd varchar(50) NOT NULL default '', active int(11) NOT NULL default '1', start_date date NOT NULL default '0000-00-00', expire_date date NOT NULL default '0000-00-00', quota_size int(11) NOT NULL default '0', type varchar(20) NOT NULL default 'default', memo text,du bigint(20) NOT NULL default '0', another_perso varchar(5) NOT NULL default 'no', redirect1 varchar(255) default NULL, redirect2 varchar(255) default NULL, localdeliver varchar(10) NOT NULL default 'yes', pop3_login_count int(9) NOT NULL default '0', pop3_transfered_bytes int(14) NOT NULL default '0', imap_login_count int(9) NOT NULL default '0', imap_transfered_bytes int(14) NOT NULL default '0', last_login int(14) NOT NULL default '0', PRIMARY KEY (id,mbox_host) ) TYPE=MyISAM VERSION
This documentation describes mysqmail-dovecot-logger version 0.4.4 or superior. See http://gplhost.com/softwares-mysqmail.html for updates. SEE ALSO
qmail-send(3), syslog(3), logger(8) mysqmail-dovecot-logger(8)