Simple matter of PL/SQL

Hello
I appologise if this is the wrong place to post this question. I'm relatively new to PL/SQL and I develop in apex. I am trying to create a region that shows the result of a query based on the value of a text field. PL/SQL is intended to be run in the following way

If the field is null
do this charly
on the other
make this request

The PL/SQL, I've developed so far is the following;

BEGIN
IF: RESEARCH IS NULL THEN

Select 'ae_material '. "" ae_material_id_pk "as"ae_material_id_pk. "
'ae_material '. "" ae_material_name "as"ae_material_name. "
'ae_material '. "' ae_material_desc ' as 'ae_material_desc '.
of 'ae_material' 'ae_material ';

ON THE OTHER

Select 'ae_material '. "" ae_material_id_pk "as"ae_material_id_pk. "
'ae_material '. "" ae_material_name "as"ae_material_name. "
'ae_material '. "' ae_material_desc ' as 'ae_material_desc '.
of 'ae_material' 'ae_material '.
where 'ae_material '. ' ae_material_id_pk ' =: SEARCH;

END IF;
END;

Above is the PL/SQL course, I created it appears syntactically correct but oracle throws and error saying a statement is normally, but I don't think I need a instruction to accomplish my task. Help solve this error would be great.
Thanks in advance

You may want to take a book of pl/sql... This is somewhat similar to t - sql, which is quite different.

However, you don't need a pl/sql. Just create a report of the region and connect:
Select 'ae_material '. "" ae_material_id_pk "as"ae_material_id_pk. "
'ae_material '. "" ae_material_name "as"ae_material_name. "
'ae_material '. "' ae_material_desc ' as 'ae_material_desc '.
of 'ae_material' 'ae_material '.
where 'ae_material '. ' ae_material_id_pk ' =: SEARCH or: RESEARCH is null.

HTH John

Tags: Database

Similar Questions

  • simple conversion of pl/sql for sql

    Hello all;

    I have the simple pl/sql next I want to convert it to sql. see code below
    create or replace package test1 is
    
    type r_cursor is ref cursor;
    function report(company_name in varchar2) return r_cursor;
    end test1;
    create or replace package body test1 is
    
    
    
    function report(company_name in varchar2) return r_cursor as
     
    my_r_cursor r_cursor;
    
    begin
    if(company_name = 'ALL COMPANIES') THEN
    
    open my_r_cursor for 
    
    select t.t_id, t.t_description from t1 t;
    return my_r_cursor;
    
    elsif(company_name != 'ALL COMPANIES') THEN
    open my_r_cursor for 
    select t.t_id, t.t_description from t1 t 
    where t.t_id = company_name;
    return my_r_cursor;
    end if;
       
    end;
    
    
    end test1;
    create table t1 
    (
     t_id varchar2(200) not null,
     t_description varchar2(250),
     primary key(t_id)
    
    
    );
    insert into t1
      (t_id, t_description)
    values
      ('CITI', 'PROFIT: 2.2Billion');
    
    insert into t1
      (t_id, t_description)
    values
      ('GE', 'PROFIT: 1Billion');
    
    
    insert into t1
      (t_id, t_description)
    values
      ('JPMORGAN','PROFIT: 0');
    It is for learning purposes. Any help will be appreciated. Thank you.

    Furthermore you must always do in your plsql function. You cannot run this application only.

    create or replace package test1 is
    
      type r_cursor is ref cursor;
      function report(company_name in varchar2) return r_cursor;
    end test1;
    /
    
    create or replace package body test1 is
    
      function report(company_name in varchar2) return r_cursor as
        my_r_cursor r_cursor;
      begin
    
        open my_r_cursor for
        select t.t_id, t.t_description from t1 t
        where t.t_id = case company_name
                                when 'ALL COMPANIES' then t.t_id
                                else company_name
                              end;
    
        return my_r_cursor;
    
      end;
    end test1;
    

    and in your last post you should not use an '&' before company_name.

  • Simple matter of OLAP DML

    I take an initial stab at the use of OLAP DML on the OLAP worksheet and I try first to apply a simple order limit on a dimension, but I can't make it work. I have several OLAP DML guides, so I lack of reading material, but they will not help with this.

    I have a dimension called DIM_TEAM. It has 3 levels in its hierarchy which (highest to lowest) are: ALL_TEAMS, LEAGUE and TEAMS.

    I want to limit the value of DIM_TEAM to "BOS". "BOS" is a value on the level down the hierarchy that caters to TEAMS

    When I enter the command: LIMIT DIM_TEAM to "BOS"

    I get the error: is not a valid AW_BALL2 BOS! DIM_TEAM

    Why does this work? Y at - it a preliminary order, I have to question before executing this command LIMIT? Thank you

    'HR' is the logical name of the measure; you will need to reference its physical name when using the REPORT command.

    The physical name of the variable data storage will vary depending on the version of database (10 g or 11 g?) and if your cube uses compressed composite or not.

    For reporting purposes, you could report on the cube 'formula' that will '_', where is the logical name of your cube, and will be 'HR '.

    EDIT:
    For point 2), you should not use OLAP worksheet limit orders and the viewer data in combination as limits get "confused." the data viewer should allow you to filter your PivotTable to display dimension selection results no matter what you want to report on. That are in the "Requester" topic in the data viewer.

    With respect to obtaining "Viewer and OLAP DML to be on the same page" so to speak, you will need to 'translate' between the logic of the viewer dimension value name and the name of the surrogate dimension value when you use the OLAP worksheet.

    EDIT2:
    Fix for the incorrect user account.

  • Equivalent of Oracle DB record Simple of Transaction in SQL Server mode?

    G ' Day Experts!

    I was wondering not if Oracle DB has the functional equivalent of the 'simple' operation logging available in SQL Server?

    It would be available at the level of the schema, or it should be the entirety of an instance?

    I ask because the WebCenter Interaction portal and related services has no practical use for point-in-time restores. The Portal uses the discrete event borders which unfortunately do not map in the relational world.

    Thank you!
    Rob in Vermont

    Plumtree says:
    G ' Day Experts!

    I was wondering not if Oracle DB has the functional equivalent of the 'simple' operation logging available in SQL Server?

    It would be available at the level of the schema, or it should be the entirety of an instance?

    I ask because the WebCenter Interaction portal and related services has no practical use for point-in-time restores. The Portal uses the discrete event borders which unfortunately do not map in the relational world.

    Thank you!
    Rob in Vermont

    Hi Rob

    I guess that you are referring to the model simple recovery , IE lose everything since the last backup. Oracle, which is equivalent to running a database in NOARCHIVELOG mode. It applies to the database rather than the instance, even if you were intending probably to database when you said instance.

    Niall Litchfield
    http://www.orawin.info/

  • Simple matter of Last.FM Scrobbler

    so I use the scrobble last.fm simple and for some reason when the fixing on the frame, I want to show who's the music player is not detected. usually it'll give some options and show what media players are detected and select them to scrobble out of. is this a problem with 1.4.9 or the application itself?

    Spike, my new cliq did all sorts of weird stuff. I did battery pulls and it makes everything better

    time.

  • Simple matter of Adobe Pro DC.

    Hi all

    I am new to Adobe Acrobat DC, and I'm sure it's something simple, but I have very little JavaScript 'know-how '.  I'm working on something for work and I'm looking to use a kind of conditional formula.  Here is a brief description of what I'm trying to do:

    I have a form and I want to summarize a series of text boxes in all, but only if the first text box is not empty.  (i.e.  Box 1 with the date, so now I want text text boxes 2-10 to summarize in box 11)

    I work mainly with Excel, and as I said I'm a little new to scripting so any help would be greatly appreciated.

    Also, if anyone has any suggestions for resources, I could use to learn more about JavaScript and its uses in Adobe Acrobat DC.

    Thank you all,

    You can use something like this than the calculation script of '11 text box: custom

    if (this.getField("Text Box 1").valueAsString=="") event.value = "";
    else {
        var total = 0;
        for (var i=2; i<=10; i++)
              total+=Number(this.getField("Text Box "+i).value);
        event.value = total;
    }
    
  • Simple programs in Pl/sql

    Hi, I need to practice for pl/sql programs. Can someone please provide all programs/questions?

    http://plsqlchallenge.com is just what you need for a challenge daily and much more

  • Simple matter of REGEXP_SUBSTR

    Hi all

    And I know that this should be simple

    How substr data delimited (double underline stroke) string up separator with regexp_substr:

    ' DocumentName:KC51351 - employee letter of consent (code 407) __DocumentOwner:Georgio Vuolde__DocumentExpireDate:1/1/2015 120000 AM'

    I am looking for what is between ' DocumentOwner:' and '_' (double underline stroke)

    "Georgio Vuolde" in this case.


    Please note there may not be simple traits of underscore in the given field.


    Thanks a lot for your help.

    LSY.



    Hello

    Here's one way:

    REGEXP_SUBSTR (str

    , ' DocumentOwner:(_?) ([^_]+_)*[^_]*)__'

    1

    1

    NULL

    1

    )

    To simplify regular expressions to understand, debug and maintain, you can add comments in line, like this:

    REGEXP_SUBSTR (str

    , ' DocumentOwner:' | -Literal

    ' (' || -Start definition of \1

    '_?'                  || -Target text can begin with an underscore (_)

    '([^_]+_)'            || -1 or several non - _s, followed of a _____

    '*'                 || -Above may occur 0 or more times

    '[^_]*'               || -0 or more non - _s

    ')'                     || -Definition of end of the \1

    '_' - Literal 2 _s

    1

    1

    NULL

    1

    )

  • Pretty simple Question of PHP/SQL

    I made a page where the user connects to something, but I want to keep having the same password as their user name. What is the best way to do it? Can I do it through dreamweaver or SQL? I guess an IF statement with the kill conditioon or something along those lines will work, I really don't want the values with the user name and password for repeated added to my database at all.

    Thanks for the help, sorry, it's Aussie a newbie question: P

    Geschenk wrote:
    > you can simply compare the field values submitted username & password using
    > an IF-ELSE statement, and if the password is username, tell him
    > something ;-) What s your server, PHP, ASP, CF model?

    It says PHP in the subject line, PHP is.

    If {($_POST)}
    {If ($_POST ['username'] == {$_POST ['password']})}
    $error = '

    You cannot use your username as password

    ';
    }
    else {}
    Insert here the code of behavior insert record server
    }
    }

    In the form itself:

    --
    Adobe Community Expert David Powers
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • simple matter of CFDIV

    Hi Gang-

    I'm dipping my toes in the pool "CF8 Ajax tool" and need a little help with CFDIV.

    I have a simple string of text I want to wrap in a HREF in order to show users an exploration to the low page in the CFDIV just below chain. For the life of me, I paint a complete blank on how to implement the href code! It is basically the exact same thing that the Adobe docs use CFDIV (pasted below) but I don't want to use a form, I want to use the href attribute instead. Any ideas?

    < cfform >
    < name cfinput = "tinput1" type = "text" >
    < / cfform >

    < h3 > using a div tag < / h3 >
    < cfdiv bind = "url:divsource.cfm? InputText = {tinput1}"ID ="theDiv ".
    style = "background-color: ##CCffFF;" color: Red; height: 350 "/ >"

    Thanks in advance,

    Rich

    .. Commissioner and you will find...
    It turns out that it was actually quite simple, although the docs are not really clear, I had to dig for this one...

    your link text

  • Simple question in PL/sql

    I am very new to PL/SQL. I am learning the language using book by Ivan Bayross.

    In one of the programs listed in this book, following is mentioned:

    inverted_number varchar (4);
    given_number varchar (3): = '12';

    inverted_number: = inverted_number | substr (given_number, 3, 1);


    Now, I did not understand the meaning of this line in italics.

    What is the meaning of. symbol of this line?

    can someone there explain please?

    Concerning
    -closeguy

    Edited by: closeguy2005 may 3, 2009 09:40

    Edited by: closeguy2005 may 3, 2009 09:41

    Hello

    || is a concatenation.

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/operators003.htm#sthref865

    You 2 values to a 'paste '.

    MHO%xe> declare
      2  str1 varchar2(3) := 'ABC';
      3  str2 varchar2(3) := 'DEF';
      4  begin
      5  dbms_output.put_line(str1||str2);
      6  end;
      7  /
    ABCDEF
    
    PL/SQL-procedure is geslaagd.
    
  • Simple matter of RMAN

    Hello

    Is it possible to run commands from command line sqlplus from the rman command line. I don't know that I've seen someone do it once. To save time jump between RMAN and sqlplus all the time

    Thank you very much

    Pat

    Hi Pat

    Please try this:

    SQL ' alter database open resetlogs;

    that is to say:

    run
    {
    allocate channel d1 type disk;
    until the SNA 8638758495.
    restore the database;
    recover the database;
    SQL ' alter database open resetlogs;

    output channel d1;
    }

  • myRio digital simple matter of e/s

    This is probably the simplest question, you can get, but I have a requirement to the output of the digital output on the FPGA-say D0 pin on the port B. I use a switch for that and it works fine when I have a while loop with timer it contains. When I take off the whole loop and have the switch and the digital output on its own it doesn't work anymore. Why is it a while loop on this subject? the attached picture is when it works. Does not work then the while loop is deleted.

    Hi tomnz,

    What do you mean by "it doesn't work anymore? The loop allows the program to run continuously (when running, it will take the output command you give via the Boolean control), but otherwise the code runs only once.

  • Simple matter of blackBerry Smartphones: sandisk to 8530

    I have a 2 GB sandisk currently. How many GB of a sandisk buy without needing additional expansion adapters, etc I see they're going up to 32 GB, but they need extra things.

    I want to just get out my 2 GB and insert it into another without any extra work.

    This is a 4 GB, 6, 8, etc.

    Thank you

    Hello lyh10021,

    Welcome to the forums.

    Take a look at this article in the knowledge base for media supported card sizes.

    KB05461

    Sizes of card MicroSD taken in charge by the BlackBerry device software

  • Simple matter of FxV - storable he timestamps in the repository of analysis?

    Hello

    is it possible for a transaction filter or filter hit to store the current timestamp of this approach in a transaction set in the repository of analysis?

    THX

    "mark".

    Hi Mark,

    The repository of analysis don't let you store configured data (custom fields) to a DATETIME value.

    But you could potentially fill a custom with a time stamp using a Groovy script field. This custom field can then be stored in the repository of analysis as a TEXT or a DOUBLE. When you retrieve this value out of the repository of analysis, you could then convert it into a timestamp.

    Kind regards

    Brian Wheeldon

Maybe you are looking for

  • jumble of text in the web interface after Web Services update / firmware

    I received a message on the screen of my Officejet 6700: Update recommended An update is available for Web Services (ePrint and Apps). Do you want? I chose to update now and it installed fine, or so I thought. I checked the web interface of the print

  • Motorcycle G 2014 will mean lollipop

    Sometimes, my motorcycle g 2014 is trolling when multitasking my doubt is it works well in the new update of pacifier?

  • block of scrolling with keyboard control panel

    Hello How can I scroll in the block with the keyboard Panel? When there is the need to go further, a block, or a diagram in the block Panel, it takes a long time to scroll with the mouse when an option is selected. Is it possible to use the keyboard

  • How can I reduce the size of the screens viewed on my computer.

    Sometimes, I get a screen which is higher then my computer screen so I can't see or click on the bottom of the screen action buttons, maximize on upper rt button is gray and doesn't fix it.  y at - it a general command to reduce the size of the scree

  • VPN Client problem

    A remote user on our network has problems with the Cisco VPN. They are using Win XP, Cisco Client 3.5.2 and connect via a router of Compaq Ipaq into a modem cable. When they VPN in our 3000 VPN concentrator works very well. When they try to VPN in th