Home > database >  PB call a stored procedure
PB call a stored procedure

Time:10-06

I is such a stored procedure source code (note: was built in SQL2000)

- get drug information and inventory quantity (tube)
CREATE PROCEDURE GetYpAndKc
@ yfbh Varchar (20),
@ ypbh Varchar (20)
AS
# the create table t1 (
Ypbh varchar (10), - drug Numbers
ZJC varchar (10), - word mnemonic
Ypmc varchar (30),
medicine's name -Mz_gg varchar (20), outpatient service specification
Mz_dw varchar (4), - outpatient units
Mz_kcsl numeric (18, 2), the outpatient service quantity inventory,
Mz_dj numeric (18, 3), - outpatient unit price
Zy_gg varchar (20),
- hospital specificationZy_dw varchar (4), unit -
Zy_kcsl numeric (18, 2), the number -
Zy_dj numeric (18, 3), the unit price
)
If the exists (select m_code from global.. Drugcode where m_code like @ ypbh or m_alias like @ ypbh
The or ZJC like @ ypbh or m_name like @ ypbh)
Insert into # t1
Select m_code m_alias, m_name, mz_scale mz_unit, 0, mz_price, zy_scale, zy_unit, 0, zy_price
The from global.. Drugcode
Where m_code like @ ypbh or m_alias like @ ypbh or ZJC like @ ypbh or m_name like @ ypbh
The else
Insert into # t1
Select m_code m_alias, m_name, mz_scale mz_unit, 0, mz_price, zy_scale, zy_unit, 0, zy_price
The from global.. Drugcode
Update # t1 set
Mz_gg=(select mz_gg from global.. Yfkc where yfbh=@ yfbh and ypbh=# t1. Ypbh),
Mz_dw=(select mz_dw from global.. Yfkc where yfbh=@ yfbh and ypbh=# t1. Ypbh),
Mz_kcsl=(select mz_kcsl from global.. Yfkc where yfbh=@ yfbh and ypbh=# t1. Ypbh),
Mz_dj=(select mz_dj from global.. Yfkc where yfbh=@ yfbh and ypbh=# t1. Ypbh),
Zy_gg=(select zy_gg from global.. Yfkc where yfbh=@ yfbh and ypbh=# t1. Ypbh),
Zy_dw=(select zy_dw from global.. Yfkc where yfbh=@ yfbh and ypbh=# t1. Ypbh),
Zy_kcsl=(select zy_kcsl from global.. Yfkc where yfbh=@ yfbh and ypbh=# t1. Ypbh),
Zy_dj=(select zy_dj from global.. Yfkc where yfbh=@ yfbh and ypbh=# t1. Ypbh)
Where ypbh in (select ypbh from global.. Yfkc where yfbh=@ yfbh)
Select * from # t1 order by ypbh
GO


I want to use PB data window to get the following several
Ypbh varchar (10), - drug Numbers
ZJC varchar (10), - word mnemonic
Ypmc varchar (30),
medicine's name -Mz_gg varchar (20), outpatient service specification
Mz_dw varchar (4), - outpatient units
Mz_kcsl numeric (18, 2), the outpatient service quantity inventory,
Mz_dj numeric (18, 3), - outpatient unit price
Excuse me, how to implement, please comment, resolved, I will put all points on
My QQ: 107380613

CodePudding user response:

//the purpose of your stored procedure and you expect the result of some wrong, call the process method in PB as follows: (you give it a try)
//define any process variable name: p_ccl
//in the database have defined the process: P_GKHWCCL containing two parameters

DECLARE p_ccl PROCEDURE FOR P_GKHWCCL (yfbh, : ypbh);

The EXECUTE p_ccl;

The CLOSE p_ccl;

The way, if you want to get you to the data content, why don't you do a # about table t1 data window, and you should be in field is not it?
????? Don't you want to use process returns to the field of content you?? (to not have to do this, but also can make a data source is stored procedure data window, but you are above this process seems to be no good!!!!)

CodePudding user response:

This can produce a few at the front desk directly, not need stored procedure!
Program to write simple, don't complicate!

CodePudding user response:

Thanks for 1/f, answer, the problem is I can't change the database, because I have only read permissions

CodePudding user response:

I can't halo ah, according to the first floor of the method

CodePudding user response:

Remove the data directly in the front desk call DATAWINDOW OL

CodePudding user response:

Use stored procedures data source can generate the data window

CodePudding user response:

guanzhu
  • Related