SQL (body of function from PL/SQL returning the SQL) query when you use to_char

We are trying to build a page of Type SQL Query report (body of function from PL/SQL returning SQL query).
our request is simple, to extract the month of the column recording_date.

declare
l_query varchar2 (1000);
Start
l_query: = 'select to_char (recording_date, 'MM') of re_productive;
Return l_query;
end;

but we would like the following for this query problem

Function returning SQL query: query cannot be parsed in the generator. If you believe that your query is syntactically correct, check the box of generic columns below the source of the region without analysis.
(ORA-06550: line 4, column 42: PLS-00103: encountered the symbol "MY" what awaits one of the following values:.) (* @ % & = - +; <>/ at is mod remains not rem <>or! = or ~ = > = < = <>and or as between | multiset Member SUBMULTISET_ the symbol ".") was inserted before 'MY' to continue.)

Notes:
1 - the request is correct and it has been tested under sqlplus and toad.
2. we tried option use generic name (analysis of query runtime only) column, but we get the same problem.


any quick help please.

Hello

You have not escaped your quote in the string. Try this...

DECLARE
l_query VARCHAR2(32767);

BEGIN

l_query:= 'select to_char(recording_date,''MM'') from re_productive';

RETURN l_query;

END;

See you soon

Ben

Tags: Database

Similar Questions

  • Pages automatically reformats to the correct size when you use Folio Builder or what I have to do format pages iPad, for example, in the placed InDesign document in place from the beginning?

    Pages automatically reformats to the correct size when you use Folio Builder or what I have to do format pages iPad, for example, in the placed InDesign document in place from the beginning?

    Transferred to DPS forum.

    You must configure the pages of appropriately for the target device. For iPad, it is 1024 x 768.

  • Issue of Oracle SQL Developer when you use VPN (Cisco)

    All,

    We have a somewhat obscure issue with connectivity SQL Developer to our databases of the laptop has distance from the employee.

    The database is hosted inside our firewall and when the employee is trying to connect to the database that it receives the following error message:
    + "Encountered error: an error has occurred to perform the requested operation: the network adapter could not establish the connection." Code provider 20 "+"

    I think maybe I saw the error at some point as well...
    Status: Failure-Test failed: IO error: the network adapter could not establish the connection

    Note: It gets this error when you are connected to our VPN & so that it can connect through SQL * more on that same basis. It gets the error without worrying if he uses the option to enter tnsnames in SQL Developer or if it uses the "basic" connection type

    What is interesting, is that if he disconnects the VPN, will turn off its wireless connectivity, then hard-wire in our network, it can connect, without issue.

    The strangest part for me, is that although it cannot connect to the database using SQL Developer, it can connect through SQL * more. It can ping the IP source address very well, he can tnsping database without problem, it can connect through SQL * Plus, it just cannot connect through SQL * Developer. Since SQL * more and tnsping work, I know that it can access the db server through port 1521, so I don't think it's a problem of port.

    Another weird thing: when it connects to our network via a 'old' virtual private network (VPN open) there is no problem.

    His machine is Windoz 64 bit (HP laptop) and it uses the latest version of the SQL Developer and a JAVA virtual machine.

    Also interesting: I also have a Windoz 64 bit computer laptop (Lenovo) and I don't have the same issues, as it does. I am however running an older version of SQL Developer and probably an older JVM.

    I dug around a bit, looks like maybe it has something to do with IPv6? No idea what to do next, except have my network guy look at the logs of firewall to try to grasp where the connectivity has been ignored.

    Any ideas or suggestions would be appreciated. I tried all sorts of things (giving him my file tnsnames.ora and sqlnet.ora, manually editing these files, try IP addresses instead of host names, host names I tried with the doman.org extensions, etc.).

    Still, any suggestion would be appreciated and I thank very you much.

    Rich

    Published by: rmurnane on October 23, 2012 10:58

    If it is IPv6, you can try adding

    AddVMOption -Djava.net.preferIPv4Stack=true
    

    at \sqldeveloper\bin\sqldeveloper.con

  • Why the fonts blurry when you use remote Windows for ofc computer access from home?

    I use Windows remote access to my desktop (Windows 7) from home (also Windows 7). The fonts are blurry. When I use the remote Windows to access Outlook only, the fonts are clear and sharp.

    Hello
    Please try these:
    1. click on start, type Remote Desktop connection.
    2 open remote desktop connection, click options.
    3. click on the tab advanced; Put a check mark on the font smoothing.
    4 if it is already checked, then uncheck the font smoothing

     
  • How to return to normal mode when you use vim shortcuts in the code/style editor?

    I try to use vim shortcuts keyboard for code/style editor in Firefox Developer Edition. I can type 'i' to switch to insert mode, but how do I return to the normal mode? ESC activates / deactivates the pane of the console, but don't come back to me in normal mode.

    Sorry, I misunderstood. I'm not familiar with the way VIM works. CTRL + C doesn't do what you want?

  • Display the progress bar when you use the Calculate function

    Hello

    For my project, I need to convert the raw values of a signal in physical quantities.

    To do this, I use the function "calculate".

    Because I have a lot of data, it takes time, and the user does not know if it works or not.

    The first thing I did, is to Add Dialog.BeginWaitCursor and Dialog.EndWaitCursor which works well, but is not enough.

    To view activity, I want to display a progress created bar before calling 'Calculate' and stopped after that.

    The progress bar does not need to show real progress, but displayed only a movement of progress even if it again to zeor until the end of the calculation.

    I have read some information on the progress made on this forum, but he did on selfmade function and tiara not call functions.

    This is why it is not useful to me.

    I don't know how to do this using vbs.

    Is it possible to create something like this?

    The best solution would be to get the status of the function of 'Calculate' to see where he is, but the function is not created to do this.

    Thanks for all the ideas,

    Best regards

    CFOE

    Hey CFOE,

    I asked R & D at the same time, because I thought I remembered seeing a progress bar continued in tiara before, but I didn't know if it was something we might call with a VBScript command.  I just heard back that you can, and it's here...

    Call AutoLoopInit
    MsgBox "ready to stop the progress bar?
    Call LoopDeInit

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • How to add the warning message when you use the function 'print' in Adobe LiveCycle Designer

    I'm trying to make the pdf document for my business that requires the addition of a warning message while everyone to use the function 'print' page...

    Does anyone know how to add the warning message about LiveCycle Designer

    Also my supervisor mentioned something using "nag" If that sounds at all

    Not in the XML code, in the case of script of pre-publication of the "print" key. If you don't have the script editor to the top on your version of designer, you can press ctrl + shift + F5 to bring it.

  • How to change the search engine when you use the functionality of Firefox Home button Search?

    In Firefox itself, I have configured duckduckgo as my default search provider.

    But when I use the host Firefox search button it is always defined on google and I don't see any possibility to change that?

    I love the Firefox Home button Search (or whatever we call it) otherwise, but it's annoying that it does not use the default Firefox.

    I use the Google Launcher now.

    Hi mrt181, it is planned to use the same search engine as in firefox - however, there is a bug at the moment, so it does not apply in all situations.
    usually, it will be enough to change the default engine in firefox back once to work around the problem in the search widget and get the same as set in the browser search provider.

  • How can I keep the screen from closing when I close the macbook pro when you use the apple wireless keyboard?

    Try to use with my macbook pro apple wireless keyboard and an external display.  The display turns off when the macbook pro is closed.

    Make sure that it is connected to power.  It cannot run in clamshell mode of the battery power.

    https://support.Apple.com/HT201834

  • Export as .xls. Classic report type: SQL (body of function from PL/SQL returning the SQL) query

    Hey guys,.

    I'm using version 4.2.6 apex. The theme is 26.

    IM also using Listener Oracle APEX.

    I can print my classic report in PDF or CSV format.

    But I need to export it as a .xls extension.

    Report type: SQL (body of function from PL/SQL returning the SQL) query

    I need is like this cause my 'where' clause type is dynamic.

    Look at using this method: Tom's Blog: a non-standard export excel 2010 (.xlsx)

    I do something similar for downloads to excel in my projects...

    Thank you

    Tony Miller
    Software LuvMuffin
    Ruckersville, WILL

  • ORA-00902 error invalid data type when you use CAST in the PL/SQL Package

    I'm getting ORA - 00902 Datatype not valid error when you use cast in getEmpValues (see code below) method in the package I created.
    I don't know what is the cause of the error. Any help would be appreciated



    CREATE OR REPLACE PACKAGE TEST. TEST_PKG AS

    ARRAY TYPE MyTableType IS NUMBER;
    TYPE REF_CURSOR IS REF CURSOR;

    FUNCTION str2tbl (p_str IN VARCHAR2)
    RETURN myTableType;

    PROCEDURE getContactValues (p_ParameterString IN VARCHAR2, p_Cursor1 to REF_CURSOR);

    END TEST_PKG;



    CREATE OR REPLACE PACKAGE BODY TEST. TEST_PKG AS

    FUNCTION str2tbl (p_str IN VARCHAR2)
    RETURN myTableType
    AS
    l_str LONG default p_str | ',';
    l_n NUMBER;
    myTableType l_data: = myTabletype();

    BEGIN
    LOOP

    l_n: = INSTR (l_str, ",");
    WHEN the OUTPUT (nvl(l_n,0) = 0);
    l_data.extend;
    l_data (l_data.count): = ltrim (rtrim (substr(l_str,1,l_n-1)));
    l_str: = substr (l_str, l_n + 1);
    END LOOP;
    L_data return;
    END;

    /*
    p_ParameterString is a string of the form 3, 6, 8, 9'
    */

    PROCEDURE getEmpValues (p_ParameterString IN VARCHAR2, p_Cursor1 to REF_CURSOR)
    AS


    BEGIN


    OPEN FOR P_Cursor1

    SELECT *.
    FROM EMP

    WHERE EMP_ID IN (SELECT *)
    OF THE (SELECT CAST (TEST.) (TEST_PKG.str2tbl (p_ParameterString) as myTableType) double)

    );
    END getEmpValues;

    END TEST_PKG;

    ARRAY TYPE MyTableType IS NUMBER;

    This type must be created outside of the package as a SQL type if it must be used in a select statement.

  • Hi, actually I want the program stops when you press the stop button. but the problem is the program is runing in loop only he doesn't return tile view deleted complete execution of any body can help me for this.

    Hi, actually I want the program stops when you press the stop button. but the problem is the program is runing in loop only he doesn't return tile view deleted complete execution of any body can help me for this.

    Here

  • Error occurs when you use SQL Server 2012 assessment vs window detail of the object in window 7 - KERNELBASE.dll exception 0xe0434352

    Hello

    Error occurs when you use SQL Server 2012 assessment vs window detail of the object in window 7.  I use the window of the object but the detail of the objects window arrives and immediately SQL Server stops with the error below and then opens again.  I didn't find any help with this specific error is but suspect there is a problem between SLQ Server 2012 et.NET Framework 4.  Unfortunately, I do not know what it takes in this regard.

    Thanks, Deb

    Event ID: 1000
    Task category: (100)
    Level: error
    Keywords: Classic
    User: n/a
    Computer: Deb - HP
    Description:
    Name of the failing application: Ssms.exe, version: 2011.110.3000.0, time stamp: 0x5081c1cd
    Name of the failed module: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b83c8a
    Exception code: 0xe0434352
    Offset: 0x0000c41f
    ID of the process failed: 0x13a8
    Start time of application vulnerabilities: 0x01ce609a6d3db991
    The failing application path: C:\tempSQLWOW\110\Tools\Binn\ManagementStudio\Ssms.exe
    Path of the failing module: C:\Windows\syswow64\KERNELBASE.dll
    Report ID: 1fb1cbfb-cc8e-11e2-b436-abd2bebb3f17

    Hi Claude,.

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the link below.

    http://social.technet.Microsoft.com/forums/en-us/category/SQLServer

    Good day!

    Answer please if you face concerns.

  • Correct way to use Bind variables when you use an interface to MS SQL Server

    Hey,.
    I have some difficulty to find how to use bind variables in a view, when you use an interface to MS SQL Server. For some reason when I use an ApplicationModule who has a library of MS SQL Server JDBC loaded and I try to click on OK when you change the following query:

    SELECT kit_status, component_id
    OF numbered_inv
    WHERE trialname =: 1

    I get an error stating that ' SQL Query Error Message incorrect syntax near ':'. JDeveloper is compatible with SQL server for bind variable as this query works fine if I replace the: 1 with a Word to say "Test test".

    Thanks in advance

    Edited by: NullCheck December 15, 2010 14:06

    Use positional JDBC Style Binding to bind variables
    Try to use? Instead of:
    As shown here:
    http://www.Oracle.com/technetwork/developer-tools/jdev/multidatabaseapp-085183.html

  • ntmsapi.dll missing when you use ntbackup.exe on windows 7 to recover my data from the windows xp ntbackup utility

    Hello, I was able to download ntbackup.exe on my computer, I just upgraded to windows 7 from windows xp.  However, I can't use the ntbackup.exe in windows 7.  But when I did, now I am unable to operate because the error message says missing ntmsapi.dll.  Can you guys send me the file or tell me where I can get it.

    Sincerely, Emmanuel

    Hello, I was able to download ntbackup.exe on my computer , I just upgraded to windows 7 from windows xp.  However, can not use the ntbackup.exe in windows 7.  But when I did, now I am unable to operate because the error message says missing ntmsapi.dll.  Can you guys send me the file or tell me where I can get it.

    Sincerely, Emmanuel

    Hello

    Windows 7 / 2008 R2 doesn't use NTBackup.exe to back up files. Instead, it uses SDCLT.exe (in %SystemRoot%\System32\sdclt.exe( ), which depends on the shadow copy volume service.

    If you do not want to install even when NTBackup.exe , you will need the files that you can get your Windows XP CD nt5backup.cab Cabinet or you can download them from the internet, then copy the files into a new folder (for example, copy the following files to %ProgramFiles%\NTBackup)
    • Ntbackup.exe
    • Ntmsapi.dll
    • Vssapi.dll
    • Ntbackup.chm
    • Ntbackup.hlp
    If you have an existing installation of copy of Windows XP is already installed, please copy the following copy in a new folder (for example, copy the following files to %ProgramFiles%\NTBackup)
    • %SystemRoot%\System32\Ntbackup.exe
    • %SystemRoot%\System32\Ntmsapi.dll
    • %SystemRoot%\System32\Vssapi.dll
    • %SystemRoot%\Help\Ntbackup.chm
    • %SystemRoot%\Help\Ntbackup.hlp
    NOTE: You may receive the following error when you start NTBackup.exe on Windows 7. This error can be ignored

    The backup utility cannot connect to the removable storage service. This service is required for use with tape drives and other backup devices.

    Please, get out and start the RSM service using the Services management console system function.


    Thank you
    I hope this helps :)

Maybe you are looking for

  • MacBook Pro 13 "Retina Display Usb Port does not... !!

    MacBook Pro 13 "Retina Display right usb port does not... I tried to plug in and out still it doesn't then I rebooted my macbook and again inserted the USB, it worked... !! Why this problem is caused? today is the 5th day since I bought my macbook...

  • How can I force Firefox to go to a port which he won't use?

    http://w.x.y.z:87 results This address is limitedThis address uses a network port that is normally used for purposes other than browsing the Web. Firefox has cancelled the request for your protection. I don't want protection, I want ACTION! How can I

  • How can I get a live tech for an Omni 10 still in warranty?

    How can I get a live tech for an Omni 10 still in warranty?

  • My new Portege Z30-B-110 does not start

    My Z30-B-110 does not start. The keyboard and the screen will Flash regularly. I tried in vain to press the power button for a while. I would be grateful if you could help me.Thank you! Tona.

  • Restoration of DPM on network share

    I use a Powershell script to restore a backup of DPM. I can get it to restore it to a local or a USB drive, but I can't seem to restore on a network share, no matter if the UNC path used or if I map it and then use the drive letter. Thoughts?