Posted By: DaveH INSERT...Doesn't - 06/20/00 01:44 AM
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
Posted By: Johan Visser Re: INSERT...Doesn't - 06/20/00 01:58 PM
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
Posted By: DaveH Re: INSERT...Doesn't - 06/21/00 05:01 AM
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
Posted By: Marco Kalter Re: INSERT...Doesn't - 06/22/00 05:52 PM
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
Posted By: TechE Re: INSERT...Doesn't - 07/07/00 05:06 AM
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
Posted By: Marco Kalter Re: INSERT...Doesn't - 07/10/00 01:35 PM
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
© Allround Automations forums