Is it possible to be rolled up under certain conditions to a SQL script file?

Hi guys,.
Happy Monday to you all. I have a scenario where I'm queue of 2 files in the same SQL program. Here's what it looks like. Would it not be possible to only of coil for test1 - & p_job_id... SH if & p_file_num = 1 & test2 - p_job_id... SH if & p_file_num = 2?
define p_user_id = &1
define p_job_id = &2
define p_file_num = &3

spool test1-&p_job_id..sh

select
'module_id=''TEST001C1''
from job_parameter b, job_parameter a
where a.job_id = &2
and a.module_id = 'TEST001'
and b.job_id = a.job_id
and b.module_id = a.module_id
and &p_file_num = 1
/

select 'exit 0'
from dual
where &p_file_num = 1
/

spool off


spool test2-&p_job_id..sh

select
'module_id=''TEST001C2''
from job_parameter b, job_parameter a
where a.job_id = &2
and a.module_id = 'TEST001'
and b.job_id = a.job_id
and b.module_id = a.module_id
and &p_file_num = 2
/

select 'exit 0'
from dual
where &p_file_num = 2
/

spool off
Published by: Raj404261 on June 29, 2009 09:47

Hello

Raj404261 wrote:
Hi Frank,.
Thanks for getting back to me. You were right about the "set." Regarding:

spool test&p_file_num-&p_job_id..sh

Do the above however would always generate two files I think. I should have mentioned that I'm passing p_file_num from a shell script which is initialized to 1 or 2 based on an if condition.

In layman terms, I want to only generate test1 test2 and if p_file_num = 1 if p_file_num = 2. Does that make more sense?

Exactly what did the SPOOL command above. If you seem to be getting different results, make sure that you delete all existing files with the same names before testing.
If there isn't that one order of the COIL (excluding SPOOL OFF, naturally), while a single file will be opened. Do not close the file until you are finished.

Or you can consider having two secondary scripts, called my_file_1.sql and my_file_2.sql, each opens one of the SPOOL files and manages one of the queries.
In your main script, call one or the other saying:

@my_file_&p_file_num..sql

Published by: Frank Kulash, June 29, 2009 10:35

Tags: Database

Similar Questions

  • Under certain conditions allow a Feedback

    We use integrated installation of APEX flow back. We love this feature but, we will only use it in development. Is that anyway, apart from the use of JavaScript to hide or remove the link, we can have this under certain conditions depending on the environment in which the application is running?

    I know we can go turn off in the properties of the Application, but we have a ton of environments and having to manually press this switch whenever get us a new version of the application becomes tedious. I expect something more by program / data driven. For example, is it possible to return this switch integrated with PL/SQL?

    Thank you

    -Joe

    Create a compilation Option. In the development environment has defined the status on Includeand by default on export to exclude.

    Apply the Option to build on the entry page and the navigation bar of your comments. When the application is imported into a different environment the comments link and the page will not be returned.

  • Under certain conditions create script

    Hi, I want to put a redirect code in my stsytem to help, it is possible to build under certain conditions one < script type = "text/javascript" > tag?

    Any help would be great appricieated

    oooo and meta tags as well!

    You are wanting to add a Javascript within a topic and then conditionalise it so it appears only in some outings? If so, check out this part of the aid for the addition of scripts. Once it is in, you should be able to add a tag of conditional compilation to exclude required results.

    I'm not sure you can conditionalise however meta tags. Maybe if you elaborate a bit on what you're trying to reach.

  • imaqReadAVIFrame retrieves the empty image under certain conditions?

    Hello

    I'm having a problem where imaqReadAVIFrame (.) is the white recovery (all black images) under certain conditions.  The conditions seem to be when the height of the AVI file is equal to or greater than the width and the height is an odd number.  AVI files created by using the various AVI NI Vision (IMAQ 4.6.1, IMAQdx 4.6.1) functions in an application created in CVI 2012 on a computer running Windows 7 64 bit.  AVI files use MJPEG compressor, and they play back fine in an external program like VLC or Windows Media Player.  Any ideas on what this could be?  My solution for now is to not to allow the creation of AVI files where the height is odd and equal to or greater than the width that is not a boring restriction, but it seems like there's something weird happens with imaqReadAVIFrame().  I can provide some AVI files if necessary, but they are 16 + MB each.

    TStanley,

    I managed to reproduce what you see with your .avi files in a program I wrote.  I built a LabVIEW program that creates an AVI file which can be saved to memory and then uses code from the example finder to read who created the file.  I build the file to your specifications at the height is greater than the width, and the height being an odd number of pixels.  Something interesting about this, however, is that it seems to be a point where an odd height is acceptable.  Once you go below the height of 291 pixels, any odd height then works.  The files that I used are written as read in LabVIEW, but that the configuration should be irrelevant because we are seeing the same issue.  In addition, LabVIEW and LabWindows CVI calling the same dll to actually set up the code.

    In this, I think this question arises from the nature of the way you compress the. AVI file.  If you are interested to read a bit more about it, a useful link can be found here:

    http://www.manifest-tech.com/media_pc/avi_formats.htm

    However, what I think is happening, is it that MJPEG file compression format translates into creating files that cannot be read by our software unless the height in pixels is a multiple of 2 or the size of the file is below a certain limit.  To fix that, there is a simple solution. Compress the file with any of the other compression methods available (DV video, Cinepak Codec, codec Intel IYUV, Microsoft RLE, Microsoft Video) and you will be able to open the file without the black screen.  This worked for me and should solve all your problems.  I hope this gives you a bit of insight.

    Kind regards

    Keith M

    Technical sales engineer

  • How can I add a page under certain conditions?

    Hello

    I'm trying to find a way to add a page to my form under certain conditions. I tried to create this sequel to 'action', but failed to locate the correct action.

    To sum up, I am trying to add a separate page to my existing form with instructions when a specific check box is selected. The separate page is text only and does not form any entries/field. Is there a relatively simple way to accomplish this task?

    You can enter the code in the script editor. If you do not show you can get it by pressing on (on PC) Ctrl + Shift + F5.

  • Call of from.mxl under linux .sql script file

    Hello Experts,

    I have a requirement to call the sql script in the maxl file in the linux server. I get EOF file error.

    Could you please say how to achieve this requirement.

    MAXL Script:

    Reel to ' / / essbase02//MaxL//Test_MR.log ';

    the value of message level.

    Set timestamp

    echo 'start logging ';

    login "admin", "password" on 'server '.

    echo "beginning of sh execution."

    MSH ' / / essbase02//MaxL//Test_MR.sh';

    / * Create label * /.

    echo "Completed";

    disconnection;

    spool off;

    Contents of the Test_MR.sh file:

    sqlplus-s user@orcl/password @"' / / essbase02//MaxL//TEST.sql '"


    Journal for the maxl:

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    'Start of logging.

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    MAXL > login "admin" "admin" on "server1.hq.emirates.com";

    OK/INFO - 1051034 - [admin@Native Directory] user connection.

    OK/INFO - 1241001 - connected to Essbase.

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    "Beginning of HS performance."

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    MAXL > sqlplus-s user@orcl/password @ "/ essbase02/MaxL/TEST." SQL ".

    2 >

    3 >

    4 >

    essmsh error: end of file breaks the statement

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    "Completed".

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    MAXL > disconnect;

    The user admin is offline

    essmsh timestamp: Wed Aug 5 23:17:35 2015

    Thank you

    RM

    If you want to execute operating system commands you use Shell, not "msh". MSH is to call an additional MaxL script with MaxL orders only.

    Optionally, there should be no need to store the command shell in a separate file, that is, it should be possible to place the command sqlplus directly inside the MaxL script when you use the Shell.

  • hide the text label in the section report IR under certain conditions

    Hello
    We have a textlabel and a calculated field in a section of report to the IR 11.1.2.1. Is it possible (in a script) to hide the textlabel and field based on certain conditions, like for example, if the field computes to 'zero '?
    Thank you.

    Use a field instead of the text label. In the Expression Editor you can use the function if() {} else {}

    HTH

    Wayne

  • How to hide and reveal content under certain conditions?

    With the help of Acrobat X Pro.

    I have a load of text on a form I want to obfuscate in certain circumstances and to reveal to others.

    I tried to use a text box and put a script in the custom format field to switch between white and transparent fill colors, but it does not work reliably.

    In the meantime, I have a hack with a gazillion overlapping of checkboxes... but there must be a better way.  I can't change the underlying text for various reasons.

    Thanks in advance for any help.

    You can use several read-only buttons that all have the same name and can show/hide them all with a single statement by controlling their visibility:

    getField("cover").display = bYourVar? Display.visible: display.hidden;

    Where the "cover" is the name of the buttons and the bYourVar is a variable which is true when you want that text to be hidden and false when you want to the text to display.

    You can show/hide text by placing it on a separate layer (BCG) and control the visibility of the layer via JavaScript, but setting this up is not possible in this case, given your current constraints on editing.

  • Under certain conditions add value in table

    Hi all

    I have two tables 2D of the string data in my VI (taken from the .mdb using ADO & SQL file). The "Window list" table on the left, that's what I want to add values to. The 'List of glass' table on the right contains the values that I want to add to the main table according to the values in other cells.

    For example:

    1 component ID window are 2191 and 2001. Under the thickness of the component 1/component 2 in the table "window list", I would add the thickness appropriate for stream ID 2191 and 2001 table "list of glass".

    Here's a snip of the two tables in question.

    This should be simple enough, but as I am a rookie LV I am not very well how to do.

    Thank you very much

    Laura

    Joint must be what you want.  Let me know if you have any other questions.

  • Images do not appear in the preview pane in Windows Explorer under certain conditions

    I use Win 7 Prof - under Display Options in Windows Explorer, I have pictures (not "icons"). The pane is open.

    If I open a folder in Windows Explorer by double clicking the folder icon on the desktop, the preview pane works very well, showing the content of the image.  However if I navigate to a folder by using the folder tree pane in the Explorer Win itself, the preview pane does not display the pictures when you click on the image file.

    However, this problem occurs only for photos, as there is no problem of visualization of the contents of other files, such as Word, Excel, PDF, etc.

    Thanks for your advice. However, as a result of someone of another tip, I restarted in safe mode, and then again in Normal mode and the problem disappeared.

    What was the problem, I don't know, but it can help someone else, if the race in the same thing.

    Kind regards.

  • under certain conditions allow the update of an item in 10g

    Hi all, I'm a total newbie to Oracle forms and I need to develop a base of to display the data in a table.

    The logic that is needed is to allow the update one field and that too that it has one of two possible values.

    For example, consider the following two documents:

    Record 1:

    Name: Naren

    Status: NEW REQUEST

    Sheet 2:

    Name: Ravi

    Status: REQUEST for CONVERSION


    Only the status of the file 2 column can be updated on the "PROCESSING REQUEST' to 'NEW APPLICATION'.

    I create a list box to the Status column with values of TREATMENT of DEMAND and the NEW REQUEST.

    But that allows me to update the status of 'PROCESSING REQUEST' to 'NEW APPLICATION' and 'NEW APPLICATION' to "SEEK treatment".

    I want to enable the update of status only when its value = "PROCESSING REQUEST"

    Can someone help me please? Maybe that trigger to use.

    Thank you.

    Your code is wrong.

    IF: UP_TEM_PAYCARD_REQUESTS. STATUS <> 'TREATMENT of the REQUEST' THEN

    SET_ITEM_INSTANCE_PROPERTY('UP_TEM_PAYCARD_REQUESTS.) STATUS, UPDATE_ALLOWED, PROPERTY_FALSE);

    END IF;

    SET_ITEM_INSTANCE_PROPERTY accepts FOUR arguments (take a look at the online help.

    Plan to retry the EXCHANGE WHEN LIST and POST-QUERY-approach with the correct code.

  • Update on the table by extracting the data from the table even under certain conditions

    Hi Experts,

    I have the table EMP which currently has 6 entries.

    EMP_SYS BATCH_NO JOIN_DATE LOGIN_ID STATUS FLAG

    1 FEBRUARY 10 PROD 84 Y IND123 ABC

    DEV 1-23 APRIL 98 Y IND123 ABC

    2 12 APRIL PROD 98 Y IND123 ABC

    2 2 APRIL DEV 98 Y IND123 ABC

    3 13 APRIL PROD 98 Y IND123 ABC

    3 3 APRIL DEV 98 Y IND123 ABC

    CONDITION: I need to take lines which has the minimum BATCH_NO for each of the EMP_SYS

    for example,.

    1 FEBRUARY 10 PROD 84 Y IND123 ABC

    DEV 1-23 APRIL 98 Y IND123 ABC

    For the above two lines, I need to update the status of DEF. How to select this criterion and update in the same query?

    Currently, I used the query to select the minimum BATCH_NO for each of the EMP_SYS below.

    SELECT EMP_SYS, BATCH_NO, JOIN_DATE, FLAG, LOGIN_ID, STATUS

    Of

    (

    EMP_SYS, BATCH_NO, JOIN_DATE, FLAG, LOGIN_ID, STATUS, SELECT ROW_NUMBER)

    COURSE NR (PARTITION BY ORDER OF EMP_SYS OF EMP_SYS)

    FROM EMP

    WHEN STATUS = 'ABC' AND FLAG = "Y".

    )

    WHERE

    NR = 1;

    If I try to use the update on the above query statement... It updates every 6 rows instead of 2 rows.

    Please suggest me a way to update only the two lines that has the minimum BATCH_NO for each of the EMP_SYS.

    But is possible to write the query without using the Group of?

    Update e EMP

    set STATUS = "DEF".

    where BATCH_NO = (select min (BATCH_NO) from EMP I where STATUS = 'ABC' AND FLAG = 'Y' and i.emp_sys = e.emp_sys)

  • Java components installed to the AAU can be called under certain conditions?

    Hi all

    I developed a java component to unzip a file and documentation of all the files and folders individual in Complutense University of MADRID when a zip file is recorded.
    Once the component is installed, it works as expected and it is invoked and executed when a zip file is recorded.
    So, if:
    -Connection at the University Complutense of MADRID, navigate to a folder and run New-> new content and archiving of zip, the component file is called and executed.
    -Use the integration of desktop and drag-and - drop or copy-and - paste a file zip, the component is called and executed.

    Is it possible to call the component only when integrating office is used and not to invoke the component when
    the user connects via the AAU homepage? OR even if the component is called, y at - it a setting that I can query (using binder.getLocal) that would help me to determine if it is invoked by the integration of office or via UCM Homepage

    Thank you
    Benhamdia

    As others have said, you must empty the DataBinder by a binder.toString (). You can see all the variables and what are those which may indicate WebDAV / TELL.

    I think that some variables WebDAV / SAY can be as follows:
    WebdavRequest
    IS_WEBDAV_REQUEST
    WebdavSessionID

    Jonathan
    http://redstonecontentsolutions.com
    http://corecontentonly.com

  • Under certain conditions of popuId showPopupBehavior change

    Is it possible in JDev11gR2 to change the showPopupBehavior based on condition, popupId as if Master.FieldA is a popupId then: EditA popupId else: EditABC

    According to the literature, popupId attribute supports the expression language, it should be possible. Use something like #{Master.FieldA == 'A'? {"EditA": "EditABC"}
    http://download.Oracle.com/docs/CD/E15523_01/apirefs.1111/e12419/tagdoc/af_showPopupBehavior.html

    Pedja

  • Configuration of the loops in LabVIEW to return to the beginning under certain conditions of CRC calculation

    Hey gurus of LabVIEW,.

    Well, I recommend also move your file in writing to be inside the loop, more precisely inside the TRUE (I could bad told you before).  If the CRC was released in 0, do you all the processing, otherwise do nothing.  Then the next iteration.  By moving the file i/o inside the loop, you're avoiding accumulate huge berries (IE a lot of memory).

Maybe you are looking for