You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
I have a procedure.
When I create it, will throw a error:
CREATE PROCEDURE AddTrade
@buyerId nvarchar(50),
@platform INT,
@mobile varchar(20),
@telephone varchar(20),
@orderId varchar(50),
@fullname nvarchar(20)
ASBEGIN
if not exists(select1from [Account] where id=@buyerId)
beginINSERT INTO [Account](id) VALUES(@buyerId)
end
if not exists(select1from [Mobile] where id=@mobile)
beginINSERT INTO [Mobile](id) VALUES(@mobile)
end
if @telephone <> @mobile and not exists(select1from [Mobile] where id=@telephone)
beginINSERT INTO [Mobile](id) VALUES(@telephone)
end
if not exists(select1from [Trade] where orderId=@orderId)
beginINSERT INTO [Trade](orderId,[platform],fullname) VALUES(@orderId,@platform,@fullname)
end
INSERT EDGE INTO Account.HasTradeSELECT a,t FROM Account a , Trade t
WHEREa.id= @buyerId ANDt.orderId= @orderId ;
INSERT EDGE INTO Account.UseMobileSELECT a,t FROM Account a , Mobile t
WHEREa.id= @buyerId ANDt.id= @mobile ;
INSERT EDGE INTO Mobile.HasTradeSELECT a,t FROM Mobile a , Trade t
WHEREa.id= @mobile ANDt.orderId= @orderId ;
INSERT EDGE INTO Mobile.HasAccountSELECT a,t FROM Mobile a , Account t
WHEREa.id= @mobile ANDt.id= @buyerId ;
INSERT EDGE INTO Trade.UseAccountSELECT t,a FROM Account a , Trade t
WHEREa.id= @buyerId ANDt.orderId= @orderId ;
INSERT EDGE INTO Trade.UseSecMobileSELECT t,a FROM Mobile a , Trade t
WHEREa.id= @telephone ANDt.orderId= @orderId ;
INSERT EDGE INTO Trade.UseMainMobileSELECT t,a FROM Mobile a , Trade t
WHEREa.id= @mobile ANDt.orderId= @orderId ;
if not (@telephone=@mobile) -- the same as @telephone<>@mobilebegin
INSERT EDGE INTO Account.UseMobileSELECT a,t FROM Account a , Mobile t
WHEREa.id= @buyerId ANDt.id= @telephone ;
INSERT EDGE INTO Mobile.HasTradeSELECT a,t FROM Mobile a , Trade t
WHEREa.id= @telephone ANDt.orderId= @orderId ;
INSERT EDGE INTO Mobile.HasAccountSELECT a,t FROM Mobile a , Account t
WHEREa.id= @telephone ANDt.id= @buyerId ;
end
END"
And the if block diff position in code ,the error is different.
I resolve this by the code:
if (@telephone=@mobile)
begin
return
end
INSERT EDGE INTO Account.UseMobileSELECT a,t FROM Account a , Mobile t
WHEREa.id= @buyerId ANDt.id= @telephone ;
INSERT EDGE INTO Mobile.HasTradeSELECT a,t FROM Mobile a , Trade t
WHEREa.id= @telephone ANDt.orderId= @orderId ;
INSERT EDGE INTO Mobile.HasAccountSELECT a,t FROM Mobile a , Account t
WHEREa.id= @telephone ANDt.id= @buyerId ;
The text was updated successfully, but these errors were encountered:
Thanks for posting the issue. Could you please post the exception message(s) you received?
Or even better, is it possible to share your graph schema, by including the CREAET TABLE statements that specify the graph structure? Without this info, we had a little difficulty in identifying the problem.
I have a procedure.
When I create it, will throw a error:
And the if block diff position in code ,the error is different.
I resolve this by the code:
The text was updated successfully, but these errors were encountered: