"Space must be allocated for the bind parameter"
This is how to return a responsibility??
My PB code is as follows:
DECLARE add_account PROCEDURE FOR sp_add_account
@ acc_email=: acc_email,
@ acc_password=: acc_password,
@ acc_type=: acc_type,
@ err1out=: err1 output,
@ err2out=: err2 output,
@ succout=: succ output
Using the SQLCA.
The EXECUTE add_account;
If the SQLCA. SQLCode=0 then
The FETCH add_account INTO: err1 and err2, : succ.
If err1="and" err2="" then
MessageBox (" success ", succ)
Elseif err2="" and succ=" "then
MessageBox (" error ", err1)
Elseif err1="" and succ=" "then
MessageBox (" error ", err2)
End the if
The close add_account;
Open (register)
The else
Is_msg=SQLCA. SqlErrText
MessageBox (Execute "failed", string (SQLCA. Sqlcode) + is_msg)
Return
End the if
End the if
Sybase stored procedures:
The create proc sp_add_account
(@ acc_email varchar (80), @ acc_password varchar (10), @ acc_type varchar (80), @ err1out varchar (80) out, @ err2out varchar (80) out, @ succout varchar (80) out,)
As
The begin
/* check if this email address has existed */
If the exists (select 1 from the account where the lower (acc_email)=the lower (@ acc_email))
The begin
The set @ err1out='This account from the existed'
Return
End
/* check if the type is valid */
If (the lower (@ acc_type) & lt;> 'admin' or lower (@ acc_type) & lt;> 'customer')
The begin
The set @ err2out='not a valid account type'
Return
End
The else
The begin transaction
Insert into account
Values
(the lower (@ acc_email), @ acc_password, @ acc_type)
The set @ succout='add a new account'
Commit
End
If @ @ error<> 0
The begin
The rollback transaction
End
It a lot, but not be solution ~ ~
I am a rookie, PB great god guide, genuflect is begged,
CodePudding user response:
How no one I,,,CodePudding user response:
DECLARE add_account PROCEDURE FOR sp_add_account@ acc_email=: acc_email,
@ acc_password=: acc_password,
@ acc_type=: acc_type,
@ err1out=: err1 output,
@ err2out=: err2 output,
@ succout=: succ output
Using the SQLCA.
To try the following
DECLARE add_account PROCEDURE FOR sp_add_account
@ acc_email=: acc_email,
@ acc_password=: acc_password,
@ acc_type=: acc_type
Using the SQLCA.
CodePudding user response:
OrThe EXECUTE add_account;
Before the three input parameters are assigned values, likely caused by the parameter is empty
CodePudding user response:
This is how we callLdt_today=wi_nvo_server. Uf_servertime ()
the sqlca. The autocommit=true
Declare report_gethours procedure for dbo. Report_gethours_sp @ sdate=: indate, @ edate=: ldt_today, @ hours=: li_hours output using the sqlca.
The execute report_gethours;
The fetch report_gethours into: li_hours;
The close report_gethours;
the sqlca. The autocommit=false
You add red font code try
CodePudding user response: