c******a 发帖数: 2516 | 1 各位大虾:
小弟再使用oracle时碰到一个问题,急需解决,望各位援手!
新建一个package, 其中所操作的表是可变的,所以要用变量控制
所操作的表,即将表名用varchar2变量代替,不知可否!
反正当create 一个包体时总是报错!
例子如下:
create or replace package pkgtest as
procedure tmp(ddot in integer,tbname in varchar2);
end pkgtest;
/
create or replace package body pkgtest as
procedure tmp(ddot in integer,tbname in varchar2)
is
tmpname varchar2(40);
tmpdot number(5);
begin
select name,dot into tmpname, tmpdot
from tbname
where dot=ddot;
|
|
j****s 发帖数: 34 | 2 I want to know how many records existing in the database.
In sql, it is
select count(*) from customer;
But I do not know how to get it in stored procedure.
CREATE proc countcustom @num Int output
as
select count(*) from user1
select @num = @@ROWCOUNT
return
GO
But num is always 1, since I do not know the meaning of @@ROWCOUNT, ( I copy
from other examples, :-()
I wonder somebody can help me, also is there any document or tutorai for
stored procedure? I do not quite understand the grammar o |
|
M*******r 发帖数: 522 | 3 需要写一些在OracleServer上用的SQL Script和 stored procedure。
偶从来就没有做过和db有关的项目,只有过两星期的SQL training
还是四年前...
请大侠们推荐一两本好的入门教材,最好能讲清楚怎么写stored procedure...
多谢... |
|
c**g 发帖数: 274 | 4 use a loop and charindex function.
Usually I join an array of String by ":", pass this joined string
as a single varchar parameter to stored procedure, then in
the stored procedure, a loop and charindex function go through
all of them. Can't write down the code without my reference. I
always copy/paste.
My bad memory really gave me a hard time during my job hunting
back years ago. I just can't remeber the syntax. It is the most embarrasing
moment when asked to wring code on paper, what a nightma |
|
ak 发帖数: 512 | 5 How could I excute stored procedure in Oracle under SQL*Plus?
For example: I have an sp_sel_test.sql
SQL> call sp_sel_test
but does not work. what command will work?
By the way, I wrote stored procedure under SQL*Plus, the use / to run. |
|
l********n 发帖数: 200 | 6 【 以下文字转载自 Programming 讨论区 】
发信人: lookforfun (lookforfun), 信区: Programming
标 题: 请各位帮我看看这个最简单的Stored Procedure
发信站: BBS 未名空间站 (Sun Dec 3 17:42:47 2006)
数据库很多TABLE是这样命名的,如 table_1, table_2,....现在有数字这个参数,怎
么把其中的数据拿出来?
由于数字这个参数,好像没法直接用SELECT..., 我用SET试了试(如下例),但外面定义
的变量t1/t2还不能用,还得在SET里再定义两个参数。如果这样,这些值怎么才能拿出
来用呢?
各位遇到这种情况吗?大家怎么处理的呢?谢谢了。
CREATE PROCEDURE sp_test
@TableID int,
@RecordID int
.
.
.
AS
SET NOCOUNT ON
DECLARE @sl varchar(8000), t1 int, t2 int, ......
SET @sl = 'DECLARE c1 int, c2 int'
SET |
|
l********n 发帖数: 200 | 7 【 以下文字转载自 Programming 讨论区 】
发信人: lookforfun (lookforfun), 信区: Programming
标 题: 再请教一个问题:stored procedure能不能直接显示信息什么的?
发信站: BBS 未名空间站 (Mon Dec 4 20:24:23 2006)
程序编译好了,也不想再动了,所以想动动stored procedure,让它弹出一个message
box或页面。
不知是否可行? |
|
t*********i 发帖数: 217 | 8 since you are using toad, find SYS in the drop down list on upperleft side,
click it; find the package or procedure label on left panel, click it, then
find the procedure.packages you want to see.
Ask your DBA for privilege if you don't have the permission to view sys/
system objects.
But I doubt they will give it to you if you are not a DBA... |
|
g********e 发帖数: 9 | 9 客户需要我们每天9点送一个文件.写了一个很简单的store procedure.问题是怎样可以
每天早上自动运行这个store procedure,然后把结果存在一个delimited形式的文件里,
再把这个文件放到客户的ftp site?
用SQLCMD吗?怎么用?
请大牛指点.谢谢 |
|
b**********a 发帖数: 25 | 10 @@IDENTITY returns the most recently created identity for your current
connection, not necessarily the identity for the recently added row in a
table. You could have a situation where there is a trigger that inserts a
new record in a Logs Table, for example, when your Stored Procedure or
INSERT SQL Statement inserts a record in the Orders Table. If you use @@
IDENTITY to retrieve the identity of the new order, you will actually get
the identity of the record added into the Log Table and not th... 阅读全帖 |
|
k**g 发帖数: 1558 | 11 建立一个自己的procedure用来rank不同table里面的数据
Create Procedure ASCRanking
@variable varchar(20),
@Rnk_variable varchar(20),
@tablename varchar(50),
@numberofcategory varchar(5),
@Partition varchar(50)
As
Declare @sql1 varchar(200)
Declare @sql2 varchar(200)
BEGIN
set @sql1='Alter Table '+@tablename+'Add '+@Rnk_variable+' real'
EXEC(@sql1)
--set @sql2='Update '+@tablename+
--' Set '+@Rnk_variable+'=NTILE('+@numberofcategory+') OVER(PARTITION BY '+@
Partition+' ORDER BY '+@variable+' ASC)'
--EXEC(@sql2)
END
... 阅读全帖 |
|
l******9 发帖数: 579 | 12 I need to run a SQL server 2008 R2 stored procedure from Eclipse pydev with
python 3.2 on win 7. If I run the stored procedure from management studio,
it works well.
But, if I run it from ptython , it does not work.
sql_str_test = """
DELETE FROM [my_db].[dbo].[my_table] -- this line works
EXEC [my_db].[dbo].[my_store_procedure] -- but this line
does not work, no run-time error message, but no results generated
"""
sql_str_connect = "DRIVER={S... 阅读全帖 |
|
H******6 发帖数: 51 | 13 Title: Designing Stored Procedure Solutions
Speaker: Jennifer McCown
When: May 28, 2016 from 9:00PM to 10:00PM EDT
Registration link: https://attendee.gotowebinar.com/register/
5104464413624015108
Abstract:
In this session, you’ll learn about SQL Server stored procedures (SPs):
what they are, when and why you’d use them, and how you’d go about
developing a solution with one. We will address common SP myths and learn
about planning for performance. Most of all, we’ll walk through examples to
expl... 阅读全帖 |
|
m*****g 发帖数: 138 | 14 【 以下文字转载自 Database 讨论区 】
发信人: moolong (穆珑), 信区: Database
标 题: 如何从一个Stored Procedure中实时返回运行信息
发信站: BBS 未名空间站 (Tue May 8 11:18:41 2007), 转信
假如一个Stored Procedure有很多步,有很多数据需要处理,需要运行很长时间
我如何让它运行时返回一些有用信息给用户,
告诉用户正在处理什么数据,正在运行哪一步
而我另外的程序,比如说C#.NET(Win form)可以抓住这些信息
实时显示给用户
谢谢 |
|
c*********e 发帖数: 16335 | 15 据说hibernate比stored procedure慢。如果用户要最快地得到数据库操作(GUID,join
)结果
,用hibernate还是
stored procedure? |
|
c*********e 发帖数: 16335 | 16 据说hibernate比stored procedure慢。如果用户要最快地得到数据库操作(GUID,join
)结果
,用hibernate还是
stored procedure? |
|
p*********e 发帖数: 17 | 17 Hi, Friends.
My PERL script is written in Object Oriented Programming
style; it called another perl script which is written in procedure style.
However, it failed. I guess if the reason is about the compatibility of
the 2 programming styles.
I wonder if both script must be written in same programming style: either
procedure or OO?
Thanks a lot! |
|
z***h 发帖数: 405 | 18
remove ";" inside sql String
make sure you are passing a String "null", not a null value
and inside your stored procedure, try to set default value if passing in
null for an argument
you might want to post the stored procedure code here too.
use stmt.executeUpdate(); |
|
F*******n 发帖数: 89 | 19 问题解决了。
这个store procedure里面既有select,也有update,所以不能有executeUpdate,只能
有execute。
问题出在在store procedure有多个results。
之前我没有capture这些results,结果就不行。
修改后把所有的results都capture了,结果我想要的结果就出来了。
那位大侠解释解释? |
|
l****e 发帖数: 9 | 20 【 以下文字转载自 Mathematics 讨论区,原文如下 】
发信人: lustre (紫色的花,young troubled soul), 信区: Mathematics
标 题: any procedures to compute and show the permutations?
发信站: The unknown SPACE (Tue Jun 11 16:18:35 2002) WWW-POST
Like pick n1 items from n items.
Is there any procedure to find out all the permutations and show them?
Since I need the sum for each permutation.
Thanks! |
|
b********5 发帖数: 605 | 21 “Procedure is everything.” As a regular classroom teacher, my daily
procedure is as following. What about yours?
The school I’m working for uses traditional daily schedule, which means we
have 7 periods a day, and 55 min. per period. Good thing of this schedule is
I can see my students everyday. Because I give them homework daily
including weekends, the first thing happened in the class is checking,
collecting, and explaining the homework. It normally takes about 15 mins.
And then there will be |
|
c*****e 发帖数: 3226 | 22 hi, I want to learn law suit procedure and terms in u.s.a. legal
system, such as Motion for Summary Judgement, MTD,joint motion, appeal
procedure. etc.
may you please recommend a good book or the right course name
in community colleage? |
|
|
w***7 发帖数: 1637 | 24 【 以下文字转载自 Medicine 讨论区 】
发信人: wk007 (无), 信区: Medicine
标 题: 保险说procedure 是experimental 不愿付钱
发信站: BBS 未名空间站 (Sat Jul 30 11:22:06 2016, 美东)
生小孩住院,有三个procedure,其中两个是transcranial doppler ultrasonography,
总共1000 多,保险说是experimental, 不愿付钱,怎么破? |
|
|
a***a 发帖数: 70 | 26 【 以下文字转载自 Pharmaceutical 讨论区 】
发信人: farmboy (Boy), 信区: Pharmaceutical
标 题: FPGEE Application Procedures
发信站: BBS 未名空间站 (Tue Dec 11 12:47:23 2007)
The following is the procedures I followed for applying for FPGEE:
1. Obtain official transcripts from the pharmacy school where you received
your degree. Remember ask the school official to sign the seal of the
transcripts. In the meantime, request a letter (Lack of Licensure) from Li
Laoshi which states that "You are qualified to practice pharmacy |
|
a***a 发帖数: 70 | 27 【 以下文字转载自 Pharmaceutical 讨论区 】
发信人: farmboy (Boy), 信区: Pharmaceutical
标 题: FPGEE Application Procedures
发信站: BBS 未名空间站 (Tue Dec 11 12:47:23 2007)
The following is the procedures I followed for applying for FPGEE:
1. Obtain official transcripts from the pharmacy school where you received
your degree. Remember ask the school official to sign the seal of the
transcripts. In the meantime, request a letter (Lack of Licensure) from Li
Laoshi which states that "You are qualified to practice pharmacy... 阅读全帖 |
|
l******9 发帖数: 579 | 28 【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: SQL run a stored procedure by fetching from a cursor row by row
发信站: BBS 未名空间站 (Fri May 23 17:57:23 2014, 美东)
I need to run a stored procedure on SQL server 2008.
But, I can only fetch one row from the cursor. After that, the @@FETCH_
STATUS is -1.
DECLARE @my_table TABLE
(
code int not null
);
INSERT INTO @my_table (id)
SELECT DISTINCT a.id
FROM table1 as a
WHERE a.value = 'abc'
ORDER BY a.id A... 阅读全帖 |
|
b*f 发帖数: 3154 | 29 procedure不能自己写么?
俺就是不知道有什么macro能做的procedure不能做 |
|
l*********s 发帖数: 5409 | 30 bao zi plz
//
macro is built on the top of procedure;so if procedures cannot do it, macro
won't do it either.
Macro is to help you simplify tasks/minize keystrokes. |
|
R*********i 发帖数: 7643 | 31 Say if you want to perform the same analyses on 10 variables, instead of
copying and pasting the same SAS procedures for 9 times with modifications,
you can write a macro and call the macro 10 times. Later on in case you want
to modify your analyses you can update the macro, instead of changing your
procedure 10 times. |
|
b*f 发帖数: 3154 | 32 In fact I just realized that, you can not write your own procedure (At least
not that easy). So if you want to implement any logic, you will have to use
macro. I came from other background so I thought SAS procedures are like
functions in other programming languages that you can write easily.
Am I understanding it correctly now? |
|
i****e 发帖数: 46 | 33 You should describe how to pick one procedure very time. If it is randomly
picked, then you can generate random number for corresponding procedure. You
may write 10-20 macro, then use select and when to run one of them each
time. |
|
g*********r 发帖数: 2847 | 34 ICD-9 codes are set for inpatient procedures. sometimes hospitals may
internally capture them to track outpatient services but in standard reports
, HCPCS should be used.
However, HCPCS can be used te record inpatient procedures and you may see
HCPCS, together with DRG in some claims data. |
|
g*********r 发帖数: 2847 | 35
I believe you are on the right track. however, 找到有关某个疾病的所有的
procedure may be very hard. 找到有关某个疾病的 typical procedures is more
doable. |
|
l******9 发帖数: 579 | 36 【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: SQL run a stored procedure by fetching from a cursor row by row
发信站: BBS 未名空间站 (Fri May 23 17:57:23 2014, 美东)
I need to run a stored procedure on SQL server 2008.
But, I can only fetch one row from the cursor. After that, the @@FETCH_
STATUS is -1.
DECLARE @my_table TABLE
(
code int not null
);
INSERT INTO @my_table (id)
SELECT DISTINCT a.id
FROM table1 as a
WHERE a.value = 'abc'
ORDER BY a.id A... 阅读全帖 |
|
l****z 发帖数: 29846 | 37 Report: Menendez Pal Melgen Billed Medicare Millions for Unnecessary Medical
Procedures
by Jammie
Well, at least we know where he got those hundreds of thousands of dollars
he pumped into Democrat coffers. Nice scam these guys have going, huh?
A South Florida eye surgeon who’s a friend of a U.S. senator is under
federal criminal investigation for billing Medicare millions of dollars to
treat elderly patients for services they may not have needed, The Herald has
learned.
Federal agents be... 阅读全帖 |
|
a***4 发帖数: 1112 | 38 IF THIS PROCEDURE IS EXPERIEMENTAL, THE HOSPITAL SHOULD GET PREAUTHORIZATION
BEFORE DO IT. DID HOSPITAL GET PRE AUTHO?
GET YOUR POLICY!
CALL INSURANCE, CALL HOSPITAL. EVERY CALL , ASK REFERENCE NUMBER AND THE
REP. NAME, DOCUMENT EVERY THING. MAIL EVERYTHING BY CERTIFIEND MAIL.
LAST RESORT, COMPLAIN TO THE STATE INSURANCE DEPT OR SMALL CLAIM COURT. |
|
s*******u 发帖数: 2249 | 39 Sessions' confirmation vote set for Wednesday
Posted: Feb 06, 2017 7:49 PM CST
Updated: Feb 06, 2017 9:17 PM CST
By Bob Grip, FOX10 News AnchorCONNECT
The U.S. Senate is expected to vote Wednesday on the nomination of U.S. Sen.
Jeff Sessions of Alabama to be the next U.S. attorney general.
Here is the timetable:
Following Tuesday afternoon's vote on the nomination of Betsy DeVos as
education secretary, there will be a cloture vote on the Sessions nomination
. Cloture is a procedure for ending a ... 阅读全帖 |
|
|
z*********8 发帖数: 2070 | 41 【 以下文字转载自 Programming 讨论区 】
发信人: zhaichun108 (onlylonely), 信区: Programming
标 题: 学习sql和stored procedure, 有什么书推荐吗?
发信站: BBS 未名空间站 (Tue Nov 24 11:35:30 2009, 美东)
3x |
|
t**u 发帖数: 1572 | 42 我agent说先做一般房屋检查,检查的人会说有无白蚁 evidence。
如有pest evidence,再找人检查白蚁。这procedure正确吗?
还是inspection和白蚁检查同时进行?多谢指教
在boston,白蚁比较多的区 |
|
m*****n 发帖数: 760 | 43 【 以下文字转载自 MedicalCareer 讨论区 】
发信人: misssun (大笨熊), 信区: MedicalCareer
标 题: 请教各位高手一个问题:关于hysteroscopy的procedure
发信站: BBS 未名空间站 (Fri Oct 22 16:02:23 2010, 美东)
半年前超声看出有一个类似子宫内膜息肉的东东,后来换了医院就查不出来了。现在的
妇科医生想用宫腔镜确诊一下,问题是他要我在月经来时吃避孕药直到结束,由于我最
近一直在试孕,不想吃什么避孕药,所以想问一下这是不是检查中必须的步骤? 有没有
取代方法?很急, 谢谢! |
|
t*******n 发帖数: 4445 | 44 They need to be sure you are not pregnant at the time of the procedure. So
the simplest alternative is not to have sex during that month.
If I were you, I wouldn't try to conceive before this is figured out...
没有 |
|
w***7 发帖数: 1637 | 45 生小孩住院,有三个procedure,其中两个是transcranial doppler ultrasonography,
总共1000 多,保险说是experimental, 不愿付钱,怎么破? |
|
b*******r 发帖数: 432 | 46 ⑿湃 wenlin (Wilson), 信区: Oversea
标 题: My wife Got visa (Procedure and Question asked)
发信站: The unknown SPACE (Sat Apr 10 10:36:38 1999) WWW-POST
This is her first try. As she said, there were many people to
apply visa today.
She was interviewed by a white male officer.He smiled in the whole
interview process. Because our 8b-7all is about -$650, the money is
not a main problem. The officer just took a look our marriage
certificate.(We married in last Sept., I come to USA a few days later)
Then he |
|
a*********4 发帖数: 31 | 47 I submitted my EB1A 4 months ago. My H1 visa will expire this August. I
found many people said they wait more than 8 months. It is scary. Is there
anyone here who is very kind to tell me the regular procedure to push the
office to review the case? I tried to find related information here, but it
seems very difficult. What is the "three steps stragety"? thank you so much
for your time and help.Still wonder if it is worth to spend so much time in
Green card! |
|
B*****o 发帖数: 661 | 48 有时间的可以读一读。
http://www.visatopia.com/wp-content/uploads/2013/01/USCIS-I-485
• Mailroom
The process by which the service center receives I-485 applications, reviews
them for acceptability and assembles them for data entry.
• U.S. CIS Review
The process by which U.S. CIS verifies all reasons for rejection cited by
the contractor.
• Central Index System/G-325A Processing
The process by which CIS is searched, multiple A-numbers or A-number with
violations are resolved, and G-325As a... 阅读全帖 |
|
b*******3 发帖数: 196 | 49 I am stuck in the file room awaiting Security Check clearance, according to
my congressman. USCIS keep repeating the message that there is no definite
time frame when the security check can be completed,but ironically they put
up this 15 month expiration time period on the validity of FBI response, as
in this standard operating procedure says, if FBI processing date exceeds 15
months,then " reschedule". Wouldn't guys like me possibly running into dead
lock since FBI may never be able to finish t... 阅读全帖 |
|
|