Decode Base64 To Image!
Jun 7, 2006
Hi,
I have a xml string which is consist of some images encoded in base64; I have to extract these images in a stored procedure and save them in some tables.
The problem is that I can't decode this base64s to images. Is there a way to do it? (I use SQL Server 2005 Enterprise)
Thanx
View 5 Replies
ADVERTISEMENT
Feb 28, 2008
Does anyone have some TSQL that will do a base64 encode? I have a need for uid and pwd columns and need to have a third field that will be these values base64 encoded. Best way I can figure is to have a trigger on insert/update.
Please note that I am using Windows Server 2000 and using SQL Server 2000.
View 4 Replies
View Related
May 18, 2006
Hi
How do you decode an image (found inside an xml file) which has been encoded in MIME Base 64. If you read in the string, how would you get the image?
I know other database systems (like ASA) that has a build in function to do it for you but I cant find a similar function in SQL Express?
Thanks
View 1 Replies
View Related
Feb 16, 2004
Yes i just can't find a place to help me out on something.
Everything went well to create the XML using transact SQL command
SELECT TOP 10 * FROM TblEvenement for xml auto, binary base64
But how do decode my image field in my XML so i can save the data into a new table ..
all this as to be done in a store procedure inside SQL-Server 2000 !!
thanx guys !!
***Any good sites or example i can use for !!
View 5 Replies
View Related
Jan 12, 2004
In Oracle we have expression
SELECT
.....
DECODE (T.LANGUAGE, 'E', T.DESC_ENG, T.DESC)
FROM
TABLE T
if acts like that :
if T.LANGUAGE = 'E' it returns T.DESC_ENG. If it is different - T.DESC.
Is there some way to make the same in MS SQL Server ?
View 10 Replies
View Related
Jul 20, 2005
I have to run a query to give a column a value based on a time range. Can Iuse DECODE?select decode(trans_date, trans_date>='01-Jul-2002' andtrans_date<='30-Jun-2003','Fiscal2002', .....) as fiscal,from. . .where. . .
View 1 Replies
View Related
Aug 28, 2001
HI,
Is there any way to replicate the decode function in SQL Server 7.0? I have a problem where I have to write a query such that if the value in a column is '0' , I need to output it as 'No' and if it is '1', I need to output it as 'Yes'. An example of my problem is as follows:
select col_1+","+(value 'No' if col_2='0' and 'Yes' if col_2='1')+
","+col_3+...........
I appreciate your help in advance.
thanks,
Sravan.
View 3 Replies
View Related
Jun 4, 2004
Hi
I have oracle statement and I want to translate it in SQL Server:
select DECODE(count(bid_Vendor), 1, NULL, COUNT(BID_VENDOR))
from bid_total
I tried it this way:
Select case(count(bid_vendor) when 1 then null else count(bid_vendor)end) as cs from bid_total
It gave me error i.e.
Incorrect syntax near the keyword 'when'
View 1 Replies
View Related
Jun 8, 2008
Hello,
I need to do the following:
Lets say we have the following table.
A B C
1 XYZ XYZ
100
Now if the value of a is "100" then i need to do a join and get a value from another table, else I put the value of b a "test"
I am trying to do this using case
like this
select case
(when a = 100 then (select col from ....where newtable.id = a.id
else "test"
end) as xyz
from a,b,other tables.
But the problem is that the subquery returns more than one row..(it should return one row)
How do I do this?
View 1 Replies
View Related
Sep 30, 2006
hi i have a view in oracle. in that i am using decode function.
same query i want to write it in sqlserver. what it is the alternate
to decode.
this is a cross tab query
SELECT code, SUM(DECODE(field1, 4, Present_Value, 0)) AS c1, SUM(DECODE(field1, 5, Present_Value, 0)) AS c2,
SUM(DECODE(field1, 6, Present_Value, 0)) AS c3,SUM(DECODE(field1, 9, Present_Value, 0)) AS c4
FROM (SELECT field1,Code, Present_Value FROM table1) DERIVEDTBL GROUP BY code
thanks
suji
View 8 Replies
View Related
May 14, 2007
Hi,I have two questions, firstly..
I am hoping there is a way to GROUP BY on a concatenated output like the following decode etc..
SELECT
DECODE(PRIM_REASN,'','Reasons not entered',PRIM_REASN)
|| ' '
||SECDY_REASN
|| ' '
|| TERT_REASN) Downtime_Reasons,
EVENT_DUR/60 Minutes
FROM
DOWNTIME_WEB
WHERE
DOWNTIME_WEB.TIMESTAMP>= (SELECT PRODN_SHIFT.START_DATIME
FROM PRODN_SHIFT
WHERE
PRODN_SHIFT.START_DATIME <=sysdate
AND PRODN_SHIFT.END_DATIME > sysdate)
AND
TRIM(DOWNTIME_WEB.STATUS_TEXT) = 'STOPPED'
AND
TRIM(DOWNTIME_WEB.WORK_CTR_NAME) = 'PACK2'
ORDER BY DOWNTIME_WEB.EVENT_DUR
I have tried to put the DECODE etc into the GROUP BY statement but I get an error - " not a valid GROUP BY clause"
Secondly, is there a way of modifying value in field A based on the value in field B
Erroneous example follows - in an effort to explain what I want to do (from above):
DECODE(PRIM_REASN,'',(DECODE(EVENT_DUR,<200,"Low",>200,"High"),PRIM_REASN)
ie:If PRIM_REASN is null I want EVENT_DUR to be tested to determine the new value for PRIM_REASN.
Except that tthe above won't work and I don't know what the right function/argument should be..
This is my first foray into SQL server, I am trying to migrate some access queries to work with web services and hence Xcelsius.
Cheers.
View 4 Replies
View Related
Jul 20, 2005
What is the function in SQL that works like DECODE in Oracle?"Thanks,N
View 10 Replies
View Related
Jan 23, 2006
Hi!
I have a question about the "Decode" funktion. is it only avaiable in Oracle? The reason for my question is that I need to SELECT a colum in a table based on a int value. So if the uservalue is lower then that take that colum, lower then that take colum...etc.
Can I use decode? or/and is there better funktion (I'm using MS SQL 2005)
Thanks in advance
Mark
View 6 Replies
View Related
Dec 11, 2007
how can I write decode function in sql
such that i have a feild in my table called "file type" based on its content i want to pass a value to sql datasource
such that if file type = doc i want to pass "~/Images/ico_filetype_10.gif" an so on
View 1 Replies
View Related
Mar 27, 2001
I need to know what is the DECODE statement called in SQLSERVER?
Can somebody provide me simple decode statement for sqlserver.
Thanks,
Ranjan
View 1 Replies
View Related
Jun 21, 2004
Hi, Here is my oracle statement. How can I change it to be compatible with SQL Server?
update propertytable set visible =decode(propertyid, 1,0, 2,0, 3,1, 5,1, 6,1, 7,0, 9,1, 10,1, 11,0, 14,1, 30,1, 38,1, 60,0, 232,0, 233,0, 415,1, 605,0) where parentid between 2000006001 and 2000006020
Thanks...
View 10 Replies
View Related
Mar 6, 2008
I am a novice to SQL Server, so this is probably a really easy problemto fix. I'm translating an Oracle query and need to change the'decode' to something compatible. Everything I've read points me tousing 'case' but no matter how I write it I can't get it to work andget a syntax error. Suggestions?select SYST CTR, isnull(substring(CD_A, 1, 3), ' ') RESCODE, DES DESCRIPTION, decode (substring(CD_A, 1, 3), CODE,PRICE,0) UNIT_PRICE, count (distinct OR_NO) QTYW
View 11 Replies
View Related
Aug 2, 2006
Hi,
How to translate oracle Decode without changed code I mean:
I have one application and instead to change all decode to case when I would like just replace decode for dbo.decode, so I
Wrote this function
select dbo.fnDecode( 1 , 2 , 3 )
first parameter always int, and the others parameters could be char, int or float.
I would like to test first value and return second or third value
-> sql_variant for all parameters, ok
but I can use + or -
I can't do this
select dbo.fnDecode( 1 , 2 , 3 ) + dbo.fnDecode( 1 , 2 , 3 )
If I put cast ok, but I is there another way, overload this call?
With clr doesn't work, because Sql Server doesn't accept function overload calls from C#
Any ideia????????????????????
cheers,
View 4 Replies
View Related
Nov 20, 2014
how to execute this stored procedure to decode a varchar hexadecimal string? My SQL syntax stills have faded with the sands of time... I want to do a select * from the users table and decode the Password field (but not update) in the process.
CREATE PROCEDURE spPasswordDecode (@hex varchar (100), @passwordtext varchar (100) output)
AS
declare @n int,
@len int,
@str nvarchar(500),
@output varchar(100)
[code]....
View 4 Replies
View Related
Apr 20, 2007
I am using the 3-tiered architecture design (presentation, business laws, and data acess layers). I am stuck on how to send the image the user selects in the upload file control to the BLL and then to the DAL because the DAL does all the inserts into the database. I would like to be able to check the file type in the BLL to make sure the file being uploaded is indeed a picture. Is there a way I can send the location of the file to the BLL, check the filetype, then upload the file and have the DAL insert the image into the database? I have seen examples where people use streams to upload the file directly from their presentation layer, but I would like to keep everything seperated in the three classes if possible. I also wasn't sure what variable type the image would be in the function in the BLL that receive the image from the PL. If there are any examples or tips anyone can give me that would be appreciated.
View 2 Replies
View Related
Jun 27, 2007
Hay Friend's
Can u plese send me the way how to save image in sql server and display that images in datagrid or other control also like Image control or Image control Button?? Plese send the coding in C#.
Thank's
Amit
View 5 Replies
View Related
Jul 12, 2007
hi all,
i have created a table with image field in it. Now i just want to store a jpeg file in it but not finding any way to do so.
how can i store any image ? what are the steps???????
thanx in advance
View 5 Replies
View Related
Jul 6, 2006
Ok, the problem is that , i have a field called "Attach" in sql of type image, when selecting it , the field is getting data of type BYTE(). which am being unable to display them on an Image on the panel.
using the following vb.net code:
'Dim sel2 As String
'Dim myCom As SqlCommand
'Dim conn As New SqlConnection
'Dim drr As SqlDataReader
'Dim image As System.Drawing.Image
'sel2 = "select * from attach where att_desc = '" & DropDownList1.SelectedItem().Text & "' and doc_code = " & w_doc_code & " and subcode = " & w_doc_subcode & " and doc_num= " & w_doc_num & " "
'conn.ConnectionString = ("server=developer01;uid=sa;password=aims;database=DVPSOC;timeout=45")
'myCom = New SqlCommand(sel2, conn)
'conn.Open()
'drr = myCom.ExecuteReader()
'If drr.Read Then
' Me.ImageMap1.ImageUrl = drr.Item("attach")
'End If
'conn.Close()
Am getting an exeption on the following line Me.ImageMap1.ImageUrl = drr.Item("attach")
saying: Conversion from type 'Byte()' to type 'String' is not valid.
knowing that i tried converting using ToString but it's not getting any output then.
thanks for your help.
View 4 Replies
View Related
Feb 13, 2007
I have learned lots of informative thing from your forums. I have little problem regarding “Display image from SQL Server on ASP.NET� I have done it and image display on my page from SQL Server. I have cleared you here I have adopt two different methods which are following for displaying picture.
1.Response.BinaryWrite(rd("picture"))
2.image.Save(Response.OutputStream, ImageFormat.Jpeg)
but in both above methods I have faced little problem when image display on my page all other information can not display and I also want to display picture on my specific location on the page. My second question is can use any web control like “Image1� to display image from SQL Server where my pictures are stored.
Hope you will help me.
Thanks and regards
Aftab Abbasi
View 4 Replies
View Related
Mar 7, 2006
hi,i have inserted the image present in mydocuments using alter commandcreate table aa(a int, d image)insert into aa values (1,'F:prudhviaba 002.jpg')when i doselect * from aai am getting the result in the column d as0x463A5C707275646876695C70727564687669203030322E6A 7067how i can i view the image?pls clarify my doubtsatish
View 2 Replies
View Related
Jan 30, 2007
In my asp.net application I have a local report with an image control in thedetail row of the table and the Value attribute set as="File://" & Fields!FQPhotoFileName.ValueThe first row in the table always shows the wrong image and it's always thesame wrong image. The problem is there even when I change the sort order orthe criteria for the underlying dataset. For example, I ran a small testthat populated the dataset with 2 rows and 2 images. When I sort by anycolumn (e.g. ID) in ascending ascending order the ID=1 row (the 1st row)shows the wrong image and the ID=2 row shows the correct image. When I rerunthe report sorting in descending order the ID=2 row (which is now the 1strow) shows the wrong image and the ID=1 shows the correct image.Any suggestions?
View 1 Replies
View Related
Aug 17, 2007
Hi,
I have a website and i am uploading the gif image to the database. i have used varchar(500) as the datatype and i am saving the file in the webserver so the path to it c:intepub....a.gif
my upload table has the folliwing feilds
UploadId Int Identity, Description, FileName, DiskPath varchar(500), weblocation varchar(500). I have a main sproc for the report where i am doing a inner join with other table to get the path of the gif..
So my question is how can i get a picture to show up on the report. .
What kinda datatype the gif file should be stored in the database? If it is stored as a varchar how can i access it and what is best way to reference that particular.
any help will appreciated....
Regards
Karen
View 9 Replies
View Related
Sep 20, 2006
I have inherited a VS 2005 database with a table that has a column of type IMAGE. I need to change the image for one of the rows in the table. I have the new image in a *.PNG file on my C: drive. What is the correct method for inserting this file into the IMAGE column.
Many thanks!
View 6 Replies
View Related
Oct 19, 2004
I need to know how can i incoporate the functionality of DECODE function like the one in ORACLE in mSSQL..
please if anyone can help me out...
ali
View 1 Replies
View Related
Apr 1, 2007
Hi,
I need to show images in the report based on the urls from the db. The images are stored within a folder and not in the db (only the url in db). I couldnt find any way to give an url in the report and show the image. I'm stuck here , could you please help?
Thanks,
Sonu.
View 10 Replies
View Related
May 22, 2006
Hi,could anyone help me how to get the images from ms sql database with asp.net (visual basic)?I have a field in the database with datatype image, and there are a couple of images in this table.Now I am wondering how to get this images and view them on my .aspx page?Thank you.
View 1 Replies
View Related
Nov 6, 2012
Is it possible to get Image from URL, in a stored Procedure and store the image in db?
View 2 Replies
View Related
Dec 24, 2007
I'd like to display our logo image from a local file rather than embedding it. RS doesnt seem to like it when I use the local hard drive as a URL for locating the .bmp image (I just enter c:filename.bmp). Is there a simple recipe for either relocating this file locally to a place (eg IIS) that RS will consider a valid URL or leaving it where it is but still entering the URL in a way that will allow RS to get it at run time from the c: drive?
View 4 Replies
View Related