Print Thread
INSERT...Doesn't
#624 06/20/00 01:44 AM
Joined: Jan 2000
Posts: 35
Pottstown, PA USA
D
DaveH Offline OP
Member
OP Offline
Member
D
Joined: Jan 2000
Posts: 35
Pottstown, PA USA
A simple statement:

begin
insert into wmail (sender,recipient,subject,date_sent,messagetext)
VALUES (:sender,:recipient,:subject,:date_Sent,:messagetext);
commit;
end;
as the SQL of an OracleQuery errors with ORA 01465 Invalid Hex number at Line 2

Any ideas?
Dave

Re: INSERT...Doesn't
#625 06/20/00 01:58 PM
Joined: Oct 1999
Posts: 10
Rotterdam, ZH, Netherlands
J
Member
Offline
Member
J
Joined: Oct 1999
Posts: 10
Rotterdam, ZH, Netherlands
I have tried the same statement and I had no problems.

What are the datatypes of the variables used in the query. Are they the same datatype as the columns in the table?
Also, what are the datatypes you pass to the variables from your program.

Greetings Johan

------------------
JohaViss


JohaViss
Re: INSERT...Doesn't
#626 06/21/00 05:01 AM
Joined: Jan 2000
Posts: 35
Pottstown, PA USA
D
DaveH Offline OP
Member
OP Offline
Member
D
Joined: Jan 2000
Posts: 35
Pottstown, PA USA
Turns out that "messagetext" was a LONG RAW. When I changed it to VARCHAR2 the problem went away.

However, I still can't understand quite why it wouldn't work with the LONG RAW definition.

Dave

Re: INSERT...Doesn't
#627 06/22/00 05:52 PM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
If you declare a string variable for a long raw data type, then the Oracle Server will interpret it as a hexadecimal string. So if you want to do this, you must convert your binary data to hex.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: INSERT...Doesn't
#628 07/07/00 05:06 AM
Joined: Jul 2000
Posts: 1
T
Member
Offline
Member
T
Joined: Jul 2000
Posts: 1
Hello

I'm having the same problem, but I don't understand what you mean when you say "So if you want to do this, you must convert your binary data to hex."

Isn't a number is a number is a number?

My code worked fine with the BDE, but I am having trouble converting this portion of code to use DOA... please help

Re: INSERT...Doesn't
#629 07/10/00 01:35 PM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
With 'the same problem' you mean that you are using a string variable to pass a long raw value? If so, just change it to a long raw variable and you should be fine. You can now use SetVariable with a string argument, which will pass the string value byte for byte to the long raw variable. You can also use SetLongVariable, which accepts a pointer to your binary data and doesn't copy any memory.

If this doesn't help, let me know what you are trying to accomplish and what the problem is.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.084s Queries: 13 (0.031s) Memory: 2.5170 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-04-29 20:38:50 UTC
Valid HTML 5 and Valid CSS