Using the IN command with parameters
I am using .Net with the Oracle 10G client software to connect to a 10G database. I have a package that contains a stored procedure where I need to pass in multiple values to utilize the IN command, but I keep getting a cryptic Oracle error. Basically this is the scenario..
SELECT * FROM [Table] WHERE ID IN(P_PARAMETER);
Through my .Net code, I set P_PARAMETER equal to something like "25,31,36,48" without the double quotes. I also tried surrounding each number with single quotes and it still bombed out. Is this valid to do? If not, what are my options since I need to use this scenario (the numbers aren't known ahead of time)?
may be you are looking for this, you have to use dynamic sql,
i am using ref cursor to display the data, basically the inlist you are passing is comma seprated as under
SQL> var c refcursor;
SQL> var NO VARCHAR2(200);
SQL>
---- this is the in list with comma seprated
SQL> EXECUTE :NO:='10,20';
PL/SQL procedure successfully completed.
-- i am paasing that in list here to procedure
SQL> CREATE OR REPLACE PROCEDURE test_in (pdno IN VARCHAR2, p_cursor OUT sys_refcursor)
2 IS
3 st VARCHAR2 (200);
4 vename VARCHAR2 (20);
5 BEGIN
6 st := 'SELECT empno,ename FROM emp WHERE dno in ('||pdno||')';
7 DBMS_OUTPUT.PUT_LINE (pdno);
8 DBMS_OUTPUT.PUT_LINE (st);
9 OPEN p_cursor FOR st ;
10 END test_in;
11 /
Procedure created.
-- calling the procedure
SQL> EXECUTE test_in (:NO,:c);
10,20
--- this how the statement will look like
SELECT empno,ename FROM emp WHERE dno in (10,20)
PL/SQL procedure successfully completed.
printing the out put
SQL> print :c;
EMPNO ENAME
7369 SMITH
7566 JONES
7782 CLARK
7788 SCOTT
7839 KING
7876 ADAMS
7902 FORD
7934 MILLER
8 rows selected.
Elapsed: 00:00:00.00
SQL> added comment
Message was edited by:
devmiral
Similar Messages
-
the problem I have since I upgraded to Mavericks version 10.9.1
The problem appears only with Mail not with other programs, not even with my browser.
When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command + to enlarge the text, although I can reduce it with Command -.
As I have a problem with my eyes, This is a serious matter for me.
When I write an e-mail, if I select text and press Command +, it just displaces the text to the right.
Now, my husband has a USB keyboard. If he connects it to my computer, his regular Command + does not work either, but he uses the extended keyboard, then it works. Unfortunately, he needs it for a musical application which does not work with a wireless keyboard.Firefox 3.6.4 and 3.6.6 use a process called, "plugin-container.exe" which was using up most of my CPU when I opened up multiple tabs that contained Adobe Flash files, and caused Firefox to lock up.
My solution was to use Firefox 3.5.10 which you can get from the Mozilla website at [http://www.mozilla.com/en-US/firefox/all-older.html]
I am using Adobe Flash 10.1.53.64 without any problem in this version of Firefox. Check the release notes, I believe it contains all the latest security fixes in "Firefox 3.6.4".
Hopefully, they will fix Firefox 3.6 in the next version (e.g. Firefox 3.6.7), until then you should probably use "Firefox 3.5.10". -
How to use the bootp_enabled key with dscl command create
During Netboot service configuration I wanted to do it right and followed the suggestions in "System Imaging and Software Update Administration" (page 22):
+"To prevent the NetBoot BootP server from responding to+
+requests for IP addresses, use the dscl command-line tool to open the local folder on the NetBoot server and add a key named bootp_enabled with no value to the /config/dhcp/ folder."+
so I first tried to read the local directory:
xadmin$ *sudo dscl . -read /config/dhcp/*
AppleMetaNodeLocation: /Local/Default
RecordName: dhcp
RecordType: dsRecTypeNative:config
and then to create the key:
xadmin$ *sudo dscl . -create /config/dhcp/ bootp_enabled*
* Uncaught Exception: <NSInvalidArgumentException> ([DSoDataNode initWithDir:value:] value is not a valid NSString nor NSData)
but did not succeed. Somthing must be wrong with the syntax. Tried several (Config, dhcp noslash, bootp_enabled:) but nothing helped.
You dscl experts - please enlighten me!
Btw. Apple why not include to correkt syntax in a manual?worked for me, too
Thanks a lot,
Willi -
Suddenly with version 9 and 10 i cant use the shortcut command of ctrl+shift+t to open the most recently closed tab. a feature used several times a day, previously. This is very Frustrating to me, i have tried looking up a tool keyconfig 20110522 and looked that it says that ctrl+shift+t is the right command, but i still cant use it WHY oh WHY?? if i could get some help figuring this out it would be so awesome, cause i love Firefox, been using it almost daily for the last 10 or so years and i don't intend to switch soon.
Hi,
Please check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode.] This is a temporary diagnostic session and you can exit anytime and start Firefox normally again. This session disables all the '''Extensions''', themes ('''Appearance''') and '''Plugins''' in '''Tools''' ('''Alt''' + '''T''') > '''Add-ons'''.
[http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
[https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
[http://support.mozilla.com/en-US/kb/Uninstalling+add-ons Uninstalling Add-ons]
[http://kb.mozillazine.org/Uninstalling_toolbars Uninstalling Toolbars] -
need to figure out how to remove an unknown admin password on a mac.
used the install disc with not luck. tried some commands in single user mode, no luck.need to figure out how to remove an unknown admin password on a mac.
used the install disc with not luck. tried some commands in single user mode, no luck. -
Why can't a copy a picture from the web in MS word using the available commands?
Ask Microsoft by posting in their forums. Not an Apple product.
Microsoft for Mac Support -
How to exec command with parameters through runtime.exec()
im trying to run a command prompt passing in parameters. Right now im creating a .bat file like this
c:
cd C:\SOMEDIR
ant deploy moreparameters
and then passing in the file name into the exec command. It is running fine but im trying to use the runtime.destroy() command and it doesnt close the ant command, it only closes the bat file which was already closed. Is there a command I could pass into the exec() method to run the ant command with the parameters without using a bat file?im getting a CreateProcess: ant deploy -Dswasm=swasm error=2
When i try to do
cmds[0] = "ant";
cmds[1] = "deploy";
cmds[2] = "-Dswasm=all-bs";
Process p = runTime.exec(cmds, null, new File("C:\\Program Files\\apache-ant-1.6.1\\bin"));
its like it cant find ant. But it finds java command fine. What should i pass into the second parameter, it says "If envp is null, the subprocess inherits the environment settings of the current process. " Does that mean it will take the window system enviroment variables? if not what string would i pass in to set where ant is? -
Saving a pdf file using the print command
I'm having a problem saving a document to pdf using the print command. I'm using an old version of Adobe. it's Adobe Acrobat 6. it is giving me the following error The instruction at "0x775355b2" referenced memory at "0x775355b2". The memory could not be "read". Could someone please help me resolve this issue. Thank you.
The OS and release version of the source file's authoring application have a significant impact on use of Acrobat 6.
For example, Acrobat 8.1 is where Vista support begins.
With MS Office, Acrobat 6 PDFMaker compatiblility is only for Office 97, 2000, XP, and 2003.
Be well... -
Post Author: markeyjd2
CA Forum: Exporting
Greetings forum members,
My question is, in its entirety: Can a single report (rpt file) create multiple PDF files using the export command, ideally one PDF file per DB record?
In my case; I have a Crystal Report that reads data from a DB table containing ~ 500 records. When I export the report to a PDF file, I get one PDF file, with ~ 500 pages.
What I would like to do is export the report to ~ 500 individual PDF files; One file per DB record. The file names would be based on the table's primary key.
Is this possible?Post Author: Micha
CA Forum: Exporting
Hi,
you need some lines of code, but its easy. Dependend on how to start the generation of your 500 PDFs, you can write an ASP page and start it via Web Browser, or a Windows Script and start it via scheduled job...
Here's an abstract of the ASP code I use:
First, you create a recordset (here: "rsc") which gives you the list of ID fields you want to export, then you create CrystalRuntime.Application object, then you loop through the recordset, open your report (here: "oRpt") and set login info. Then set the selectionformula, so that the report displays only the data of the current ID, e.g.:
oRpt.RecordSelectionFormula = "(" & oRpt.RecordSelectionFormula & ") AND {myTab.myVal}=" & rsc("myVal")
Then you export the report, move to the next record in recordset, and repeat the loop until recordset.EOF. Then you close recordset and connection.
Micha -
Do we need a ODI agent to be running for using the startscen command
Do we need a ODI full installation(both server and client) for using the Startscen command or just the client install should be enough. And also do we need a ODI agent to be configured and running for using this StartScen command
ThanksODI client is an agent.
So you don't need to declare one more if not needed on your infrastructure.
But to run odistartscen you need to configure the odiparams.bat with your repository connexion.
If not it will try to connect by default to the demo repostory on HSQL.
best regards,
Brice -
LR V1.2 Having problems using the find Command
Have just recently started using lightroom and so far managing most applications imported a series of photos and after import added keywords to them using the find function I cannot get images to appear. What seems to happen is that in the keyword tag and the folders any of the headings that contain the keyword become active the remainder show a zero no in number of images held in that folder but no images on screen
can anyone assist me
Peterthanks for the reply
have switched of global filters, made sure that using the Find command have set keywords in "text box" and in the "rule box "contains". When I then enter a key word as soon as a type the first two or three letters
a message appears on the screen no "No photos in the selected keyword Tag" Also when you look at the folders which have a series of numbers indicating the photos in the directory the first number in each set turns to 0 with the exception of the folder and sub folder were the images are
So have not managed to make any progress
Peter -
Using 'defaults delete' command with com.apple.dock
I have been using the "defaults" command in my scripts to add an icon to a user's dock after a new application has been installed. But now, I'm having trouble trying to figure out how to remove an icon from the dock using the command line. For adding an icon, I use:
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict>
<key>_CFURLString</key><string>/Applications/NewApp/Program.app
</string><key>_CFURLStringType</key><integer>0</integer>
</dict></dict></dict>'
(take out all the carriage returns and spaces. I had to put them in here for the line to show properly on the post)
This works great for adding an icon. But, I cannot seem to write something similar using "defaults delete"
Any help is appreciated.
Thanks,
-Steve
PowerMac G5 Mac OS X (10.4.7)Hi Steve,
If it froze then the code isn't robust against problems. In this case the problem is the web. The command has four spaces in a row in two of the matches. However, the browser smashes that down into a single space. I never understood that aspect of HTML but I know about it and should have considered it. I will replace the spaces with capital Xs. If you replace the Xs with regular spaces, the command should work:
defaults write com.apple.dock persistent-apps "$( defaults read com.apple.dock persistent-apps | awk 'BEGIN{ ARRAY = "("; ELEM = "" } /^XXXX{/{ while ( $0 !~ /^XXXX}/ ) { if ( ELEM == "" ){ ELEM = $0 } else { ELEM = ELEM "\n" $0 } if ( $0 ~ "_CFURLString\"" && $0 !~ /zzzz/ ){ FOUND = "true" } getline } ELEM = ELEM "\n" $0; if ( FOUND == "true" ){ ARRAY = ARRAY "\n" ELEM }; FOUND = "false"; ELEM = "" } END{ sub( /,[^\n]*$/, "", ARRAY); print ARRAY; print }' )"
In some sense that is poor coding but in the default syntax of the "defaults" command, the only way to determine depth is by how far something is indented. It would have been far more robust to actually count the number of opening parentheses and keep track of the depth but that would have been more complex to code. If I have time, I'll look into changing that.
I assume that the reason the command hung is that it went into an infinite loop. I've also added a carat, '^', in front of the first group of four spaces that will keep that from happening. When typed correctly the command works without it but now it will fail without going into an infinite loop.
Gary
~~~~
United Nations, New York, December 25. The peace and joy of the Christmas season was marred by a proclamation of a general strike of all the military forces of the world. Panic reigns in the hearts of all the patriots of every persuasion. Meanwhile, fears of universal disaster sank to an all-time low over the world.
-- Isaac Asimov -
How do I turn off the alt scroll zoom?
When I'm in Adobe photoshop and illustrator using the pen tool, alt is utilized for another short cut. I would like to use the alt command for the pen tool instead of zooming into the screen.I tend to select things from left to right and every time I am moving in a downward right diagonal motion during lasso selection I am missing a clear view and I am tending to have a more sloppy selection. All this does is slow me down since I need to go back and hit those areas again. The big arrowhead just get's in the way. The original lasso tool with the thin line and small active point at it's lower left was far better for me.
I don't like turning the cursors to precise because I like to see the active tool icon where my cursor is and as the icon changes as I hold modifier keys down. If I am forced to get comfortable with using pricise cursors I guess I will, but man, I've never had to do this in my 15 years of photoshop use...
I would absolutely LOVE to find a way to get the old lasso icon -- without the arrowhead above it.
Is there any chance this option could be inlcuded in cursor preferences? I'd give much thanks, Adobe. -
I’m in the early stages of creating a spreadsheet that will require data entry into the worksheet. The worksheet could get to 1000s of rows, depending on the particular user.
When I refer to the ‘Form Command’ I’m referring to the option of adding a Quick Access Tool bar button by selecting ‘more commands’, ‘all commands’, ‘Form…’
My questions/concerns would be relating to ‘should I develop this spreadsheet with the Form Command or a User Form in VBA?
Concerns/Questions:
Deployment to other users
Protecting worksheet cells so the user can only add records using the form command or the user form in vba. In other words, don’t allow users to edit cells that are not within the table structure of the sheet or add rows if they’re not using the form
Data validation when entering data…
Keith
Keith AulHi,
Both variants have pro's and cons. If you plan to use VBA you have to consider the deployment settings on other p.c.'s where you have to allow macro's where as a regular form doesn't have the need for that.
That said the userform gives you much more control because the form command is not saved. it is simply a temporary form which you have to setup every time. It's perfect for data entry. If you are looking for data validation the userform is the one to go
for. You also have the possibility to work on placements of the data entry.
So if you are looking for speed and simplicity then go for the form command. If it is handling control you are after I'd go for a userform.
Just my 2 cts
Maurice
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. Thank You -
Terminal does something strange when I use the 'say' command
Hello,
I use terminal frequently and have just nocticed something odd. When ever I use the 'say' command it said this:
- -iMac:~ $ say hello
objc[1281]: Object 0x7ffcc2b1ee60 of class NSRunningApplication autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
It doesn't really bother me, but I just want to make sure it is nothing serious
- ThanksCould you describe this in more detail: did Firefox prevoiusly split the image over two pages and now it no longer does that?
Or is the problem that there are two images, and if they do not both fit on the first page, Firefox is not printing the second page?
Some page layouts may not print well when split across pages; there are some longstanding Firefox bugs. If this just started recently, those might not be relevant...
Could you give an example URL of a page that has this problem, and indicate where the cutover is between scale percentages that work and those that no longer work?
Maybe you are looking for
-
Typically, when I have upgraded a program, all of the bookmarks, passwords, etc. have transferred to the newest version but, for some reason that did not happen with Firefox 4. I still have all my preferences files as they were moved to the trash. Is
-
HTTP_RESP_STATUS_CODE_NOT_OK 401 error
Hi, I am doing sender ABAp proxy and receiver Webservice , Proxy is running sucessfully till yesterday but while executing the ABAp proxy 2day i am getting following error HTTP_RESP_STATUS_CODE_NOT_OK 401 error HTTP response contains status code
-
how to fix the CPU PARAMETER to particular user id . Or how to use CPU PARAMETER in BDC .
-
Hello everybody I have a Geography dimension (Country -> State -> City) and 2 related Fact Tables: "Revenues" (with measure Revenue) and "Revenue Goal" (with measure Revenue Goal) and created a dummy measure into the Revenue Fact table (in the dsv)
-
I'm asking why you guys canceled my apple account and I'm wondering when I'm getting my account back
I'm asking why you guys canceled my apple account and I'm wondering when I'm going to get it back.please I need it