|
yes you can,..
trigger is a plsql block and u can call procs / funcs in it.
|
|
|
|
|
Hello all,I'm facing problem with applying the MySql.Data.dll file in Reference of my VS 2003. When I try to add in,I saw a prompup and show this Error Message:
A reference to' C:\Documents and Setting\Visual Studio PRojects\Test\MySql.Data.dll' could not be added. This is not a valid assembly or COM component. Only assemblies with extention 'dll' and COM components can be referenced. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
Anyone could guide me how to solve this problem?
Thanks for reading~!
Regards
Jack
|
|
|
|
|
|
is there anyone who have an experience in sql editor project, please send me an info on how to build it using oracle as the main server, i'm doing a project on my own companies sql scratch pad,from where it connects directly to oracle server where the editor also attach to the main companies application.
any info or sample codes is a big help.
xybr0xym0r0n
|
|
|
|
|
I need to run a standard select but I am not getting any results. The problem is, the user input goes something like '200' and the value in the field I am comparing to is '000200' (contains leading zeros, for some reason that is beyond me). Also, the data type for the column, in my table, is char and I also need to know if my parameter needs to be of the same type. Does anyone have any suggestions/ideas to best approach this situation?
Thanks,
T
|
|
|
|
|
The one who designed the database probably thought it would be a good idea to use char . Could be right, could be wrong... but without speculating on that, here is one solution:
create procedure FindMatch(@param varchar(100)) as
select * from TheTable where TheKey = right('000000' + @param, 6)
I'm assuming the actual column type is char(6). Otherwise, adjust the right invocation. Also, I've assumed you've already trimmed the parameter - otherwise, replace @param with ltrim(rtrim(@param)) .
Peter the small turnip
(1) It Has To Work. --RFC 1925[^]
|
|
|
|
|
Although the data type is char, but the data in the column is numeric then you can convert the field and then compare.
select * from table_name where cast(field_name as int) = 100;
Om Prakash Pant
|
|
|
|
|
Good Afternoon All
I have the Following Cursor
DECLARE VAL_CURSOR CURSOR FOR
SELECT PROPERTY_ID, NEW_MARKET_VALUE, NEW_ATTRIB_CODE,
ACTUAL_EXTENT,11 AS VAL_REASON_ID, 6 AS VAL_METHOD_ID
FROM PROPERTY_MASS
WHERE NEW =1
OPEN VAL_CURSOR
DECLARE @PROPERTY_ID INT
DECLARE @MARKET_VALUE INT
DECLARE @NEW_ATTRIB_CODE VARCHAR(12)
DECLARE @STATUS_DATE VARCHAR(100)
DECLARE @ACTUAL_EXTENT FLOAT
DECLARE @VAL_REASON_ID INT
DECLARE @PAR_METHOD_ID INT
SET @STATUS_DATE = GETDATE()
FETCH NEXT FROM VAL_CURSOR INTO
@PROPERTY_ID, @MARKET_VALUE,@NEW_ATTRIB_CODE,@STATUS_DATE,@VAL_REASON_ID,@PAR_METHOD_ID
WHILE @@FETCH_STATUS = 0
BEGIN
IF ISDATE(@STATUS_DATE)=0 PRINT CAST(@PROPERTY_ID AS CHAR(20))+'"'+@STATUS_DATE+'"'
FETCH NEXT FROM VAL_CURSOR INTO
@PROPERTY_ID, @MARKET_VALUE,@NEW_ATTRIB_CODE,@STATUS_DATE,@VAL_REASON_ID,@PAR_METHOD_ID
END
CLOSE VAL_CURSOR
DEALLOCATE VAL_CURSORbtw - why are you using a CURSOR instead of
when i run it gives me the Following Error
Msg 16922, Level 16, State 1, Line 26
Cursor Fetch: Implicit conversion from data type datetime to float is not allowed.
What is Wrong
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
My guess is that it is
IF ISDATE(@STATUS_DATE)=0 PRINT CAST(@PROPERTY_ID AS CHAR(20))+'"'+@STATUS_DATE+'"'
because you use '+@STATUS_DATE+'
Cast the date to (n)varchar and try again.
|
|
|
|
|
Well, presumably the data type of one of the columns in the query is datetime but you're trying to stuff it into a float variable. Presumably ACTUAL_EXTENT , given this is the only one declared as float .
As the comment says, why use a cursor? Why use PRINT for informational results rather than just using a SELECT?
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Thanks man i Fixed it.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I'm using OleDBCommand.ExecuteReader(CommandBehavior.KeyInfo)
Now, in the result DataTable, columns that have default values set in database, appears with DefaultValue property equal DBNull.Value
I tried everything; every CommandBehavior, dealing with SQl Server or MS Access, using DataAdapter instead of DataReader,... but no way ((
Pleaaaaaaaase help
|
|
|
|
|
Hi all, I got it
use OleDbConnection.GetOleDbSchemaTable Method ...
don't ask me whyyyyyy Microsoft does that
anyway..
here is an example:
DataTable SchemaTable = connection.GetOleDbSchemaTable(
OleDbSchemaGuid.Columns,
new object[] { null, null, "Employees", null });
you will find a column in "SchemaTable" datatable with name "Column_Default"
Good Luck
|
|
|
|
|
Now I have a new problem...
The retrieved value for Default Value is not in a usable format, it is retrieved as it is stored in database
for example:
In SQL Server, nvarchar field's default value is stored as follow
('value') or (N'value')
In MS Access, Text field's default value is stored as follow
"value"
Now, how can I get the value without quotes regardless of database type
|
|
|
|
|
Hi friends,
My existing project does db operation with help of MSMQ.
Consider following steps ;
1.Main Application writes binary dataa to MSMQ
2.Sub application reads data from MSMQ and update DB.
I have tried this with service broker
1.Main applicate puts data into Database Queue through Service broker
2.Service broker does DB operation.
But Comparatively the performance in service broker is very very slow.
I have used Binary data which passes through Queue and i have used CLR enabled stored procedure to use this bianry data.
Can any one explain wats wrong in this.
|
|
|
|
|
i have a query in sql2000
if i want to select distinct scid,requirement,comments from table1
i am not getting distinct rows .
distinct keyword is not working .can you please give me some clue.it is urgent.
|
|
|
|
|
My guess is that the DISTINCT keyword is working but that your rows aren't - well - distinct.
|
|
|
|
|
its taking more than two columns combined distinct
|
|
|
|
|
Yes, that is how DISTINCT works. The entire selected row must be identical to others for them to be filtered away.
|
|
|
|
|
Distinct runs on every column after it unless you put the column list in parenthesis () like
SELECT Distinct(col1), col2,col3
you can also group columns in the distinct clause or combine them if they are character strings like
SELECT Distinct (Col1 + Col2), col3
distinct will only operate on the column specified, but in your syntax you are accidently specifying all of the columns, and i imagine that you dont have 2 rows where all 3 columns contain the same data. Oh before i forget, Sql Server 2000's query analyzer tool has the absolute best help under help -> tranact SQL help. it is very well written and has fairly good examples, i use it all the time.
|
|
|
|
|
Do you have text or ntext columns in this table? because as I remember, distinct won't work fine with them.
|
|
|
|
|
can we use stored procedure in user defined function ?????
This is haneef.............................................................
|
|
|
|
|
Have you tried it? If so, and it works the answer is yes else no.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi expets, I created a datagrid column as a templete column.It is a textbox field.So how i validate that templete column(textbox)?
CheeN
|
|
|
|
|
try the C# forum!
Bob
Ashfield Consultants Ltd
|
|
|
|