Is it possible to call a file sql in a pl/sql block

Hello

I want to call a file sql in a pl/sql block.

the pl/sql block has an exception handler. The pl/sql block runs the sql file and where it throws error then the exception handler will take care of it.

The sql file will be a master file and he will himself call other sql files.

is it possible to call any pl/sql block sql file?

When you say "sql file", what exactly do you mean? You have a file that has just SQL statements? Or you have SQL * more scripts?
Where are the files stored? They are on your client machine? Or the database server?

"that in turn calls the other sql files ' seems to imply that the answer to the first question is that you have SQL * scripts more. If you have SQL * more scripts, you need SQL * more to execute. PL/SQL runs in the database Oracle, SQL * more is a client application. It is not practical to have the PL/SQL call SQL * more. Since you have already excluded from the best of bad options, it seems that the answer is no, you cannot have your PL/SQL, run these files.

As Alex, it's probably a good thing. It seems that your application has been designed incorrectly. If you need PL/SQL, you must be to create stored procedures and functions, and calling those of PL/SQL. Have the PL/SQL depend on the code in flat files outside the database is not a good idea.

Justin

Tags: Database

Similar Questions

  • Call the file sql plsql

    Hello
    I'm stuck for several days in this issue. Hope someone help me.

    I'm using Oracle 11.

    I am writing a utility to purge the data from the database based on certain criteria.
    We do not have physical (actual) the partitions present on our system (since we do not use Enterprise edition).
    We have 57 paintings representing 57 partitions. Then, we create a view of all of these 57 tables-

    CREATE or REPLACE VIEW MY_VIEW AS
    Select [column_names] from table1
    UNION ALL
    Select [column_names] in table2
    UNION ALL
    Select [column_names] in table 3
    UNION ALL
    :
    :
    :
    Select [column_names] of table57
    ;

    This superior query is saved in the 'body' of user_views.

    Now when a user wants to delete a partition-
    -I read the body of the request in the .sql file.
    -Edit the .sql file that is, remove the unwanted ' select * from many '
    -Loss of vision.
    -Recreate the view from the edited .sql file.


    The question is in the creation of the view on the fly of the procedure-
    -I'm not EXECUTE IMMEDIATE 'CREATE VIEW... ' and ' DBMS_SQL. PARSE' the request body exceeds 32,767 characters.


    So I chose the option of filing to write. In the file, I write the query VIEW and then I want to create the view from this file.

    Now, I'm not able to call the .sql that contains
    CREATE OR REPLACE VIEW MYVIEW AS
    Select...
    UNION ALL
    Select...
    :
    :
    Select...

    Length of character of this file is about 90000.



    Please guide me in this issue.
    Any new idea to manage very large display in the long term is also welcome...


    Thanks in advance
    Micheline
    ARGE view at run time is also welcome...


    Thanks in advance
    Micheline

    When you use DBMS_SQL, the declaration must not end with a semicolon, or you will get ora - 911.

    ---------
    Sybrand Bakker
    Senior Oracle DBA

  • Call a pl/sql package unix script

    Hello

    With the help of 11.2.0.3 on AIX.

    Is it possible to call the pl/sql package unix script?

    I am cretaing a file in a directory but would like it to automatically write to a directory to archive as well.

    Could use either 2 utl_file.put_lines to 2 separate directories or 1 utl_file and cal script to archive files in another directory. ?

    Thoughts?

    Thank you

    user5716448 wrote:

    Thoughts?

    Use UTL_FILE. FCOPY copy the file you created in the directory of the archive.

    SY.

  • Call the PL/SQL procedure with in out parameter of OIC clob

    Hello

    For a few days, I am facing a problem. I have to call the pl/sql procedure with colb parameter out. I use c ++ and OIC (don't ask me why :)).

    I use a pl/sql problem test procedure:

    create or replace function Test (longField outside clob) return number is
    Number of result;
    Start
    longField: = 'prefix ';
    Result: = 12;
    Return (result);
    end Test;

    So I do all the stuff with the connection to the DB,

    I prepare the statement: "start: res: = test(:param); end; »
    So I OCIHandleAlloc (m_pCtx-> hpEnv,
    (void *) & m_hpStatement,.
    OCI_HTYPE_STMT,
    0,
    (NULL);
    and
    OCIStmtPrepare (m_hpStatement,
    m_pCtx-> hpErr,
    (...),
    (...),
    OCI_NTV_SYNTAX,
    OCI_DEFAULT);

    Before the binding I prepare parameters. For a clob I devote to the lob Locator:

    OCIDescriptorAlloc ((dvoid *) m_pCtx-> hpEnv, (dvoid *) & m_pLobLocator,)
    (ub4) OCI_DTYPE_LOB (size_t) 0, (dvoid *) 0);
    OCILobEnableBuffering (m_pCtx-> hpContext, m_pCtx-> hpErr, (OCILobLocator *) m_pLobLocator);

    that I bind parameters using OCIBindByName and OCIStmtExecute statement execution.

    I get an error
    ---------------------------
    Microsoft Visual C++
    ---------------------------
    Unhandled exception in... (ORAOCIEI11. (DLL): 0xC0000005: Access Violation.

    My question is: is it possible to call the pl/sql procedure with parameter BEAK clob?
    If Yes, what steps I need to do to succeed?

    Thank you for your response.

    Hello

    Of course, it is possible :)

    Show that you are your piece of code that is binding.
    Are you sure you had correctly the lob descriptor in the call to bind?

  • Where the conditional, or PL/SQL block as a source for an interactive report?

    I have this situation: my app's main screen displays a list of documents. For now, there must be a quick way to 'security' integrated, so that administrators can see all documents, but only other users can see what documents, they created (connection of the creator is stored in the table of documents). In the future we will use probably VPD to enforce certain rules, but for the moment we need a quick solution.

    So I stored administrators in a separate table. Now I want the interactive Act report on the homepage as follows:
    -If an admin is connected, it must have this query: select field 1, 2, 3 area in documents
    -For all other users: select the field 1, 2, area 3 documents where creator =: app_user

    Is this possible in a single interactive report? I could do two reports with different queries, and make conditional depending on who is connected, but this gives me two interactive reports to maintain. Is it possible to use a PL/SQL block as a source for the report? I tried, but I get a syntax error. Is it possible to do where proviso on somehow?

    Hello

    Install the demo application to your workspace:
    Home > create an Application and select Demo Application.

    Check page 1 interactive report. This should give idea how.

    BR, Jari

  • Is it possible to call a script of a speech file?

    Hi all

    TL; Dr. to access the tops of path with the expression does not seem possible, but can script, so is it possible to do it by calling a script inside the expression file?

    My goal is the number of vertices in path objects and use this value in an expression. The expression is the engine of offset property with a filling of the trajectory and the expression use a relative naming so that I can copy the path trim to 500 other groups of shape layers and have a different effect (speed of the offset) for each group according to the number of vertices of each path.

    I looked for a solution to this problem for some time now, and my conclusion is that you simply cannot access the tops of path with the expression, that the path is in a mask or a shape layer.

    Is this correct?

    With a mask on a solid layer and effects scripts guide after I should be able to:

    thisComp.layer("Black_Solid_1").mask ("mask 1") .maskPath .value

    or

    thisComp.layer("Black_Solid_1").mask ('mask 1'). maskPath.value .vertices

    or

    thisComp.layer("Black_Solid_1").mask ('mask 1'). maskPath.value.vertices .length

    I also tried:

    thisComp.layer("Black_Solid_1").mask ('mask 1'). maskPath.vertices .length

    and so on...

    But when you debug it with the source text of a text layer, I only get "undefined" for the value and errors for other expressions (' named 'summits' in class 'Property' property is missing or does not exist ").

    I am sure that these are the correct methods because many scripts use those, including:

    http://Omino.com/pixelblog/2008/12/25/AE-mask-vertices-from-Extendscript/

    http://www.crGreen.com/aescripts/actual_scripts/Connect_Point_to_Mask_Vertex.jsx

    http://aescripts.com/maskvertexexpression/

    So if it is not possible to directly access the berries of way by the expression, I thought the appellant, in every expression, an external script which would then return the number of vertices, there are in each table. It would look something like this (pseudo code):

    arrayLength =.content("Path_1").value.vertices.length content (.name thisProperty.propertyGroup (2))

    return arrayLength

    And then use the value I get the script to adjust speeds in my expressions:

    Time * arrayLength * thisComp.Layer ("Controller"). Effect ("Speed") ("Slider")

    Therefore, it is possible to call a script inside an expression file? How?

    If this isn't the case, you have any other suggestions?

    Thank you.

    Reference: After Effects Scripting Guide, page 172 CS6.

    You can use $. evalFile() to run an external file, but it will be executed by the expression engine, not script, so I don't think that helps you. I don't think that there is an automatic solution. I think you're stuck with manually executed a script once you modify the project for updating a cursor somewhere with the number of vertices.

    Dan

  • Calling batch file. SQL file with parameters

    Hi all:

    I may / may not have correct code, because I can't find a Google result for answering the question and cannot test this solution until it goes live, so I want to make sure I have it correct.

    I have a batch (file1.bat) file that implements some variables. Inside this file, I call a .sql like this procedure:
    sqlplus username/password@environment @c:\sql\export.sql cID %%d sID % % exportFilename %

    How do I use these settings within the export.sql so they are passed to the oracle procedure?

    I am currently using the following code:
    BEGIN
    sinterface. Export (1, 2 & 3);
    EXCEPTION
    WHILE OTHERS
    THEN NULL;
    END;

    This code will work? I know that if I call another code file1.bat .bat file, I can get the settings such as:
    SET of cID = %1
    SET sID = %2
    SET exportFileName = %3

    OR

    SET CompID = compID %
    SET SiteID = siteID %
    SET exportFileName = % exportFilename %

    But I have no idea if / how this translates an oracle .sql file to call a stored procedure. I got a result of Google to show using the & 1 & 2 & 3 to set the parameters of this batch file, but as I can't test it, I have no idea if it would work.

    Anyone would be able to confirm the correct method?

    Thank you
    Andy

    Andy,
    Welcome to the Oracle Forums. Please take a few minutes to review the following:


    This forum is for general issues Oracle Forms. Please post your question in the forum SQL and PL/SQL . If you have a general question of forms, by all means, ask it here! ;-)

    That said, you asked...

    How do I use these settings within the export.sql so they are passed to the oracle procedure?

    I am currently using the following code:

    BEGIN
    sinterface.export(&1, &2, &3);
    EXCEPTION
    WHEN OTHERS
    THEN NULL;
    END;
    

    Since you simply call a Script SQL of your batch file file is not really necessary to use an anonymous block to call your stored procedure. In addition, as you use the OTHER generic exception - you never know if there was a mistake. Really, you shouldn't use SO that OTHERS value NULL. This isn't a very good programming practice. As for your variables, I would recommend that you set the substitution variables in your script and set your settings to access these variables. For example:

    DEFINE c_id = &1 (CHAR)
    DEFINE s_id = &2 (CHAR)
    DEFINE f_name = &3 (CHAR)
    
    Execute sinterface.export(c_id, s_id, f_name);
    

    I would not include an exception handler at this level that any exception must propagate to the calling program.

    Craig...

  • [HELP] How to open a file / call the file manager to open a txt file

    Hello. I saw nothing in the docs how to proceed. I want my application to call the file manager to open a txt file. Or any file I want. How is that possible? Please, I beg you.

    Thank you. But also, it does not solve my problem.

    I solved it with that.

    Application of InvokeRequest;
    request.setTarget ("sys.installhandlerui");
    request.setAction ("bb.action.VIEW");
    request.setUri ("WAY OF THE APK FILE");
    invokeManager-> invoke (request);

    I wanted to open an APK file to install it. I discovered that the target for the installer of the APK is sys.installhandlerui

  • Calling a PL/SQL of BPEL function throws the fault.

    Hi, I'm calling a PL/SQL function that inserts data into a table from a BPEL via the DB adapter. The process, when I test it, get an error runtime as follows:

    * Exception occurred when the link was invoked. Exception occurred during invocation of the JCA binding: "JCA binding run operations reference 'EmpRegister' have to: connection problem component binding JCA.". JCA Binding component is unable to create an outgoing connection of JCA (CCI). AddEmployee:EmpRegister [EmpRegister_ptt::EmpRegister (InputParameters, OutputParameters)]: The JCA Binding component could not establish an outbound connection of JCA CCI due to the following problem: BINDING. Error of JCA - 12510 JCA adapter localization resources. Cannot find the adapter in JCA resources via the element of the binding .jca file <-factory connections / > The JCA Binding component is unable to startup of the resource adapter that is specified in the <-factory connections / > element: location = ' EI/DB/DBConn_215. The reason is most likely that 1) the resource adapter RAR file has not been deployed successfully to the application server WebLogic or 2) the element '< jndi name >' in weblogic - ra.xml has not been set to eis/DB/DBConn_215. In the latter case, you need to add a new factory of connections from WebLogic JCA (deploy a RAR). If please fix this and then restart the application server". The called JCA adapter threw an exception of resource. Please examine the error message above carefully to determine a resolution.*

    In addition, the error description was that follows a s:

    * Error JCA adapter localization resources. Cannot find the adapter in JCA resources via the element of the binding .jca file <-factory connections / > The JCA Binding component is unable to startup of the resource adapter that is specified in the <-factory connections / > element: location = ' EI/DB/DBConn_215. The reason is most likely that 1) the resource adapter RAR file has not been deployed successfully to the application server WebLogic or 2) the element '< jndi name >' in weblogic - ra.xml has not been set to eis/DB/DBConn_215. In the latter case, you need to add a new factory of connections from WebLogic JCA (deploy a RAR). Please fix this and then restart the messagerie.* Application Server

    I know, it looks like a mistake to JCA adapter, but when I do a synchronization of the table DB to DB with this factory of connections, no problems occur. Is there any procedure I should follow when mapping the input with db schema data?

    you update the JNDI name that you used ' ÉI/DB/DBConn_215' in weblogic - RA.xml file DbAdapter.rar @ weblogic_home\Oracle_SOA1\soa\connectors with the correct as data source


    xADataSourceName
    JDBC/scottdb (your Datasouce jndi name)

    and you need to redeploy this .rar file updated.

  • Is it possible to remove a file from your time Machine?

    Is it possible to remove a file (s) from your time Machine?  When I tried, I got a pop up says that backs up the items cannot be changed. How do you get the room on your Time Machine disk?

    Time Machine takes care of its own needs of storage itself, without interfere you in the process. When the TM drive is running out of storage space, TM will remove older backups if necessary.

    Time Machine backups are very sophisticated in what is backed up at what time. It is not as simple as just delete the backups 'elders '. Let TM its magic in itself.

  • Is it possible to store my files only on the reader to iCloud without storing them on my local HD?

    Is it possible to store my files only in iCloud drive without saving them to my local hard drive?

    iCloud Drive is not intended to replace your HARD drive or backup to the backup drive. It should be used with documents iWork and iDevice.

  • How to create ProcessModel calculate TOTAL as follows to call the file in the sequence?

    I made a custom operator Interface and I want to support a progress bar for giving the user indicates to what extent this time they represent.   I already have the infrastructure of reminder Setup so that the progress bar will be updated based on a Message from the user of the motor.

    In the process template itself, I put in place a "ProcessModelPostStep" (the purple one) reminder so that after all the steps of the calling sequence file I increment an internal counter and send these data as well as the Message of the user.

    The only missing part is to know how to calculate the TOTAL number of steps in the sequence file calling.  I can get the total number of SEQUENCES defined in the calling file but I how to recursively on each sequence loop excluded from top down by counting all the steps of the sequence of the callee.

    Appreciate any help in getting this last piece in place.

    Thank you!

    I have a better solution in the images below.  The code snippet is the code called by TestStand to introduce recursion.

    The attached code is the recursive call.  It is similar to my first post, but the fixed a bug with the cast of references.

    This should get the total number of step.  The code works under some assumptions:

    1. all called sequences are in the same file in sequence.  (You can add steps to also get the path to the movie file and retrieves the sequence from there.)

    2. There is no asynchronous LabVIEW step in TestStand.  (These are treated as sequence calls into the API, and you must add code to sort.)

    Pulido Technologies LLC

  • Is it possible to open the file on communication to labview design in labview?

    Is it possible to open the file on design Communication Labview in Labview? If yes how.

    Thank you

    No, unfortunately it is not possible.

  • is it possible to use a file refnum as mathscript node entry

    Hello world

    I started using the LV and mathscript recently. A problem confuses me a lot.  It's

    Is it possible to use a file refnum as the entry or exit of the mathscript node? A picture is attached for your reference.

    Thank you very much!

    Gary

    What would you hope to do with the reference?  The Mathscript node is not a file of reading ability.  You must read the file and transmitting the data in the Mathscript node.

    EDIT: I was wrong.  You must use the functions fopen and fclose inside the MathScript node to be able to read a file inside.

  • Is it possible to copy my files to a USB stick and use it as a backup?

    * Original title: computer problem

    Hi guys, first of all excuse my English because it is not my natural language. My problem is this: I think that my office is stressful on me. It's freezing and sometimes it does not start. I'm trying to back up my files, but I'm not. Is it possible to copy my files to a USB stick and use it as a backup? If so should what files I back up? Is it possible to do a reinstall? I have a Dell OptiPlex 745 with windows vista ultimate. Any help would be welcome.

    Kind regards

    Leslie

    Hello

    How to make a backup of files:

    Go to the file/s you want to put (Documents, music, Photos, etc. in Windows Explorer) > right click on it/them > hover over send it to the mouse cursor > select external hard drive or Memory Stick that you plugged them to save.

    And it's method of Dell to backup your data and reinstall of the operating system:

    Restore your Computer´s software to factory for Windows Vista settings

    http://www.Dell.com/support/article/au/en/aubsd1/SLN117599?c=au&l=en&s=BSD&CS=aubsdt1

    See you soon.

Maybe you are looking for