Can't create a function in SQL windows of PL/SQL Developer.

The function is :
create or replace function Xgyh
(pvc2Czy in varchar2,
pnumYhid in number,
pvc2Lfid in varchar2,
pvc2Grzid in varchar2,
pvc2Zbmid in varchar2,
pvc2Bmid in varchar2)
return number is
intZxbz integer:=1;--返回值(1:正确,0:错误);
numDxlb number;
numGx number;
begin
--判断指定用户是否合法
if pvc2Czy is null then
intZxbz:=0;
end if;
if pnumYhid is not null then
if pvc2Lfid+pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Lfid is not null then
if pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Grzid is not null then
if pvc2Zbmid+pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Zbmid is not null then
if pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Bmid is null then
intZxbz:=0;
end if;
--取当前登陆操作员在数据权限表中权限并判断是否允许更新当前用户
if intZxbz=1 then
select t.更新,
decode(t.对象类别,'用户',0,'楼房',1,'供热站',2,'子部门',3,'部门',4,'集团',5)
into numGx,numDxlb
from 系统_数据权限_表 t
where t.用户=pvc2Czy
and (t.对象类别,t.对象识别码) in
(('集团',0),('部门',pvc2Bmid),('子部门',pvc2Zbmid),('供热站',pvc2Grzid),('楼房',pvc2Lfid),('用户',pnumYhid))
and rownum=1
order by 2,1;
end if;
--返回信息
return(numGx);
end Xgyh;
If get rid of the where condition
'and (t.对象类别,t.对象识别码) in
(('集团',0),('部门',pvc2Bmid),('子部门',pvc2Zbmid),('供热站',pvc2Grzid),('楼房',pvc2Lfid),('用户',pnumYhid))',
this function can be created fast.
Thanks for you help!

This is duplicated question.
Can't create a function in database
William Robertson and I have described some advices for you.
Is my English poor?
If you couldn't get theirs (mikerault, William Robertson et al.) and my advices,
You can ask that on ITPUB (this is Chinese site).
Here it is. http://www.itpub.net/
And this site is not only for Oracle.
I think they can help you in Chinese words.
PS.
I learn that
'Gongrezhan' means the center of supplying heating to building,
and this center is the characteristic systems in Beijing or more cold district.
PS.2
Your script includes simplified Chinese character-set.
Even if you were not Chinese person,
we all think you can understand Chinese words.

Similar Messages

  • Can i create 23 functions in one proc

    Hi,
    Can I create 23 functions in one proc. In that functions data is manipulating at a time 6000 to 50000 records.
    Eg: 6000 time taking 2 minutes
    Will get any performance issue when I manipulate 20000- 50000 records at a time.
    There's no performance issue.
    Pls suggest me,
    -Thanks,

    Well from Pl/sql perspective you can declare any number of functions within a procedure.
    But Ennisb is right: you should be more cleare in what you try to achieve.
    AQ is really, really fast. So if these 5000, 6000 records are enqueued on a queueu you can create a job that dequeues and processes these a message at a time until the queue is empty. This job you could schedule several times using dbms_job in parallel. Then you'll find that the processing is really fast.
    Regards,
    Martien

  • How can I create a text pop up window in my Pages document? I want text to pop up when the reader hovers his/her cursor over a certain word.

    How can I create a text pop up window in my Pages document? I want text to pop up when the reader hovers his/her cursor over a certain word in the document. I am teacher. So for example when a student came to word he/she did not know, if he/she hovered the cursor over the word, a defintion or other information would appear.  You can do this in Word using bookmarks/hyperlinks but I can't figure this out in Pages. I can link it to another point in my Pages document but I just need the text to pop up - not take the reader to another location.  THANK YOU!!!!!!

    Have you tried Word for Mac?
    You will need to test if links survive export or printing to .pdf
    Peter

  • How can I create more than one main window in a page of SAP SCRIPT?

    How can I create more than one main window in a page of SAP SCRIPT? If anybody helps me I will be obliged.
    Regards,
    Subhasish

    Hi Ganguly,
    It is possible to have more than one main window in a same page.
    You create a main window and simply you copy and past it in the same page.. it will create first main window name as MAIN and other main windows as MAIN01,MAIN02.... up to MAIN99.
    Contets flow from MAIN , MAIN01, MAIN02.......................MAIN99. contents after filling the current window it flows to next window(by default, you skip as well with some keyword not sure could be NEW-WINDOW)
    you want print the main window data twice? or you want to create two main window in the same page ?
    1. give two copies in the no of copies in the output type screen ( Which pop up is coming after excute the program ).
    2. create two page with the same script form.
    3. you can write the coding inside the program to print twice the same page.
    Hope this information use full to you..

  • Certain Numbers templets allow you to drag and drop contacts to populate cell data, how can I create that functionality in my own tables?

    Certain Numbers templets allow you to drag and drop contacts to populate cell data, how can I create that functionality in my own tables?

    If you haven't come across the workarounds thread you may find helpful tips there on this and other ways to work with Numbers 3.
    ronniefromcalifornia discovered how to bring contacts into Numbers 3. As described in this post:
    "Open Contacts
    Select all the cards you want
    Copy
    In Numbers, in a table, select cell A1
    Paste
    Boom. Works great. Even brought in the pictures. Cool."
    So instead of drag and drop, just select in Contacts, copy, and paste into Numbers
    SG

  • In smart form, can i create more than one main window,

    In smart form, can i create more than one main window,
    if no, then why?

    Hi,
    As for main window a page can have only one.
    You may have number of Variable windows
    Main window can only be one. One it can be copied to next page.
    but secondary window as many as u want.
    Reward if it helps..
    Regards,
    Omkar.

  • HT4436 can i create an icloud acct on windows

    can i create an icloud acct. from windows using my apple id?

    Welcome to the Apple Support Communities
    You can only create an iCloud account on a iPhone, iPad, iPod touch or Mac, not on a PC. See > http://www.apple.com/icloud/setup

  • Can i create aggrecate functions

    hi,
    can we create aggrecate functions like max().
    pl. give me the steps to do it.
    thanks in advance.
    regards,
    kathir

    When u mean create, u mean re-write the
    whole function ? please elaborate

  • How can I create a short-key of an iconic button in Developer-6i

    Sir,
    How can I create a short-key of an iconic button in Developer-6i. Which works when I press the short-key the code execute which attach with button directly not just move the selection to this button and then need enter or click to execute the button.
    I am using oracle-9i and Developer-6i
    Thanks & Regards

    Hello,
    In the BUTTON PROPERTY set the property Access Key to any of your keyboard letter let say S.
    Then for that button you can use Alt+S. It will fire the trigger WHEN-BUTTON-PRESSED or it will work same as you are pressing button by enter or mouse.
    -Ammad

  • Can't create data analysis views in windows 7/project server 2007

    In Project Server 2007, when trying to create a new Data Analysis view or edit an existing one, we get the following error: "An error was encountered in loading the page". Using the F12 developer tools, I tracked it down to the following line:
    "cn = new ActiveXObject("ADODB.Connection"), and in javascript the more specific error is "Automation server can't create object".
    I assumed it was a browser permissions issue, and so I ensured the site is in trusted sites, and set the security level to low, but the same error is still occurring.
    This error only occurs for users who are on Windows 7. This page works fine for users on Vista. The Windows 7 box has IE 9, the Vista box has IE 7.
    Is Project Server 2007 supported in Windows 7/IE 9? Is there another security setting to look for?
    edit: I have also checked the registry on the client and confirmed that adodb.connection is registered, and the dll exists.
    Thanks,
    Mike G.

    Hi Mike,
    If you refer to
    this link, IE9 is supported by PS2007. Anyway, in the F12 developer tool, try to set the default browser to IE8. Also add the PWA url to the compatibility site settings in IE.
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • How can I create a function of sound volue from time using AudioQueueBufferRef??

    I have a question how can I analyze class AudioQueueBufferRef, for creating a function of sound volue from time?? Here is what I get . there is AudioQueueBufferRef fillBuf = audioQueueBuffer[fillBufferIndex]; volume height is 2000 elements from SInt16* coreAudioBuffer = (SInt16*)fillBuf->mAudioData. so function looks like H(t*i)=coreAudioBuffer[i] where t = 1/sampleRate = 1/22050 but here is a problem. my program gets sound and uses a class AudioStreamer for this. AudioStreamer has 3000 lines when I play music from Free Internet Radio - SHOUTcast Radio - Thousands of Free Online Radio Stations. internet radio - my problem is as follows either I dont know where 85 % of sound information is or I dont know how I can analyze class AudioQueueBufferRef
    Here is the code where I analyze Buffer.
    {@synchronized(self)
    if ([self isFinishing] || stream == 0)
    return;
    inuse[fillBufferIndex] = true; // set in use flag
    buffersUsed++;
    // enqueue buffer
    AudioQueueBufferRef fillBuf = audioQueueBuffer[fillBufferIndex];
    fillBuf->mAudioDataByteSize = bytesFilled;
    // ======>in this place I analyze Buffer
    if (packetsFilled)
    err = AudioQueueEnqueueBuffer(audioQueue, fillBuf, packetsFilled, packetDescs);
    else
    err = AudioQueueEnqueueBuffer(audioQueue, fillBuf, 0, NULL);
    when bitRate = 24 buffer has the following options int size=(fillBuf->mAudioDataByteSize) == 2000 double sampleRate=asbd.mSampleRate == 22050 numberOfChannels = asbd.mChannelsPerFrame == 1 it turns out that duration of play buffer float bufferTime =(size/numberOfChannels)/sampleRate == 0.1 number of buffers per second float numBuffersInOneSeconds == 1,5 duration of play all buffers per one second numBuffersInOneSeconds * time == 0.15 so it is 15 % of all information
    as a result If buffer comes at 0.0 seconds he lasts up to 0.1 seconds.farther in my function there is no volume. second buffer comes in 0.7 seconds and lasts up to 0.8 seconds. but in reality the sound doesnt breaks. Maybe I'm doing something wrong .please tell me.
    just for comparison
    when bitRate = 32 buffer has the following options int size=(fillBuf->mAudioDataByteSize) == 2000 double sampleRate=asbd.mSampleRate == 22050 numberOfChannels = asbd.mChannelsPerFrame == 1 it turns out that duration of play buffer float bufferTime =(size/numberOfChannels)/sampleRate == 0.1 number of buffers per second float numBuffersInOneSeconds == 2 duration of play all buffers per one second numBuffersInOneSeconds * time == 0.2 so it is 20 % of all information
    when bitRate = 32 buffer has the following options int size=(fillBuf->mAudioDataByteSize) == 1660 double sampleRate=asbd.mSampleRate == 44100 numberOfChannels = asbd.mChannelsPerFrame == 2 it turns out that duration of play buffer float bufferTime =(size/numberOfChannels)/sampleRate == 0.02 number of buffers per second float numBuffersInOneSeconds == 10 duration of play all buffers per one second numBuffersInOneSeconds * time == 0.2 so it is 20 % of all information

    You cannot write custom commands for expressions.
    That being said, there are a couple of options:
    Create a subsequence with a single step. Use a parameter of the sequence as "function parameter".
    Create a custom step type including a substep module which implements the function. Add an edit substep to enable the user of the steptype to gracefully change the parameter.
    Store the variable parameter in a local/file global variable and modify the value in each step. This will, at least, keep the "function" the same for every step.
    Norbert

  • Can't create a function into database

    The function is :
    create or replace function Xgyh
    (pvc2Czy in varchar2,
    pnumYhid in number,
    pvc2Lfid in varchar2,
    pvc2Grzid in varchar2,
    pvc2Zbmid in varchar2,
    pvc2Bmid in varchar2)
    return number is
    intZxbz integer:=1;--返回值(1:正确,0:错误);
    numDxlb number;
    numGx number;
    begin
    --判断指定用户是否合法
    if pvc2Czy is null then
    intZxbz:=0;
    end if;
    if pnumYhid is not null then
    if pvc2Lfid+pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
    intZxbz:=0;
    end if;
    elsif pvc2Lfid is not null then
    if pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
    intZxbz:=0;
    end if;
    elsif pvc2Grzid is not null then
    if pvc2Zbmid+pvc2Bmid is null then
    intZxbz:=0;
    end if;
    elsif pvc2Zbmid is not null then
    if pvc2Bmid is null then
    intZxbz:=0;
    end if;
    elsif pvc2Bmid is null then
    intZxbz:=0;
    end if;
    --取当前登陆操作员在数据权限表中权限并判断是否允许更新当前用户
    if intZxbz=1 then
    select t.更新,
    decode(t.对象类别,'用户',0,'楼房',1,'供热站',2,'子部门',3,'部门',4,'集团',5)
    into numGx,numDxlb
    from 系统_数据权限_表 t
    where t.用户=pvc2Czy
    and (t.对象类别,t.对象识别码) in
    (('集团',0),('部门',pvc2Bmid),('子部门',pvc2Zbmid),('供热站',pvc2Grzid),('楼房',pvc2Lfid),('用户',pnumYhid))
    and rownum=1
    order by 2,1;
    end if;
    --返回信息
    return(numGx);
    end Xgyh;
    If get rid of the where condition
    'and (t.对象类别,t.对象识别码) in
    (('集团',0),('部门',pvc2Bmid),('子部门',pvc2Zbmid),('供热站',pvc2Grzid),('楼房',pvc2Lfid),('用户',pnumYhid))',
    this function can be created immediately.
    Thanks for you help!

    I read ITPUB, and understand detailed situation a little.
    The problem is not that any error occur on compiling,
    but that compiling slows down with some conditional clause(*1).
    It takes half a day or more(*2) to compile.
    I think that must hung up.
    Really? Is it really happen?
    If that is true, You had better contact Oracle Support.
    (*1)
    The additional condition is like as follows.
    and (t.MB_named_column1,t.MB_named_column2) in
    (('MB_data1',0),('MB_data2',pvc2Bmid),('MB_data3',pvc2Zbmid),('MB_data4',pvc2Grzid),('MB_data5',pvc2Lfid),('MB_data6',pnumYhid))
    Here, MB means MultiBytes.
    (*2)
    'half a day or more' is my literal translation.
    It may mean only 'very long time'.
    Message was edited by:
    ushitaki
    Added the more detailed explanation.

  • Can't create a function in database

    The function is :
    create or replace function Xgyh
    (pvc2Czy in varchar2,
    pnumYhid in number,
    pvc2Lfid in varchar2,
    pvc2Grzid in varchar2,
    pvc2Zbmid in varchar2,
    pvc2Bmid in varchar2)
    return number is
    intZxbz integer:=1;--返回值(1:正确,0:错误);
    numDxlb number;
    numGx number;
    begin
    --判断指定用户是否合法
    if pvc2Czy is null then
    intZxbz:=0;
    end if;
    if pnumYhid is not null then
    if pvc2Lfid+pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
    intZxbz:=0;
    end if;
    elsif pvc2Lfid is not null then
    if pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
    intZxbz:=0;
    end if;
    elsif pvc2Grzid is not null then
    if pvc2Zbmid+pvc2Bmid is null then
    intZxbz:=0;
    end if;
    elsif pvc2Zbmid is not null then
    if pvc2Bmid is null then
    intZxbz:=0;
    end if;
    elsif pvc2Bmid is null then
    intZxbz:=0;
    end if;
    --取当前登陆操作员在数据权限表中权限并判断是否允许更新当前用户
    if intZxbz=1 then
    select t.更新,
    decode(t.对象类别,'用户',0,'楼房',1,'供热站',2,'子部门',3,'部门',4,'集团',5)
    into numGx,numDxlb
    from 系统_数据权限_表 t
    where t.用户=pvc2Czy
    and (t.对象类别,t.对象识别码) in
    (('集团',0),('部门',pvc2Bmid),('子部门',pvc2Zbmid),('供热站',pvc2Grzid),('楼房',pvc2Lfid),('用户',pnumYhid))
    and rownum=1
    order by 2,1;
    end if;
    --返回信息
    return(numGx);
    end Xgyh;
    If get rid of the where condition
    'and (t.对象类别,t.对象识别码) in
    (('集团',0),('部门',pvc2Bmid),('子部门',pvc2Zbmid),('供热站',pvc2Grzid),('楼房',pvc2Lfid),('用户',pnumYhid))',
    this function can be created immediately.
    Thanks for you help!

    I try translating from Chinese to English words including column name and data.
    But, I can't understand the Chinese word Gongrezhan, so this is Pinyin.
    And, I have not analyzed your function, yet.
    Because, I just now must go to Chinese conversation class.
    By the way, it should be that tables and columns named by multibytes is enclosed by double quotation.
    For example,
    select t.更新, -> select t."更新"
    from 系统_数据权限_表 t -> from "系统_数据权限_表" t
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements008.htm#i27561
    create or replace function Xgyh
    (pvc2Czy in varchar2,
      pnumYhid in number,
      pvc2Lfid in varchar2,
      pvc2Grzid in varchar2,
      pvc2Zbmid in varchar2,
      pvc2Bmid in varchar2)
      return number is
      intZxbz integer:=1;-- return value (1:Success, 0:Error)
      numDxlb number;
      numGx number;
    begin
      -- Check whether the assigned user is correct or not
      if pvc2Czy is null then
        intZxbz:=0;
      end if;
      if pnumYhid is not null then
        if pvc2Lfid+pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
          intZxbz:=0;
        end if;
      elsif pvc2Lfid is not null then
        if pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
          intZxbz:=0;
        end if;
      elsif pvc2Grzid is not null then
        if pvc2Zbmid+pvc2Bmid is null then
          intZxbz:=0;
        end if;
      elsif pvc2Zbmid is not null then
        if pvc2Bmid is null then
          intZxbz:=0;
        end if;
      elsif pvc2Bmid is null then
        intZxbz:=0;
      end if;
      --Check whether current database entry operator  has priviledge of updating current user. 
      if intZxbz=1 then
        select t."Update",
          decode(t."TargetClass",'User',0,'Bilding',1,'Gongrezhan',2,'Department',3,'Division',4,'Group',5)
          into numGx,numDxlb
          from "System_DatabasePriviledge_Table" t
        where t."User"=pvc2Czy
          and (t."TargetClass",t."TargetID") in
          (('Group',0),('Division',pvc2Bmid),('Department',pvc2Zbmid),('Gongrezhan',pvc2Grzid),('Bilding',pvc2Lfid),('User',pnumYhid))
          and rownum=1
        order by 2,1;
    end if;
      --Return Informations
      return(numGx);
    end Xgyh;

  • How can I create a function using TestStand variables and call it from a step's Pre-Expression?

    In one sequence I have dozens of Pre-Expressions which are almost the same thing, like this...
    Locals.tagID = (Parameters.singlePhaseEnabled ? "L" : "D") & Str(Locals.phase) & "006"
    ...and the only thing different is that three digit string at the end ("006" will vary). How can I write a function that I can call from a step's Pre-Expression so it would look something like this? ...
    Locals.tagID = MyNewFunction("006")

    You cannot write custom commands for expressions.
    That being said, there are a couple of options:
    Create a subsequence with a single step. Use a parameter of the sequence as "function parameter".
    Create a custom step type including a substep module which implements the function. Add an edit substep to enable the user of the steptype to gracefully change the parameter.
    Store the variable parameter in a local/file global variable and modify the value in each step. This will, at least, keep the "function" the same for every step.
    Norbert

  • Can i create a function which can take infinite parameter.

    Can i make a function which get infinite parameter.
    like avg.

    Kamran Riaz wrote:
    Can i make a function which get infinite parameter.
    like avg.I think you'll have trouble finding anything to take infinite parameters cos that would be bigger than the universe itself.
    User defined aggregate functions example...
    http://asktom.oracle.com/pls/asktom/f?p=100:11:335287534824285::::P11_QUESTION_ID:229614022562
    [email protected]> create or replace type StringAggType as object
      2  (
      3     theString varchar2(4000),
      4 
      5     static function
      6          ODCIAggregateInitialize(sctx IN OUT StringAggType )
      7          return number,
      8 
      9     member function
    10          ODCIAggregateIterate(self IN OUT StringAggType ,
    11                               value IN varchar2 )
    12          return number,
    13 
    14     member function
    15          ODCIAggregateTerminate(self IN StringAggType,
    16                                 returnValue OUT  varchar2,
    17                                 flags IN number)
    18          return number,
    19 
    20     member function
    21          ODCIAggregateMerge(self IN OUT StringAggType,
    22                             ctx2 IN StringAggType)
    23          return number
    24  );
    25  /
    Type created.
    [email protected]>
    [email protected]> create or replace type body StringAggType
      2  is
      3 
      4  static function ODCIAggregateInitialize(sctx IN OUT StringAggType)
      5  return number
      6  is
      7  begin
      8      sctx := StringAggType( null );
      9      return ODCIConst.Success;
    10  end;
    11 
    12  member function ODCIAggregateIterate(self IN OUT StringAggType,
    13                                       value IN varchar2 )
    14  return number
    15  is
    16  begin
    17      self.theString := self.theString || ',' || value;
    18      return ODCIConst.Success;
    19  end;
    20 
    21  member function ODCIAggregateTerminate(self IN StringAggType,
    22                                         returnValue OUT varchar2,
    23                                         flags IN number)
    24  return number
    25  is
    26  begin
    27      returnValue := rtrim( ltrim( self.theString, ',' ), ',' );
    28      return ODCIConst.Success;
    29  end;
    30 
    31  member function ODCIAggregateMerge(self IN OUT StringAggType,
    32                                     ctx2 IN StringAggType)
    33  return number
    34  is
    35  begin
    36      self.theString := self.theString || ',' || ctx2.theString;
    37      return ODCIConst.Success;
    38  end;
    39 
    40 
    41  end;
    42  /
    Type body created.
    [email protected]>
    [email protected]> CREATE or replace
      2  FUNCTION stringAgg(input varchar2 )
      3  RETURN varchar2
      4  PARALLEL_ENABLE AGGREGATE USING StringAggType;
      5  /
    Function created.
    [email protected]>
    [email protected]> column enames format a30
    [email protected]> select deptno, stringAgg(ename) enames
      2    from emp
      3   group by deptno
      4  /
        DEPTNO ENAMES
            10 CLARK,KING,MILLER
            20 SMITH,FORD,ADAMS,SCOTT,JONES
            30 ALLEN,BLAKE,MARTIN,TURNER,JAME
               S,WARD
    [email protected]>

Maybe you are looking for

  • IPod Touch/Phone 4gens No Longer Detected in WINDOWS MY COMPUTER but OK in iTunes

    Since I have not found help online regarding the above situation I'm looking for help accordingly.   For most folks it's iTunes not detecting i-Devices, but my situation is unique. It started last night after I was on the phone for hours with Norton

  • No segment found in Metadata table

    Hi, We are posting an Idoc from an external application to R/3 using C RFC libraries. There was a new custom segment Z1xxx added to an Extension message type Zxxxx on SAP. There is an error in the external application while trying to build/Map the Id

  • Unable to Open File In Application Server

    Hi All, I have generated csv file in application Server with the help of Open HUb Destination.In Open Hub 2 files will we generated(1 is structure of the file(s_ztest),2 is data file(ztest)).When i click on the structure of the file then it is openin

  • IPhoto '11 Smart Album Not Updating

    When importing photos from my iPhone into iPhoto '11, any events that contain pictures of my son are titled with his first name. I have a smart album set up to include any events that include my son's name. Suddenly, events I import and title accordi

  • How can I install and use a mouse on an iPad.

    How can I install and use a mouse on an iPad?