User Profile
Collapse
-
thank you for the help. i will try to execute the exe from stored procedure -
read value from exe
hi,
is it possible to read value returned by the exe in oracle stored procedure.
basically i have an exe that returns string value, get the string value returned by the exe and insert into a table.
thanks,
sandeep -
how to insert nclob data into a table
Hi,
i have table with nclob column. i want insert a row into table with large text. when i am trying to run insert statement getting error text too large >40000 charactes. i am using SQL Developper. i need to make this as a script and run on different servers.
Thanks,
Sandeep -
change your loop as
...Code:WHILE @Counter > 0 BEGIN SELECT @key = Phase FROM #TEMP WHERE ID = @Counter IF @Key = 1 BEGIN SELECT @Var1 = Agency , @var2 = Request, @var3 = SourceofFunds FROM #TEMP WHERE ID = @Counter UPDATE #TEMP SET Agency = @Var1 WHERE Request = @var2 AND SourceofFunds = @var3 AND ID <> @Counter
Leave a comment:
-
hi below is the script to replace number with placeholders.
...Code:DECLARE @Str VARCHAR(100), @NewString varchar(100) SET @Str = 'xxxxx 0 yyyy 1 zzzz 2' DECLARE @I INT, @start int, @end int, @initial int SELECT @I = 0, @start = 1, @initial = 1 WHILE @I <= LEN(@STR) BEGIN WHILE isnumeric(substring(@str,@start, 1)) = 0 AND @start <= LEN(@STR)
Leave a comment:
-
simply use
Code:SQLQuery= SQLQuery & " where(firstname + ' ' + lastname Like '%" & strWD & "%')
Leave a comment:
-
hi,
try this
Note: remove spaces in strWDCode:SQLQuery= SQLQuery & " where(firstname + lastname Like '%" & strWD & "%')
Leave a comment:
-
deepuv04 replied to i have got an error when i execute an internal representation of the XML document.in SQL Servertry the following
...Code:create procedure xmlread @xmlDoc text = '' as begin --nvarchar(100) Declare @handle int SET @xmlDoc = N' <students> <StudentID> 100-252-1658</StudentID> <StudentFName>Suresh</StudentFName> <StudentLName>Prabhu</StudentLName> </students>' EXEC sp_xml_preparedocument @handle
Leave a comment:
-
Code:SELECT [Sch ID], count ([Student ID]), [Enrolled Date], count ([Student ID]), count (CASE WHEN [new or old]='old' THEN 1 ELSE NULL END) as NEW FROM tblData GROUP BY [Sch ID], [Enrolled Date]Leave a comment:
-
Try this
Code:UPDATE dbo_aspnet_Users SET [Username] = @UserName, [email] = @Email FROM dbo_aspnet_Membership INNER JOIN dbo_aspnet_Users ON dbo_aspnet_Membership.UserId = dbo_aspnet_Users.UserId WHERE [UserId] = @UserId
Leave a comment:
-
the query is treating REG, VALV, AND RIKE AS Column names in the table. Use single quotes.
ThanksLeave a comment:
-
hi,
I think you are trying to get the column names dynamically. if that is the requirement... you need to build the query dynamically and execute the query string.
Try the following
...Code:DECLARE @STR VARCHAR(MAX) SET @Str = 'SELECT ' SELECT @Str = @Str + Column_Name + ',' FROM Information_Schema.Columns WHERE TABLE_Name = 'Table_Name' AND Column_Name like '%cOLUMN_Name%'
Leave a comment:
-
-
Try this
Code:select user.id,user.name, count(messages.id) as Messages, COUNT( case when message.Status ='Unread' then 1 else null) as UnreadMessages from user LEFT OTUER JOIN message on message.userid = user.id group by user.id,user.name
Leave a comment:
-
in the query given replace "INNER JOIN" with "LEFT OUTER JOIN" this will return the users without messages....Leave a comment:
-
hi,
use the date column for partitioning
try this hope will work
...Code:SELECT X.Category, X.Date, avg(X.Value) FROM ( SELECT A.Category, D.Date, p.Value, ROW_NUMBER() OVER(PARTITION BY A.Category,D.DATE ORDER BY p.Value) AS RowNum, COUNT(*) OVER(PARTITION BY A.Category,D.DATE) AS Cnt FROM TABLE1 AS A INNER JOIN TABLE2 AS D ON A.ID = D.ID WHERE D.Date between '20100510' and
Leave a comment:
-
select user.id,user.na me,count(messag es.id)
from user inner join
message on message.userid = user.id
group by user.id,user.na me
this query gives you the list for all users. to get the results for a particular user or on a specific condition use where clause or having clause...Leave a comment:
-
use the following query
...Code:SELECT Cust_Name,[Apple],[Apricot],[Banana] FROM ( SELECT ct.Name as Cust_Name,ft.name as ft_Name,SUM(ot.mass) AS Mass FROM CT INNER JOIN OT ON CT.ID = OT.Ct_Id INNER JOIN FT ON FT.ID = OT.ft_Id GROUP BY CT.Name,ft.Name ) src PIVOT (SUM(Mass) FOR FT_Name IN([Apple],[Apricot],[Banana])) AS pvt
Leave a comment:
-
to create another copy of the database,
first take the backup of existing database,
create a new database
restore the new database with the backup taken...Leave a comment:
-
Hi,
use the following query:
(this query is created based on the sample data given)
SELECT P.Table1_ID,Tab le2_Content,Tab le3_Content
FROM #Table1 P FULL JOIN
#Table2 A FULL JOIN
#Table3 B ON ISNULL(SUBSTRIN G(A.Table2_Cont ent,LEN(A.Table 2_Content)- 1,LEN(A.Table2_ Content)),B.Tab le3_Content) =
ISNULL(SUBSTRIN G(B.Table3_Cont ent,LEN(B.Table 3_Content)- 1,LEN(B.Table3_ Content)),A.Tab le2_Content)...Leave a comment:
No activity results to display
Show More
Leave a comment: