|
Sebastian T Xavier wrote: it gives some error
Be specific! What is the error message?
|
|
|
|
|
Incorrect syntax near 'h"ll'.
this is the error message, this is because of the " inside the string. how will we insert such strings into database.
thanks
sebastian
|
|
|
|
|
Try this:
insert into test values ('h"ll')
|
|
|
|
|
thanks
but this will not solve the problem.
i got it
thanks once again
sebastian
|
|
|
|
|
Sebastian T Xavier wrote: but this will not solve the problem
Yes, it does solve the problem. If it does not solve your problem then there is some missing information.
|
|
|
|
|
I've got 2 tables:
Province and Client
When I link Province with client i get the ff message
'Province' table saved successfully
'Client' table
- Unable to create relationship 'FK_Client_Province'.
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_Client_Province". The conflict occurred in database "test", table "dbo.Province", column 'Province'.
karabo
|
|
|
|
|
not got your query in full.
can you please give the sql statement reselted in this error. along with the 1. parent able and chield table
2. primary keys on the tables
however what i under stook is province is parent and client is chield
if so one column like provienceID should be primary key in province table
and in client table's provienceID can refer to provience table
Regards
KP
|
|
|
|
|
Does SQL Server have an autonumber datatype which will increment when adding record
Karabo Mekgwe
|
|
|
|
|
YES.
CREATE TABLE tblA(
AutoID decimal(18, 0) NOT NULL IDENTITY (1, 1),
Col2 varchar(10)
)
|
|
|
|
|
yes that s IDENTITY
See the example :
CREATE TABLE Emp (EMPID int IDENTITY (1, 1) NOT NULL ,EMPNAME VARCHAR(20))
Above this examble Identity is like an auto increment.
The Parameters (1,1) represents Start Number, Increment Number
this example starts 1 and next incremented by 1
RK
RK
RK
|
|
|
|
|
yes that s IDENTITY
See the example :
CREATE TABLE Emp (EMPID int IDENTITY (1, 1) NOT NULL ,EMPNAME VARCHAR(20))
Above this examble Identity is like an auto increment.
The Parameters (1,1) represents Start Number, Increment Number
this example starts 1 and next incremented by 1
RK
|
|
|
|
|
Hi, sometimes when I execute a procedure, it quits in no time:
echo "execute procedure ro_main_tp_oc('ATS','EY','N')" | dbaccess prds
Database selected.
Routine executed.
Database closed.
I heard it's because some procedure was blocked and locks other procedures. How shall I check and resolve it?
I am using HP unix, informix.
Thanks!
lantianman
|
|
|
|
|
There aren't very many Informix guys on this forum - its mostly SQL Server, Access, Oracle and MySQL.
I would try using dbaccess to run the command interactively to see if you get any better clue about what is happening.
Blocking and locks would normally result in a procedure being really slow. If there is a problem then I would guess that the procedure contains:- A "set lock mode" or "set current lock timeout" statement that tells Informix to throw an error if it encounters a locked record (or the database has been configured with a "locktimeout" parameter).
- An update/delete statement or a "for-update" cursor statement.
- If no error message is being displayed then I would expect that the resulting timeout error is being swallowed a "whenever error" clause.
If there was a problem with blocking then I would have expected an error message to be displayed (especially given that Informix is such a mature product). Are you sure that the procedure is having problems?
Hope that helps. I haven't done Informix for a reeeeeeally long time.
Andy
|
|
|
|
|
Thank you for your reply! Seems the problem has gone after I wait for some time...
|
|
|
|
|
sir,
I have a table which is having duplicate and some distinct records. Please can anybody please tell me the SQL-Server-2000 query to get only the duplicate records.
Means I dont need those records, which are not duplicate, but I need to print only those records which are duplicate. Thank you.
Regards,
Mohd. Abdul Aleem,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
let us take a table TBL1 with columns col1, col2, col3 for example
the query for fetchig is ...
SELECT col1, col2, col3 FROM TBL1 GROUP BY col1, col2, col3 HAVING count(*) > 1
|
|
|
|
|
Its not giving any records in SQL Server. Pls. give me some thing, which works in SQL Server. Thank you.
Regards,
Mohd. Abdul Aleem,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
I've tested the query on SQL server 2000
i'm getting proper output fetching proper data
i.e. i've a table in that new columns have duplicate data and other unique
when i include only duplicate data columns in the table i'm getting those rows which is duplicated that too when used ">10" returns those having 11 or more times repeated and when used ">3" returns those repeated 4 or more times and so on.
Regards
KP
|
|
|
|
|
Sir,
No sir, its not coming here why I dont know. pls. dont mind and tell me some thing na. pls. Thank you.
Regards,
Mohd. Abdul Aleem,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
First thing pls. don't address my Sir.
I'm Krishna Prasad, you can call me using full name or KP ...
comming for your query.
pls let me know a) table structure b) some same data c) required output.
Regards
KP
|
|
|
|
|
KP lets suppose this is my table structure, with a, b, c are columns. Now I would like to print only those columns which are duplicate. And by using the query its not printing any thing.
* SELECT a, b, c FROM SampleTable GROUP BY a, b, c HAVING COUNT(*) > 1 *
But if I give <=1 or < or = its giving atleast some values.
And even if I give this also * SELECT a, b FROM SampleTable GROUP BY a, b HAVING COUNT(*) > 1 *
And * SELECT a, b FROM SampleTable GROUP BY a, b HAVING COUNT(a) > 1 * its also not giving me any thing.
Thank you.
----------------------------------
a b c
----------------------------------
AA 12 1
BB 12 tyt
CC rtr yuyu
TT Gfg yuy
TT sdsd iuiu
AA dsfdf uiui
DD Ere bvn
EE DS hj
FF dfd bn
GG fdf bnbn
HH Tr bnb
AA FDF bn
BB fdfd bn
RR dfd bn
II dfdf bvn
JJ dsfd nvbnnb
KK dfdf hnmnmn
LL dfdf nm
MM dsfdf nmn
NN dfd mn
NN dfdf mn
TT dfdf mnghjf
OO fdgfg jhj
PP fgf j
QQ fgf j
RR fgfg jhgjh
SS fgfg fdgfdg
TT fgf f
UU fgfgf gf
VV fgfg gh
XX ffg h
YY ghg bbv
ZZ rfg tyt
TT fgfg gfg
UU fgf fgf
VV fgf fgf
XX fgfg g
Regards,
Mohd. Abdul Aleem,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
As per the sample data combination all three columns are unique. no duplication
however, separatly each column has duplicate values.
query given by me will list if combination three columns are repeated.
for example
AA 12 1
BB tyt 12
AA 12 1
CC tr mn
CC df tr
output would be
AA 12 1
rows with BB & CC will not be listed as they re present only once.
Regards
KP
|
|
|
|
|
Yeah its working K.P. Thank you very much.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Hello,
I've created the following stored procedure:
<br />
CREATE PROCEDURE SOM_RO_ISVALIDPRJID <br />
@strProjectID varchar(32)<br />
AS<br />
BEGIN<br />
DECLARE @intPrjID int<br />
<br />
SET NOCOUNT ON;<br />
@intPrjID = (SELECT COUNT(*) FROM dbo.tbl_projects_main WHERE prj_custom_id = @strProjectID)<br />
END<br />
IF (@intPrjID = 0)<br />
RETURN 0<br />
ELSE<br />
RETURN 1<br />
GO<br />
I keep getting the error:
Incorrect syntax near '@intPrjID' at line 8.
The line it is referring to is where I have @intPrjID = (SELECT ...)
Ryan
|
|
|
|
|
replace it with:
SELECT @intPrjID = COUNT(*) FROM dbo.tbl_projects_main WHERE prj_custom_id = @strProjectID
or with
Set @intPrjID = (SELECT COUNT(*) FROM dbo.tbl_projects_main WHERE prj_custom_id = @strProjectID)
Wout Louwers
|
|
|
|