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.

Similar Messages

  • 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;

  • 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.

  • 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

  • How many users/ schemas can we create in an oracle database?

    How many users can we create in an oracle database? Or how many users can oracle handle?
    Problem-
    I have to store information of ontologies (I will use countries instead) in db.
    I have to store information regarding countries.
    I have 13 tables in all to maintain for each country.
    Now there are two approaches:
    1) keep only 13 tables. Have an extra column in each table to indicate that a particular
    row stores information for which country.
    2) create a new user/ schema for each country. So we can get rid of the extra column
    needed in 1st approach.
    I have used the second approach. This is because number of entries in each table for a
    given country will be large.
    So initially when the s/w is installed I create a central-user. Each time data for new
    country has to be entered central-user creates a user/ schema, and creates tables for
    this user/ schema. The central user can access the tables of all the countries by
    country_name.table_name. By this approach I believe searching would be easy.
    If there is any flaw in my approach kindly mention it.
    Thank you

    There is no (practical at least) limit to the number of users & schemas you can have in Oracle.
    Your approach, however, is not going to scale nearly as well as the first option you outlined (adding a column). You are going to end up caching every possible variation of the various queries you're going to be executing because you will be referring to so many different tables, which is going to mean that you are doing a lot more work to parsing statements and generally churning through the shared pool. If you create enough users, you're liable to start hitting ORA-04030 errors because your shared pool is so fragmented.
    Additionally, you're likely going to end up with a whole lot of dynamically generated SQL to accommodate new schemas getting added over time which is going to cause you even more pain. Figuring out dynamically what table to join in is a heck of a lot more difficult for the programmer to write and for the database to handle than simply passing in a different country code.
    If you're concerned about having too much data, you can have your cake and eat it to by adding the country column and partitioning the tables based on country.
    Justin
    One other item I forgot to mention is maintainability. Having dozens or hundreds of "identical" schemas makes maintenance a huge pain because something like adding a new column now requires dozens or hundreds of separate DDL statements. You're almost guaranteed that some schema isn't going to be in sync-- it's going to miss a column or miss an index, etc.
    Message was edited by:
    Justin Cave

  • 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

  • Bug 11.1.1.1: Can't create smart-list into Sample App

    Hi,
    I can't create smart-list into Sample App in OEPMS 11.1.1.1.
    When I open Administration->Manage Smart Lists and see msg: No smart lists were created. Click Create to create a smart list. I'd like to do it, but File->New->Smart List have no effects.
    How can I create Smart List into Sample App? Any idea?

    Hi,
    Is it is not a bug because I can create smart lists, if you click create it should open a popup window, are you getting a popup window? if not maybe your security is blocking it.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • 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 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 i create a ms-access database (very urgent)

    hi folks
    i really need help in creating a ms-access database, i searched the forums but i couldnot find any answers.
    i really appreciate if anyone can tell how to create a ms-access database

    hi folks
    i really need help in creating a ms-access database, i
    searched the forums but i couldnot find any answers.
    i really appreciate if anyone can tell how to create a
    ms-access databaseIn java, the actual mdb file? You can't.
    The best you can do is create an empty mdb file and copy each time you need to create a new one.

  • Can I create a non-Unicode database manually via create database segment

    Hi
    As unicode encode use more bytes than 2-bytes encode (for instance, ZHS16GBK), and XE has the limit with 4GB totally. So, can I create a non-Unicode (for instance, ZHS16GBK) database manually via create database segment? or I just could use unicode?
    Thanks.
    Samuel

    Could you load or paste this scripts? Well, the script is (obviously) a shell script, useless on Windows, unless you have some emulator (CygWin, MKS toolkit or similar). The following is the Sql part :
    sqlplus /nolog <<END
    spool xe_createdb.log
    connect sys/oracle as sysdba
    startup nomount pfile=$filedir/init$ORACLE_SID.ora
    whenever sqlerror exit;
    create database
      maxinstances 1
      maxloghistory 2
      maxlogfiles 16
      maxlogmembers 2
      maxdatafiles 30
    datafile '$filedir/system.dbf'
      size 200M reuse autoextend on next 10M maxsize 600M
      extent management local
    sysaux datafile '$filedir/sysaux.dbf'
      size 10M reuse autoextend on next  10M
    default temporary tablespace temp tempfile '$filedir/temp.dbf'
      size 20M reuse autoextend on next  10M maxsize 500M
    undo tablespace undo datafile '$filedir/undots1.dbf'
      size 50M reuse autoextend on next  5M maxsize 500M
    --character set al32utf8
    character set $dbcharset
    national character set al16utf16
    set time_zone='00:00'
    controlfile reuse
    logfile '$filedir/log1.dbf' size 50m reuse
           , '$filedir/log2.dbf' size 50m reuse
           , '$filedir/log3.dbf' size 50m reuse
    user system identified by oracle
    user sys identified by oracle
    -- create the tablespace for users data
    create tablespace users
      datafile '$filedir/users.dbf'
      size 100M reuse autoextend on next 10M maxsize 5G
      extent management local
    -- install data dictionary views:
    @?/rdbms/admin/catalog.sql
    -- run catblock
    @?/rdbms/admin/catblock
    -- run catproc
    @?/rdbms/admin/catproc
    -- run catoctk
    @?/rdbms/admin/catoctk
    -- run pupbld
    connect system/oracle
    @?/sqlplus/admin/pupbld
    @?/sqlplus/admin/help/hlpbld.sql helpus.sql;
    -- run plustrace
    connect sys/oracle as sysdba
    @?/sqlplus/admin/plustrce
    -- Install context
    @?/ctx/admin/catctx oracle SYSAUX TEMP NOLOCK;
    connect CTXSYS/oracle
    @?/ctx/admin/defaults/dr0defin.sql "AMERICAN"
    -- Install XDB
    connect sys/oracle as sysdba
    @?/rdbms/admin/catqm.sql oracle SYSAUX TEMP;
    connect SYS/oracle as SYSDBA
    @?/rdbms/admin/catxdbj.sql;
    connect SYS/oracle as SYSDBA
    @?/rdbms/admin/catxdbdbca.sql 0 8080;
    connect SYS/oracle as SYSDBA
    begin dbms_xdb.setListenerLocalAccess( l_access => TRUE ); end;
    -- Install Spatial Locator
    connect sys/oracle as sysdba
    create user MDSYS identified by MDSYS account lock;
    @?/md/admin/catmdloc.sql
    create spfile='$filedir/spfile.ora' from pfile
    alter user anonymous account unlock
    disconnect
    -- recompile invalid objects
    connect sys/oracle as sysdba
    begin dbms_workload_repository.modify_snapshot_settings(interval => 0); end;
    begin dbms_scheduler.disable('AUTO_SPACE_ADVISOR_JOB', true); end;
    spool off
    exit
    ENDWords prefixed with $ are OS variables, you have to substitute them with your values.

  • 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]>

  • Can i create table in a database procedure?

    Hello
    Can i create a table in a database procedure?
    create or replace procedure create_table is
    tt number;
    begin
    create table temp (
    a number,
    b varchar2(100));
    end;
    it return an error....
    regards,
    deemy

    Hello
    Can i create a table in a database procedure?
    create or replace procedure create_table is
    tt number;
    egin
    create table temp (
    a number,
    b varchar2(100));
    end;
    it return an error....
    regards,
    deemy
    create or replace procedure create_table is
    tt number;
    begin
       execute immediate 'create table temp (a number,b varchar2(100))';
    end;
    /Cheers
    Sarma.

  • How Can I Create a Function to Return to a Specific Menu on DVD Studio Pro?

    Hello, I am currently building a DVD for a TV series I created while in college, and I'm having trouble figuring out how to create a function within the DVD that lets the user select the title or menu buttons on their remotes and have that return them either to a) the main menu or b) the menu they were just at, ie episode select or chapter select. Any help is appreciated! Thanks!

    Thanks for the help. I'm still a little confused on how to get it select which menu that I would like to return to.

Maybe you are looking for