powered by simpleCommunicator - 2.0.60     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / PostgreSQL [игнор отключен] [закрыт для гостей] / Помогите разобраться: he # of binded parameters < # of parameter...
1 сообщений из 1, страница 1 из 1
Помогите разобраться: he # of binded parameters < # of parameter...
    #35146839
Большой Синий Кит
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Не пойму, в чем дело. Помогите, пожалуйста, разобраться. Есть вот такая функция:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
-- Function: pharm_billing_remove(p_id_invoice integer, p_id_billing integer)

-- DROP FUNCTION pharm_billing_remove(p_id_invoice integer, p_id_billing integer);

CREATE OR REPLACE FUNCTION pharm_billing_removeAll(p_id_invoice integer, p_id_billing integer)
 RETURNS integer AS

$BODY$
Declare
l_billing_invoice int;
l_id_patient   int;
l_id_invoice   int;
l_unitNumber   int;
BEGIN

Select  id_patient
 Into l_id_patient
From  pharm_invoice
Where id_invoice=p_id_invoice;
--- not found ---
If Not FOUND
Then
RAISE EXCEPTION 'Invoice [%] not found!', p_id_invoice;
End If;
--- check billing remainder ---
Select   id_invoice,
  unitNumber
   Into l_billing_invoice,
    l_unitNumber
From   pharm_Billing
Where   id_billing=p_id_billing;



If Not FOUND
Then
RAISE EXCEPTION 'Billing [%] not found!', p_id_billing;
End If;


If l_billing_invoice<>p_id_invoice
Then
RAISE EXCEPTION 'Billing [%] not applied to invoice [%]!', p_id_billing,p_id_invoice;
End If;


If l_unitNumber<= 0 
Then
RAISE EXCEPTION 'Billing [%] dont have units!', p_id_billing;
ELSE(

 Delete
From  pharm_InvoiceItems
Where  id_billing=p_id_billing;

Delete
From  pharm_billing
Where  id_billing=p_id_billing;
)

End If;





If Not Exists(
 Select   1 
 From pharm_Billing
 Where id_invoice=p_id_invoice
 ) And
Not Exists(
 Select   1 
 From pharm_InvoiceOperations
 Where id_invoice=p_id_invoice
 )
Then

Update  pharm_Invoice
Set  Status ='D'
Where id_invoice=p_id_invoice;
End If;  

Return l_id_invoice;
END;
$BODY$
 LANGUAGE 'plpgsql';
ALTER FUNCTION pharm_billing_removeAll(p_id_invoice integer, p_id_billing integer) OWNER TO root;

При ее записи вот такая ошибка вылетает:
The # of binded parameters < the # of parameter markers

Почему, подскажите....?
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / PostgreSQL [игнор отключен] [закрыт для гостей] / Помогите разобраться: he # of binded parameters < # of parameter...
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]