dynamic SQL for OPEN will not take the SQL string in the form of a string variable

Hello

I use "OPEN-for", not "EXECUTE IMMEDIATE" because I want to do multi lines request. However, 'OPEN-for' won't take a variable "strSQL' in the clause, it only took fixed ropes?

create or replace function fnEnumSystemUser
(
LogonFilter nvarchar2,
...
AdditionalWhereClause nvarchar2,
OrderByClause nvarchar2
)
RETURN xxxxx.cursorType
AS
strSQL nvarchar2 (2000);

FormatAdditionalWhereClause nvarchar2 (2000);
FormatOrderByClause nvarchar2 (2000);

SystemUserCursor xxxxx.cursorType;
BEGIN

If AdditionalWhereClause IS NULL THEN
FormatAdditionalWhereClause: = ' ';
ON THE OTHER
FormatAdditionalWhereClause: = TRIM (AdditionalWhereClause);
END IF;

If OrderByClause IS NULL THEN
FormatOrderByClause: = ' ';
ON THE OTHER
FormatOrderByClause: = TRIM (OrderByClause);
END IF;

strSQL: = 'select Id, FirstName, MiddleName, LastName, PrimaryEmail, PersonType, CreateDate, CreatedBy, LastUpdate, LastUpdateBy, connection, PasswdHash, IsSuspended, had left join SystemUser person on SystemUser.PersonId = Person.Id';
-It won't work, just says "WARNING: compiled, but with compilation errors" when I tried to create the function
Open SystemUserCursor for strSQL;

-This is to call "ORA-01006: bind variable does not exist.
Open SystemUserCursor
' select Id, FirstName, MiddleName, LastName, PrimaryEmail, PersonType, CreateDate, CreatedBy, LastUpdate, LastUpdateBy, connection, PasswdHash, IsSuspended, had left join SystemUser person on SystemUser.PersonId = Person.Id WHERE SystemUser.Logon like: x: y ' using LogonFilter, OrderByClause;

-This failed also (on call, "ORA-00900: invalid SQL statement")
Open SystemUserCursor
' select Id, FirstName, MiddleName, LastName, PrimaryEmail, PersonType, CreateDate, CreatedBy, LastUpdate, LastUpdateBy, connection, PasswdHash, IsSuspended, had left join SystemUser person on SystemUser.PersonId = Person.Id WHERE SystemUser.Logon like: x' | OrderByClause using LogonFilter;

RETURN SystemUserCursor;
END;

That's how I invoked:
declare
Int NumItemsSelected;
lstResult xxxxx.cursorType;

TYPE SystemUserRecordType IS RECORD
(
ID numeric (19.0),.
FirstName nvarchar2 (50).
MiddleName nvarchar2 (50).
LastName nvarchar2 (50).
PrimaryEmail nvarchar2 (190),
PersonType int,
CreateDate timestamp,
CreatedBy numeric (19.0),.
LastUpdate timestamp,
LastUpdateBy numeric (19.0),.

Logon nvarchar2 (75).
PasswdHash int,
IsSuspended tank,
Display timestamp
);
SystemUserRecordType oUser;
Start

lstResult: = fnEnumSystemUser (...) '%',... Person.PrimaryEmail like '% a %', "order by ASC Logon", 0, 10, NumItemsSelected);
LOOP
extract lstResult in oUser;
When the output lstResult % notfound;
dbms_output.put_line ('Id: ' | oUser.Id);
END LOOP;
end;

I need the ability to add to the SQL string because ultimately say I need to join:
1. ORDER BY section
2 call a FUNCTION in WHERE Clause
3 pagination and ROW_NUMBER() clause

What can I do? Thank you!

1. why you use NVARCHAR2 to the SQL string. Use VARCHAR2 or LONG.

2. use

 tags to preserve formatting of your code.

3. In the bind variable does not exist example it looks like you have one bind, :y, but are trying to bind two variables logonfilter and orderbyclause.

4. In the third example, try logging the sql string in a table or dbms_output and running it in sql - you should get the same error and it might then be easier to diagnose.

Cheers,
Dominic                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

Tags: Database

Similar Questions

  • I bought the DC of Adobe Acrobat pro and completed the info online, but when I use the cd with the product code key it will not take the code?  What do I do then?

    I bought the DC of Adobe Acrobat pro and completed the info online, but when I use the cd with the product code key it will not take the code?  What do I do then?

    Thanks Anubha Goel, final I got it to work... The serial number in the physical box that you buy in the store wasn't the number for the software.  It was the serial number in the cloud, very difficult to know when you see a serial number in the box with the Cd online.  But thanks for the reply to my post. I'll be in offline mode after clicking on answer...  Thank YOU Ana Maria

  • Iphone4s with Skype will not take the call, it's as if the ringing type is set to zero, it gives a busy year.

    The iPhone running Skype, will not take a call, it's like the ring time is set to zero, it takes callers I would but gives the caller a busy year, any help please, thank you Ken

    I had the same problem - fixed it:

    https://support.Skype.com/en/FAQ/FA10981/how-do-i-delete-my-shared-XML-file

    Make sure that you log out of Skype on your iPhone and PC. After you delete the file, restart Skype on your computer and connect to recreate the file. The journal of Skype on your computer and in to Skype on your iPhone.

  • That means when I try to download to finish and he say he will not take the language

    Try to download to finish making my account and it says that it will not, except my tongue. .. don't know what to do.

    Hello

    Kindly confirm what application you are trying to install?

    If TI Creative Cloud then the following link can help you to fix: change the language setting of your Cloud Creative applications

    Kind regards

    Shipti

  • Former owner will not take the time to remove his ACCT. I have his name, number, address, serial number, imei of the device. I've added it to my Verizon plan. I can't activate it! Apple won't help me but him?

    Former owner is not the time to remove the device from his account. I have his name, number, address, serial number and imei of iphone.  I always had of BONE cell phones, but my daughter IOS. I made sure that the IMEI was clean and it was not on the black list before adding it to my Verizon account. Now, I learned about icloud.  Verizon has brought his number to the iphone and now she has no phone to use. I called apple, but I was told that they could not help me, but they might help the original owner.  They original owner is older and perhaps confused after I tried to explain what I've learned.  What can I do when the original owner is/was/still confused about how the system works?  I'm always lost in this world of apple.

    It sounds as if this iPhone is locked in Activation.  Here is the complete description of locking Activation:

    Find my iPhone Activation Lock - Apple Support

    Assuming that the former owner is ready (but simply not able) to help you, maybe if you contact the owner and his or her through the directions above, you'll be all set.

  • Selection tool will not adjust the forms

    For some reason when you work with illustrator my selection tools won't adjust the forms more. I can move the shapes but I can't resize them or stretch them. If I have a form of rectangle on my selected screen, the hatch which are normally found in the environment are no longer there, also on the edges of the rectangle of the selection tool is not switch to the rotation tool. My selection tool also has a small black square down to the right that I have not noticed before. I have no idea how I got into this mode or other whatnot, but any help to return to normal would be awesome, preferably without resetting all my preferences, thank you!

    Display > display the bounding box

  • Remote Desktop for Mac will not use the printer driver

    On an iMac with Lion 10.7.3, I try to get an Epson ReadyPrint T20 - TM to use the Epson driver when it is connected to our server Windows 2008 R2 with DRC 2.1.1 but it keeps using a HP Color Laser Jet 2800 Series PS we have not the HP printer and I need some features in the Epson driver.

    I installed the printer on the server and removed several times without alteration. When 'Use a printer connected to the Mac' is selected in the preferences of the DRC the printer is a printer that is redirected, but the use of the driver of HP. Printing from Mac works with all the features.
    On the server, we have 3 installed roles, file, desktop Services to remote and Web server (IIS) Services
    We have tried to map the printer with an EPSONRedirect.INF file that contains the following:
    ; EPSONRedirect.INF
    ; Printer mapping file for drivers side client-side Server
    [Printers]
    "EPSON TM - T20" = "EPSON TM - T20 ReceiptJ4"
    No idea how we can fix this?
    [Transferred to the Windows forum by moderator]

    Hello

    I suggest you to post the question on the following link:

  • My firewall of Windows 7 will not take the updates more

    How do update you my Windows Firewall that stopped taking updates?  Sound not to get your updates.  How can I solve this problem?

    A firewall can help prevent hackers or malicious software (such as worms) to access your computer through a network or the Internet. A firewall can also help stop your computer from malware sent to other computers.

    The Windows Firewall doesn't in any way requires any maintenance feature.

    If you are referring to Windows Update.

    You can reset the Windows Update components by running the Fixit on this page.  But if there is malware present, she will continue to reset the connection to the update servers:

    How to reset the Windows Update components

    http://support.Microsoft.com/kb/971058

    Suggest you download and save the Fixit.  Then configure the system before the clean boot by running:

    How to troubleshoot a problem by performing a clean boot in Windows Vista/Windows 7

    http://support.Microsoft.com/kb/929135

    Once the Fixit has been downloaded and the system is started in the pure State, check that the native Windows Firewall is now on if a 3rd party firewall has been used previously.  Now run the Fixit and choose the default mode.  Restart once it's done and see if the system can be connected to the update servers.  If he can't, then rerun the Fixit and choose aggressive mode.  Turn it back on when he finished the race and updates.

    I suggest before you stop and install the updates, disconnect from the Internet, first.

  • Serial number for CC will not take

    I am a student and downloaded the trial version of Photoshop CC.  I have the serial number, but there letters and letters and numbers is not it.  Mac OS X 10.8.5 I CS6 already and can not find help in the forum.

    Hi Stevereffey

    Please try this link, http://helpx.adobe.com/x-productkb/global/find-serial-number-student-teacher.html

    It will help you activate the CC from Adobe, creative cloud is based on the Adobe Id, there is no serial number, the value that you have is the redemption code.

    Hope this helps you.

    Thank you

    Kind regards

    Baudier

  • Update the serial number will not take

    I have a copy of 2011 of "'Adobe Design Premium CS5 5.0 MAC Upsell" (as indicated on the invoice) and bought an update out of the Adobe site for Adobe Creative Suite 6 Design & Web Premium (Mac, English). "


    The site accepts my card and took the payment, but my applications will not take the new number series as an upgrade. They return an error that it is not a product. How can I get a serial number that works?

    If your previous version's education, you can't spend... Since the educational versions are sold with a discount

    Otherwise, since this is an open forum, not Adobe support... you must contact Adobe staff to help

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)

    Serial number and activation support (non - CC)

    http://helpx.Adobe.com/x-productkb/global/Service1.html

  • I'm trying to upgrade to service pack 3 for xp and I get an error message and it will not complete the installation. What should I do?

    I'm trying to upgrade to service pack 3 for xp and I get an error message and it will not complete the installation.  What should I do?

    Hi BartlettNYC,

    Please see the links below, to solve the problems with Window XP SP3.

    Steps to take before you install Windows XP SP3.

    http://support.Microsoft.com/kb/950717

    How to troubleshoot a windows XP SP3 Installation failure.

    http://support.Microsoft.com/kb/950718

    Good luck.

  • I have an an OEM vista upgrade and the pc will not take my product code. It is said that it will expire in 2 days.

    Original title: I have an an OEM vista upgrade and the pc will not take my product code. It is said that it will expire in 2 days. Thanks, Mike

    I have an an OEM vista upgrade and the pc will not take my product code. It is said that it will expire in 2 days. Thanks, Mike

    Hi Mike,

    Thanks for posting your question in the Microsoft Community.

    I imagine the inconvenience that you are experiencing. I will certainly help the question of fixing.

    To help you suggest several steps to solve the problem, I would appreciate if you could answer the following questions:

    1. What is the error message that is accurate or complete?
    2. have you made any recent hardware or exchange of software on your computer before the show?

    I suggest you to go through the following articles and check if that helps.

    Error message when you start Windows Vista: "your activation period has expired".
    http://support.Microsoft.com/kb/925616

    Resolve activation problems
    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-activation-problems

    How to activate Windows Vista
    http://support.Microsoft.com/kb/940315

    How to contact a Microsoft Product Activation Center by phone
    http://support.Microsoft.com/kb/950929

    For more information:

    Validation failed? These scenarios may help to explain why.
    http://www.Microsoft.com/genuine/downloads/FailureScenarios.aspx?displaylang=en

    If anything in my post is not clear or if you have other questions, do not hesitate to let us know. It is our pleasure to be of service.

  • the .xml file will not hold the new version I am writing on the 'AIR for iOS settings' window on Flash cc 2015

    Hello

    I need to download a new version of my app on iOS, but the .xml file will not hold the new version I am writing on the 'AIR for iOS settings' window on Flash cc 2015. It keeps appearing as:

    <? XML version = "1.0".

    also when I try to download the new .ipa on iTunes Connect with the Application Loader, I get this message:

    "" "ERROR-ITMS-4238:"redundant binary Upload. " «"" "" There is already a binary download with release ' 1.0.0' train ' 1.0.0 ' "at SoftwareAssets/PreReleaseSoftwareAsset»»»

    The problem is not of Application Loader or iTunes Connect as when I open again the .fla and check the window 'AIR for iOS parameters' he continues to display the 1.0 version over and over again. If Flash isn't that save the .xml file.

    And it happens with all my other apps Android or iOS, old and new versions, all appear as <? XML version is "1.0" on the .xml file.

    Is anyone know how can I solve this problem?

    Thank you.

    There are two different values, the build number and version number. If you use a test flight, you can submit an update without obtaining a review by increasing the build number. If you are submitting an update to an application in iTunesConnect, you must increment the version number.

  • My IPAD 4 takes great pictures but will not save the photo

    MY IPAD 4 takes great pictures but will not save the photo

    Don't know what your question, but the changes are saved to a file with the extension. AAE. If you are importing photos to a Mac changes will come with photos.

    Import photos and videos from your iPhone, iPad or iPod touch - Apple Support

  • USB port from a digital Multiport card will not read the external SSD drive. Right USB - c for the USB adapter works fine.

    USB port from a digital Multiport card will not read the external SSD drive. Right USB - c for the USB adapter works fine.

    It's a new 12 '' MacBook

Maybe you are looking for