Unable to [out] the value of the parameter put_line with single quotes (apostrophe)

Hello

I want to store a common code in a sql file and where the different clauses as a parameter, so the structure is:

Main.SQL Script:
set m_sWhere = ' owner = "SCOTT" ';
@MyReport.sql '& m_sWhere '.

MyReport.sql
OK: SELECT * FROM MyTable WHERE & 1
ERR: dbms_output.put_line ('MyWhere: & 1');

I am not able to print the where the clause. I already tried to set the where clause with other delimiters (e.g. #SCOTT #) and replace # by ' in the MyReport but failed as well.

All advice welcome.

Published by: netaktiv on 11.02.2012 08:35

Hello

netaktiv wrote:
Hello

I want to store a common code in a sql file and where the different clauses as a parameter, so the structure is:

Main.SQL Script:
set m_sWhere = ' owner = "SCOTT" ';
@MyReport.sql '& m_sWhere '.

Sorry; It is unclear what you are trying to do, and what you're doing.
I think the only single-quoptes in m_swhere are those before and after SCOTT:

DEFINE  m_sWhere = owner='SCOTT'

That's what you need to be able to use this variable in an SQL statement. SQL * more will replace & 1 with its value. If you were typing the statement directly, just type a single before and after SCOTT quote, if you want only a single quote before and after SCOTT in m_swhere. You use 2 single quotes in a row inside string literals, but the string literal only you need here is the literal 5 characters 'SCOTT', containing sound ", a 'C', 'o', two ' t and single quotes to zero."

MyReport.sql
OK: SELECT * FROM MyTable WHERE & 1
ERR: dbms_output.put_line ('MyWhere: &1');)

I am not able to print the where the clause. I already tried to set the where clause with other delimiters (e.g. #SCOTT #) and replace # by ' in the MyReport but failed as well.

You do not want channels OK: or ERR: in the script.
Dmbs_output.put_line, like any procedure, only works in PL/SQL.
If you want to display text in a SQL * more script, use the SQL * FASTER command, like this:

PROMPT  MyWhere: &1

If you really must use dbms_output.put_line, then you will need to use a string literal, and single quotes can be tricky.
In Oracle 10 (and more) use Q-rating:

BEGIN
    dbms_output.put_line ( Q'{MyWhere: &1}' );
END;
/

{Quotes will not be a problem unless they occur immediately after a right '}'.

Tags: Database

Similar Questions

  • How to fill out the "to:" line with a variable email address?

    I'm new to coding and am not sure how to ask my question. I have a link in an 'Email' symbol that I would like to have the window open to a 'mailto', but there are several instances of that symbol on the timeline, each using a different email address. If the [symbol]. Email.Click code reads as follows:

    Window.Open ('mailto:'+ sym.getVariable = ("emailWindow"), "_self")

    and the line in the Stage.creationComplete code that is supposed to call the variable code reads:

    sym.getSymbol("Details_David").$("Email").html ("[email protected]" "").setVariable("emailWindow","[email protected]");

    With this code, the browser opens a window of mailto, but the ' to: ' line readings, "indefinite".

    Either in the [symbol]. Email code. Click, I have:

    Window.Open('mailto:"emailWindow"',"_self")

    without the "emailWindow" as the variable name, the "to:" line to the mailto line reads, "emailWindow".

    How to fill out the "to:" line with a variable email address?

    Otherwise, it works better:

    1)

    replace

    sym.getSymbol("Details_David").$("Email").html ("[email protected]").setVariable("emailWindow", "mailto:[email protected]");

    with

    sym.getSymbol("Details_David").$("Email").html ("[email protected]");

  • Replace the value of the parameter selected with something else

    Hello

    I have a feeling that this scenario is not possible, but I hope that someone on the forum can clarify the issue:

    I was asked to create a parameter that displays a list of values for the company names. However, by choosing a company name in the list, a business identifier would be used for the underlying request generated by Scout.

    Kind regards

    Kevin.

    p.s. I am aware that it is possible set the parameter identifier name and company but the preference is not to do this if it can be avoided.

    Hello

    When you create the item for the CompanyID class there are a number of options, you can check. You don't want the item class displayed then uncheck display article class. The sort element class is also not necessary.

    When you create the parameter to CompanyName you created the setting in the normal way, you don't have to tell Scout that there is an indexed LOV, everything happens in the background.

    Rod West

  • Unable to join the network "Home" with the iPhone

    Immediately, my iPhone detects my network "Home", but will not allow me to connect. I have 2 desktop Mac connected if it means something. Support Apple says that the problem is with the router. I was watching the boards until my head swim, and I can't find anyone else with this problem. In other words, unless those with password failure are the same SEO. My subject line in this post is exactly the error message I get. I would like suggestions. Thank you!

    What is the model of the router?

    What kind of security you use on the router...? If you use WEP, use Key1 as network key. Make sure that Mac Filterring disable on the router... Try changing the channel on the router wireless. Also check out this link.

  • Error message: & quot; The parameter is incorrect. & quot;

    Whenever I go into the properties for one of my subjects, I get this error message:
    "The parameter is incorrect."

    If I change all the properties and click OK, it gives me the message again and does not save my changes.
    Anyone have any ideas?

    Nevermind, I found someone had the same problem. I'm done decomipling my chm file to create a new project. It worked.

  • Unable to create the support updating with key

    Hello Dominic,.

    I have a key of Windows 8, but not 8.1 key. I upgraded to 8.1 of the store, so I'm not able to create the support updating with the key I. Should which option I now?

    Thank you & good day,

    Ajay

    Split from: this thread

    Hello Dominic,.

    Thanks for your reply, appreciate the time taken by us keep up to date on the State of the question.

    You will need a Windows 8.1 product key in order to create a refresh on your computer Windows 8.1 support. You can activate your Windows 8.1 with your product key Windows 8 operating system after upgrade, but to create refresh media, you need a product key Windows 8.1.

    I recommend you to contact our phone support, our technical support engineers can help you in the creation of a support of refreshment with a key demonstration Windows 8.1.

    http://support.Microsoft.com/contactus/?ln=en-us

    Hope this information is useful. Feel free to write us again if you have any further questions or for any further assistance, we will be happy to help you.

  • Insert into DB using SQLservice: can't take the text with single quotes:

    I use Execute sql JDBC service statement.

    I'll explain with simple code:

    insert into mytable (id, desc) values (1, 'this is the document of the customer');

    This works perfectly.

    But if I have apostrophes in the desc-

    insert into mytable (id, desc) values (1, 'this is the document the customer' );

    It is throwing error at a standstill operation errors.

    I know that in Oracle, to escape the single quotes that write us

    insert into mytable (id, desc) values (1, "it is of customer" s document ");

    But, we can not control here in Adobe as the desc is from field on a form when the user enters it.

    I'm guessing that it might be a known issue & can someone tell me the solution.

    Thank you

    KC

    Use a parameter query to avoid this problem.

    insert into mytable (id, desc) values (?,?);

    The two parameters (? brands) can be replaced by actual values using XPATH Expression.

    If you do this, you query runs without raising any errors.

    Nith

  • Select statement with single quotes in the insert statement

    Dear Sir

    What's the trick to cover this issue:

    Insert into TEST_TABLE (SQL_SCRIPT_ID, SQL_SCRIPT)
    values ("1", "select count (*) from the SOURCE where SOURCE.") VALID = 'Y')

    because of the single quotes, I get an error and can not insert, the script works, is there a workaround somehow?

    Thank you 1 million,

    Erik

    Published by: 845498 on June 13, 2012 04:15
    create table testsql(script_id number,sql_script varchar2(1000));
    
    insert into testsql (script_id, SQL_SCRIPT)
    values (1, 'select count (*) from SOURCE where SOURCE.VALID = ''Y''');
    
  • Display the string with single quote

    Hello..

    I have a doubt.

    Below the statement works very well to get the result in single quotes as 'Hello world'
       SELECT '''Hello World'''
       FROM dual;
    Now my question is why we get error when we try to do the same.

       SELECT ''Hello World''
       FROM dual;
    Please let me know the reason, if an organization is to have an idea.

    Thank you
    Suri

    To print a single quotation mark, use two single quotes (IE he "s to print from) and to print a string to write the string inside the single quotation mark as"Hello Word ".
    You want to print "Hello World" your sql will be

    SELECT '''Hello World'''
       FROM dual;
    

    You get the following error as search oracle of KEYWORD Analyzer after "that a chain is closed using the" quote

    SELECT ''Hello World''
       FROM dual;
    ORA-00923: FROM keyword not found where expected
    
  • Unable to get the parameter by using a controller in the OPS

    Hello!

    I am new to using the OPS and will very much appreciate your help!

    FYI:

    Basically, I need to add 2 descriptive flexfields in a page (by creating a VO) and I need to update the table with the data stored on these de facto forces (I did all the logic already).

    I created a (CO) controller that calls a method that is declared in an application module (AM) that runs a stored procedure (CO and the AM were created by me and that they extend a standard CO and I am).

    Problem:

    However, updated just before... I'm having a problem because I can't get a parameter using paramContext.getParameter("reqHeaderId"). who will help me to identify which line I need to update.

    Because the statement is not capture the value, it returns a null value, and I got the following error when I try to convert it to a number in: oracle.apps.fnd.framework.OAException: java.lang.NumberFormatException: null

    It is really important to mention that, before we get to the page where I clicked the Send button that makes the logic mentioned... There are 2 pages before that where I'm trying to capture the setting and the required parameter is defined on the 1st page. I have been checking each standard CO 3 pages and they use the statement pageContext.putParameter ("reqHeaderId"); to switch between the 3 pages (as far as I know, if not please correct me). On the 3rd and last standard CO that it uses pageContext.getParameter ("reqHeaderId"); to get the value and make another logic.

    So why Im not getting the value if I do the same thing (pageContext.getParameter ("reqHeaderId") ;) on my xxController (which extends the standard co)?


    Here is the code of the controller:

    public class xxController extends standardController {}

    ' Public Sub processRequest (pageContext OAPageContext, OAWebBean webBean)

    {

    super.processRequest (pageContext, webBean);

    }

    ' Public Sub processFormRequest (pageContext OAPageContext, OAWebBean webBean)

    {

    super.processFormRequest (pageContext, webBean);

    String str;

    Str = pageContext.getParameter("_FORM_SUBMIT_BUTTON");

    If ((str! = null) & & (str.equals ("SubmitButton")))

    {

    String ReqHeaderId = pageContext.getParameter ("reqHeaderId");

    String ReqLineId = pageContext.getParameter ("reqLindId");

    [Serializable] Parameters = CLIENT1

    {

    ReqHeaderId

    ReqLineId

    pageContext.getParameter ("xxavtBienServicio") //dff

    pageContext.getParameter ("xxavtAttribute3") //dff

    };

    String var = (String) am.invokeMethod ("updateAttributes", parameters CLIENT1);    updateAttributes is the method that converts it to ReqHeaderId number and runs my stored procedure

    }

    }

    }

    Thank you in advance for your help!

    Hello

    I found the reason why I have problems to get the needed values.

    The reason was that the given property has been set to false in order to use pageContext.getParameter must be set to true. So, I went ahead and created as a "value of the form" this way I could put the melted property and keep the hide at the same time field.

    Thanks for your help!

  • Unable to access the parameter input in DoClick layer

    Hello

    In the plugin, I develop, I'm trying to get a patch model where I click (of approximately 20 x 20 pixels), so I need to access the pixels in the DoClick function. This function is called when the user clicks on the layer. In this function, for some reason, I can't access any information of my input layer (params [SUPER_INPUT]-> u.ld), either the width or pixels. When I try and view the width and height, for example, everything I get is zero.

    Anyone know why?

    Thank you

    K.

    PS: I use After Effects CS5 SDK.

    Yo.

    the answer is simple and sad at the same time...

    your plugin incoming image is only returned when calling render.

    However! There are several workaround solutions.

    1. you can keep your pixels input (or output) on the call made in the sequence data.

    benefits:

    You can access anywhere, anytime.

    disadvantages:

    If the user returns to a caching framework, you will not get a call from rendering, and therefore your stored data will not the right time.

    resumes the ram. (not too much a problem today)

    2. take the source of the layer using RenderReceiptWorld().

    You can make AE will pick up the pixels in a video clip in the project at any time, from anywhere, anytime.

    benefits:

    You can get the correct image when you need it.

    disadvantages:

    If the layer of that your plug-in is applied a model, making it may take time. a lot of time in some cases. which could affect the responsiveness of the user interface.

    3. return to the time of cs4, you might have benefited from the mechanism design user interface.

    during the event "draw", allows you to get the comp (or layer) window buffer to take advantage. you could have it used to read the displayed picture.

    Since cs5, drawbot has been implemented.

    I don't see any function that allows to read the data from the 'surface', but may have missed it just me. It is interesting to look into.

    benefits:

    the data is there. Just choose it.

    the user can see the layer because it is in the comp - post effects and transformations.

    disadvantages:

    of course, not be applicable on cs5 and higher.

    4. operate your changes during the call to render.

    It is the best way in my opinion.

    during the 'click' event, store your data (for example, click on location) in the sequence with a flag set data and call a new rendering.

    When calling "render", check if the indicator is checked. If so, read the relevant pixels and operate.

    benefits:

    the less destructive, render-and-ram-wise.

    the least way prone mistake relying on irrelevant frames of the cache.

    disadvantages:

    breaking the flow of your code, and depending on the action, can alter the interactive UI speed, as each iteration requires a new rendering.

    That's all I can think about right now.

    If none of the suites above you, then I need to learn more about the process you do to find a better solution.

    :-)

  • Unable to read the .avi files with Windows Media Player 11 on XP

    Original title: Media player upgrade was worse than basic
    I recently updated my Player multimedia media Player 11 and now it won't play movies from AVI file that I used to be able to play easily on the outdated version. Why is this?

    Hello

    Do you have an error message when you try to play with Media Player AVI files?

    When you try to play a file that uses a codec that is not installed on your computer, Windows Media Player attempts to download the codec from a Microsoft server. If the
    Codec is available, the Windows Media Player installed on your computer, and then bed file. However, if the codec is not available on the server (for example, because)
    the codec not created by Microsoft), Windows Media Player displays a message that your computer is missing a codec.

    In some cases, the file you want to play uses a codec that is not available or compatible with Windows Media Player. When this happens, you may be unable to use Windows Media Player to play this particular .avi file.

    You can consult this article for a solution:

    You receive an error message when you try to play an .avi file in Windows Media Player
    http://support.Microsoft.com/kb/279242

    Kind regards
    Afzal Taher-Microsoft Support.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Unable to get the database searched with MAX and GROUP BY function

    Hello
    All the

    I have a table as below:
    COLUMN TYPE
    User_id VARCHAR2 (10 byte)
    ID_processus VARCHAR2 (30 bytes)
    END_TIME DATE (STAMP)
    TO_LOC VARCHAR2 (12 bytes)
    TO_LOC_TYPE VARCHAR2 (15 bytes)
    FROM_LOC VARCHAR2 (12 bytes)
    ITEM_ID VARCHAR2 (25 bytes)
    CASE NUMBER (12.4)
    LMS_UDA1 VARCHAR2 (250 bytes)
    AREA VARCHAR2 (2 bytes)

    I only want to get one record with all the columns, have only one clause MAX (END_TIME)
    But the other column value of the difference.
    When I use MAX (END_TIME) and GROUP OF USER_ID, ID_processus, CASE...
    the sql did not a single record,
    It gives the number of records

    Please help me on this

    Concerning

    Saven

    >
    I only want to get one record with all the columns, have only one clause MAX (END_TIME)
    But the other column value of the difference.
    >
    Maybe it's not possible because it depends on your data.

    If the combination of all columns except END_TIME is not unique then there will be multiple records; a record for each unique combination (GROUP BY) of all other columns.

    The only way to ensure that a record is

    SELECT MAX(END_TIME) FROM myTable
    
  • Unable to generate the complete file with UTL_FILE

    Hello

    Please refer to the next simple room where I am generating a file on the DB server that should contain 100,000 lines of code.

    declare
    l_fil utl_file.file_type;

    cursor c1 is
    Select *.
    of rats_txtio;

    Start

    l_fil: = utl_file.fopen('SRS_CSD_DIR','rats3.txt','w',32767);

    I'm looping c1
    UTL_FILE.put_line (l_fil, to_char (i.SNO));

    UTL_FILE.fflush (l_fil);

    end loop;

    UTL_FILE.fclose (l_fil);

    end;

    rats_txtio is a table which has sno as one of the columns. The table has 100 thousand records, with sno from 1 and ending with 100000.

    However, after you generate the file, when I display the contents of the file on the server, there only 95123 lines, starting with 1 and ending with 95123.

    Let me know, if there is no parameter causing a restriction on the number of lines that can be generated, or is there something missing in the code.

    Thanking you,
    Rocky.

    Can you provide a reproducible test for us case?

    SQL> ed
    Wrote file afiedt.buf
    
      1  declare
      2    l_fil utl_file.file_type;
      3    cursor c1 is
      4    select rownum as sno
      5    from dual
      6    connect by rownum <= 100000;
      7  begin
      8    l_fil := utl_file.fopen('TEST_DIR','rats3.txt','w',32767);
      9    for i in c1 loop
     10      utl_file.put_line(l_fil,to_char(i.sno));
     11      utl_file.fflush(l_fil);
     12    end loop;
     13    utl_file.fclose(l_fil);
     14* end;
    SQL> /
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    When I open this file in word and examine the properties it tells me there are 100,000 lines.

    Looks ok to me. What you do differently?

    How do you count the number of rows returned by your query?
    How do you count the number of lines in the file?

  • Unable to share the wireless internet with other wireless devices

    Original title: I'm trying to share the wireless internet on my computer with other wireless devices, are don't see is not the other.
    Internet through my wireless computer connections are not visible to my other devices. How can I fix it so that my other devices will be found and connected.

    Hello

     
    1. don't you make changes on the computer before the show?
    2. you receive an error message on the computer?
    3. what version of operating system you are using on the computer?
    4. What wireless device you try to share?

    Method 1:
    You can try the steps in the link and check.
    Windows wireless and wired network connection problems
    http://Windows.Microsoft.com/en-us/Windows/help/wired-and-wireless-network-connection-problems-in-Windows

    Method 2:
    I suggest to turn on network discovery, and check if this helps you solve the problem. To do this, please follow the steps below:

    1. Open advanced sharing settings by clicking the Start button, then Control Panel. In the search box, type network, click Network and sharing Center, and then, in the navigation pane, click on change settings for sharing advanced.

    2. click on the chevron to expand the current network profile.

    3. click turn on network discovery and then click on save changes. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.

    To learn more about this feature, please visit the below mentioned link:
    http://Windows.Microsoft.com/en-us/Windows7/what-is-network-discovery

    Method 3:
    If the problem persists then you can disable firewall on the computer and check.
    Enable or disable Windows Firewall
    http://Windows.Microsoft.com/en-us/Windows7/turn-Windows-Firewall-on-or-off
    NOTE: Turn off Windows Firewall might make your computer (and your network, if you have one) more vulnerable to damage caused by worms or hackers.
    You can see the following link to disable the Antivirus installed on your computer software.

    For more information about how to resolve common network problems, please see the links below:

    http://Windows.Microsoft.com/en-us/Windows7/setting-up-a-wireless-network
    In Windows network connection issues
    http://support.Microsoft.com/kb/313242

Maybe you are looking for