Click here to Skip to main content
15,899,679 members
Home / Discussions / Database
   

Database

 
AnswerRe: Why is my T-SQL function considered non-deterministic? Pin
Colin Angus Mackay1-Feb-07 2:31
Colin Angus Mackay1-Feb-07 2:31 
GeneralRe: Why is my T-SQL function considered non-deterministic? Pin
michal.kreslik1-Feb-07 6:09
michal.kreslik1-Feb-07 6:09 
AnswerRe: Why is my T-SQL function considered non-deterministic? Pin
Chris Meech1-Feb-07 8:01
Chris Meech1-Feb-07 8:01 
GeneralRe: Why is my T-SQL function considered non-deterministic? Pin
michal.kreslik1-Feb-07 8:40
michal.kreslik1-Feb-07 8:40 
GeneralRe: Why is my T-SQL function considered non-deterministic? Pin
michal.kreslik1-Feb-07 9:07
michal.kreslik1-Feb-07 9:07 
GeneralRe: Why is my T-SQL function considered non-deterministic? Pin
michal.kreslik1-Feb-07 9:31
michal.kreslik1-Feb-07 9:31 
Answerthe solution Pin
michal.kreslik1-Feb-07 18:47
michal.kreslik1-Feb-07 18:47 
QuestionUpload a binary file with vb.net from an xml node Pin
orlija31-Jan-07 22:06
orlija31-Jan-07 22:06 
Hi experts.

I'm trying to upload binary file into an oracle blob field. I retrieve the binary file from an XML document loaded in memory. I'll try to explain this in detail:

1) A page builds an XMLDocument with client code. In a node of this document, it sets the type to binary and attach a local filesystem document. Then, assigns the value to an hidden input field and sends it to itself
2) This page receives the post data, selects the binary content of the xml node and try to insert the binary data into the blob field (server side code).

I show you the code of this two parts:

1) This part works propertly (I only shows it for if it helps you)


function creaObjecte()
{
// create ADO-stream Object
var ado_stream = new ActiveXObject("ADODB.Stream");

// create XML document with default header and primary node
var xml_dom = new ActiveXObject("MSXML2.DOMDocument");
xml_dom.loadXML('<?xml version="1.0" ?> <root/>');
// specify namespaces datatypes
xml_dom.documentElement.setAttribute("xmlns:dt", "urn:schemas-microsoft-com:datatypes");

// create a new node and set binary content
var l_node1 = xml_dom.createElement("file1");
l_node1.dataType = "bin.base64";
// open stream object and read source file
ado_stream.Type = 1; // 1=adTypeBinary
ado_stream.Open();
ado_stream.LoadFromFile("C:\\TEMP\\b.pdf");
// store file content into XML node
l_node1.nodeTypedValue = ado_stream.Read(-1); // -1=adReadAll
ado_stream.Close();
xml_dom.documentElement.appendChild(l_node1);

document.getElementById("p_arxiu").value = xml_dom.xml;
}


2) I'm using this code. It inserts data into the blob, but doesn't inserts the binary data correctly (I use a pl/sql procedure for download the binary fields for the moment)

Protected Sub btnenviar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnenviar.Click

' Cadena de connexió a oracle
'Dim connectionString As String = "Data Source=AJSTJUST; Password=ajstjust;User ID=AJSTJUST"
Dim connectionString As String = "Data Source=AJSTJUSTCREAF; Password=sipan_mact;User ID=sipan_mactuacions"

' Recuperem l'arxiu binari del node que toca
Dim nodeBinari As XmlNode

Dim xmlHidden As XmlDocument
xmlHidden = New XmlDocument()
xmlHidden.LoadXml(arxiuBinari)

' Seleccionem el node que conté el binari
nodeBinari = xmlHidden.DocumentElement.SelectSingleNode("file1")
If (nodeBinari Is Nothing) Then
Response.Write("No s'ha trobat el node
")
Exit Sub
End If

' Passem el contingut del node a format binari
Dim binariFinal() As Byte = Convert.FromBase64String(nodeBinari.InnerText)

Dim queryString As String = _
"INSERT INTO DEMO (ID,THEBLOB) VALUES (1,'" & binariFinal(1) & "')"

Using connection As New OracleConnection(connectionString)
Dim command As New OracleCommand(queryString)
command.Connection = connection
Try
connection.Open()
command.ExecuteNonQuery()
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Using

End Sub

I think the problem is in this little piece of code:

' Passem el contingut del node a format binari
Dim binariFinal() As Byte = Convert.FromBase64String(nodeBinari.InnerText)

Dim queryString As String = _
"INSERT INTO DEMO (ID,THEBLOB) VALUES (1,'" & binariFinal(1) & "')"

But I'm newbie in .NET and I don't know how to do this.

Any help would be aprreciated. Thanks.
QuestionImplementing "Merge replication" in Vs.Net 2005 Pin
Spaz8031-Jan-07 21:57
Spaz8031-Jan-07 21:57 
QuestionSQL: how many type of Store Procedure parameter ? Pin
PavanPareta31-Jan-07 21:41
PavanPareta31-Jan-07 21:41 
AnswerRe: SQL: how many type of Store Procedure parameter ? Pin
Pete O'Hanlon1-Feb-07 0:05
mvePete O'Hanlon1-Feb-07 0:05 
GeneralRe: SQL: how many type of Store Procedure parameter ? Pin
PavanPareta1-Feb-07 1:10
PavanPareta1-Feb-07 1:10 
QuestionSQL: diffrence between Clustered and Non Clustered Indexing Pin
PavanPareta31-Jan-07 21:39
PavanPareta31-Jan-07 21:39 
AnswerRe: SQL: diffrence between Clustered and Non Clustered Indexing Pin
Pete O'Hanlon31-Jan-07 22:24
mvePete O'Hanlon31-Jan-07 22:24 
GeneralRe: SQL: diffrence between Clustered and Non Clustered Indexing Pin
PavanPareta31-Jan-07 23:35
PavanPareta31-Jan-07 23:35 
AnswerRe: SQL: diffrence between Clustered and Non Clustered Indexing Pin
michal.kreslik31-Jan-07 22:26
michal.kreslik31-Jan-07 22:26 
GeneralRe: SQL: diffrence between Clustered and Non Clustered Indexing Pin
PavanPareta31-Jan-07 23:31
PavanPareta31-Jan-07 23:31 
QuestionDatabase information Pin
John Gathogo31-Jan-07 21:00
John Gathogo31-Jan-07 21:00 
AnswerRe: Database information Pin
Pete O'Hanlon31-Jan-07 22:26
mvePete O'Hanlon31-Jan-07 22:26 
Questioncan we give more than one fielsd as primary key in a table Pin
anujose31-Jan-07 18:26
anujose31-Jan-07 18:26 
AnswerRe: can we give more than one fielsd as primary key in a table Pin
Guru bhai31-Jan-07 18:57
Guru bhai31-Jan-07 18:57 
Question[Ask] How to reset Identity Column? Pin
Jati Indrayanto31-Jan-07 15:03
Jati Indrayanto31-Jan-07 15:03 
AnswerRe: [Ask] How to reset Identity Column? Pin
Sylvester george31-Jan-07 23:40
Sylvester george31-Jan-07 23:40 
GeneralRe: [Ask] How to reset Identity Column? Pin
Jati Indrayanto1-Feb-07 15:22
Jati Indrayanto1-Feb-07 15:22 
Answer[Solved] How to reset Identity Column? Pin
Jati Indrayanto4-Feb-07 21:06
Jati Indrayanto4-Feb-07 21:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.