wood burning stoves 2.0
The moose likes JDBC and Relational Databases and the fly likes JDBC Error MSSQL Uniqueidentifier Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC Error MSSQL Uniqueidentifier" Watch "JDBC Error MSSQL Uniqueidentifier" New topic

JDBC Error MSSQL Uniqueidentifier


Joined: Sep 13, 2002
Posts: 3
I am attempting to run a callable statement and I am getting this error:

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Error converting data type nvarchar to uniqueidentifier.

this is the signature of the stored procedure.

CREATE PROCEDURE p_order_create
@output_message AS varchar(255) OUTPUT,
@executer_entity_id AS uniqueidentifier,
@executer_entity_hierarchy_id AS uniqueidentifier,
@executer_company_id AS uniqueidentifier,
@order_id AS uniqueidentifier OUTPUT,
@u_id_order_type AS uniqueidentifier,
@u_id_order_origination AS uniqueidentifier,
@entity_id_customer AS uniqueidentifier,
@entity_id_vendor AS uniqueidentifier,
@request_subject AS varchar(100) = NULL,
@request_description AS varchar(2000) = NULL,
@address_1 AS varchar(100) = '',
@address_2 AS varchar(100) = NULL,
@city AS varchar(50) = NULL,
@state AS char(2) = NULL,
@zip AS char(6) = '',
@zip4 AS char(4) = NULL,
@valid AS smallint = 0,
@latitude AS decimal(8,4) = NULL,
@longitude AS decimal(8,4) = NULL,
@reference_number AS varchar(50) = NULL,
@parcel_number AS varchar(50) = NULL,
@entity_id_source AS uniqueidentifier = NULL,
@reference_number_source AS varchar(50) = NULL,
@datetime_received AS datetime = NULL,
@u_id_order_priority as uniqueidentifier =null,
@order_number as varchar(12) =null

I am using the M$$QL Driver from M$ft. Here is the code that I am using to run the procedure in Java.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63222


We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Forum Bartender

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Have you checked out Aspose?
subject: JDBC Error MSSQL Uniqueidentifier
It's not a secret anymore!