Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello all,
I am trying insert some values in a table in Sybase database, but i receive the following error:
1> Insert into account_hierarchy (company_stablekey,provider_id,account_name,msisdn,parent_msisdn,up_account_allowed,is_used) values (45959582,1,L10CUSTID2054936,550100102765,NULL,0,1)
2> go
Msg 128, Level 15, State 2:
Server 'SQL_ADM', Line 1:
The name 'L10CUSTID2054936' is illegal in this context. Only constants, constant expressions, or variables allowed here. Column names are illegal.Then i tried execute a procedure that do it, but i received a new error:
1> execute proc_ins_account 45959582, 1, L10CUSTID2054936, 550100102765, NULL, 0, 1
2> go
Msg 257, Level 16, State 1:
Server 'SQL_ADM', Procedure 'proc_ins_account':
Implicit conversion from datatype 'INT' to 'VARCHAR' is not allowed. Use the CONVERT function to run this query.
Msg 257, Level 16, State 1:
Server 'SQL_ADM', Procedure 'proc_ins_account':
Implicit conversion from datatype 'NUMERIC' to 'VARCHAR' is not allowed. Use the CONVERT function to run this query.
(return status = -6)Now, the problem is with L10CUSTID2054936 and Null values ...
Follow bellow the structure of this procedure:
3> sp_helptext proc_ins_account
4> go
# Lines of Text
---------------
6(1 row affected)
text
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--
-- Insert an account
--
create proc proc_ins_account(
@company_stablekey StableKey,
@provider_id ProviderId,
@dname DName,
@account_name AccountName,
@msisdn MsIsdn,
@up_
account_allowed tinyint,
@is_used tinyint)
as
declare @dname_msisdn MsIsdn,
@parent_msisdn MsIsdn,
@dname_account_name AccountName,
@ret_value int-- lookup parent MSISDN
exec @ret_value = proc_dname_analysis
@company_stablekey,
@provider_id,
@dname,
@dname_msisdn output,
@parent_msisdn output,
@dname_account_name output,
"new"if (@ret_value = 0) and (@account_name = @dname_account_name)
begin
-- New account looks good
insert into account_hierarchy
(company_stablekey,
provider_id,
account_name,
msisdn,
parent_msisdn,
up_account_allowed,
is_used
)
values
(@company_stablekey,
@provider_id,
@accou
nt_name,
@msisdn,
@parent_msisdn,
@up_account_allowed,
@is_used
)return 0
end-- Something went wrong
return @ret_value
(6 rows affected)
(return status = 0)
1>
Can anyone help me ?

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |