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
I2C_ADD_NUMBERED_ADA(9) 				      I2C and SMBus Subsystem					   I2C_ADD_NUMBERED_ADA(9)

NAME
i2c_add_numbered_adapter - declare i2c adapter, use static bus number SYNOPSIS
int i2c_add_numbered_adapter(struct i2c_adapter * adap); ARGUMENTS
adap the adapter to register (with adap->nr initialized) CONTEXT
can sleep DESCRIPTION
This routine is used to declare an I2C adapter when its bus number matters. For example, use it for I2C adapters from system-on-chip CPUs, or otherwise built in to the system's mainboard, and where i2c_board_info is used to properly configure I2C devices. If the requested bus number is set to -1, then this function will behave identically to i2c_add_adapter, and will dynamically assign a bus number. If no devices have pre-been declared for this bus, then be sure to register the adapter before any dynamically allocated ones. Otherwise the required bus ID may not be available. When this returns zero, the specified adapter became available for clients using the bus number provided in adap->nr. Also, the table of I2C devices pre-declared using i2c_register_board_info is scanned, and the appropriate driver model device nodes are created. Otherwise, a negative errno value is returned. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 I2C_ADD_NUMBERED_ADA(9)