Search Results

Search found 2576 results on 104 pages for 'mod plsql'.

Page 15/104 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Running pl/sql in Korn Shell(AIX)

    - by learner135
    I have a file to execute in Ksh written by someone. It has a set of commands to execute in sqlplus. It starts with, sqlplus -s $UP <<- END followed by a set of ddl commands such as create,drop,etc., When I execute the file in the shell, I get the error in the starting line quoted above. I understand "-s" starts the sqlplus in silent mode and $UP is the connection string with username/password. But I couldn't make heads or tails of "<<- END" part(Many sites from google says input redirection is "<<" not "<<-"). So I presumed the error must be in that part and removed it from the file. Now it reads, sqlplus -s $UP But once I execute the file, It waits for input from the shell, instead of reading the rest of the lines from the file. How would I make sqlplus to execute the ddl commands in the rest of the file?. Thanks in advance.

    Read the article

  • PL/SQL Package invalidated

    - by FrustratedWithFormsDesigner
    I have a script that makes use of a package (PKG_MY_PACKAGE). I will change some of the fields in a query in that package and then recompile it (I don't change or compile any other packages). I run the script and I get an error that looks like ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package body "USER3.PKG_MY_PACKAGE" has been invalidated ORA-04065: not executed, altered or dropped package body "USER3.PKG_MY_PACKAGE" ORA-06508: PL/SQL: could not find program unit being called: "USER3.PKG_MY_PACKAGE" ORA-06512: at line 34 I run the script again (without changing anything else in the system) and the script executes successfully. I thought that when I compiled before I executed the script that would fix any invalid references. This is 100% reproducible, and the more I test this script the more annoying it gets. What could cause this, and what would fix it? (oracle 10g, using PL/SQL Developer 7)

    Read the article

  • SYSDATE - 1 error on pl/sql function

    - by ayo
    Hi curtisk/all, I have an issue: when i issue this function below ti gives me the following error: select 'EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME =>'''||name||'''||,OPTIONS=>DBMS_LOGMNR.NEW);' from v\$archived_log where name is not null; select 'EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME =>'''||name||'''||,OPTIONS=>DBMS_LOGMNR.ADDFILE);' from v\$archived_log where name is not null; EXECUTE DBMS_LOGMNR.START_LOGMNR( STARTTIME => SYSDATE - 1, ENDTIME => SYSDATE, OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + DBMS_LOGMNR.CONTINUOUS_MINE + DBMS_LOGMNR.COMMITTED_DATA_ONLY + DBMS_LOGMNR.PRINT_PRETTY_SQL); Error: * ERROR at line 1: ORA-01291: missing logfile ORA-06512: at "SYS.DBMS_LOGMNR", line 58 ORA-06512: at line 1 But i have added all the archived logs for several days before and my sysdate is at today. Kindly help out on this issue. thanks. Reagrds Ayo

    Read the article

  • help translate this week query from Oracle PL/SQL to SQL Server 2008

    - by Sarah Vessels
    I have the following query that runs in my Oracle database and I want to have the equivalent for a SQL Server 2008 database: SELECT TRUNC( /* Midnight Sunday */ NEXT_DAY(SYSDATE, 'SUN') - (7*LEVEL) ) AS week_start, TRUNC( /* 23:59:59 Saturday */ NEXT_DAY(NEXT_DAY(SYSDATE, 'SUN') - (7*LEVEL), 'SAT') + 1 ) - (1/(60*24)) + (59/(60*60*24)) AS week_end FROM DUAL CONNECT BY LEVEL <= 4 /* Get the past 4 weeks */ What the query does is get the start of the week and the end of the week for the last 4 weeks. It generates data like the following: WEEK_START WEEK_END 2010-03-07 00:00:00 2010-03-13 23:59:59 2010-02-28 00:00:00 2010-03-06 23:59:59 ...

    Read the article

  • Merging exists and not exists into one query - oracle magic

    - by stic
    Hi, In a WHERE part of query we have SELECT * FROM SomeTable st WHERE NOT EXISTS (SELECT 1 FROM Tab t1 WHERE t1.A = st.A OR t1.B = st.A) OR EXISTS (SELECT 1 FROM Tab t2 WHERE (t2.A = st.A OR t2.B = st.A) AND t2.C IS NULL) Seems like a good candidate for merging... But I'm staring on that for an hour without any idea. Would you have some thoughts? Thanks,

    Read the article

  • How to identify what locked PL/SQL package (Oracle 10.0.4.2)?

    - by Roman Kagan
    I was trying to recompile PL/SQL package and no avail. because something obtained the lock and that wasn't released for long time. As soon as I kill all sessions I was able to recompile but encounter the same behavior (i.e. locked package) and I wonder what tools are avail to identify what could of obtain it and never release it? This happen on (Oracle 10.0.4.2). Greatly appreciate for your help.

    Read the article

  • Concatenate CLOB-rows with PL/SQL

    - by david K
    Hi, I've got a table which has an id and a clob content like: Create Table v_example_l ( nip number, xmlcontent clob ); We insert our data: Insert into V_EXAMPLE_L (NIP,XMLCONTENT) Values (17852,'<section><block><name>delta</name><content>548484646846484</content></block></section>'); Insert into V_EXAMPLE_L (NIP,XMLCONTENT) Values (17852,'<section><block><name>omega</name><content>545648468484</content></block></section>'); Insert into V_EXAMPLE_L (NIP,XMLCONTENT) Values (17852,'<section><block><name>gamma</name><content>54564846qsdqsdqsdqsd8484</content></block></section>'); I'm trying to do a function that concatenates the rows of the clob that gone be the result of a select, i mean without having to give multiple parameter about the name of table or such, i should only give here the column that contain the clobs, and it should handle the rest. CREATE OR REPLACE function assemble_clob(q varchar2) return clob is v_clob clob; tmp_lob clob; hold VARCHAR2(4000); --cursor c2 is select xmlcontent from V_EXAMPLE_L where id=17852 cur sys_refcursor; begin OPEN cur FOR q; LOOP FETCH cur INTO tmp_lob; EXIT WHEN cur%NOTFOUND; --v_clob := v_clob || XMLTYPE.getClobVal(tmp_lob.xmlcontent); v_clob := v_clob || tmp_lob; END LOOP; return (v_clob); --return (dbms_xmlquery.getXml( dbms_xmlquery.set_context("Select 1 from dual")) ) end assemble_clob; The function is broken... (if anybody could give me a help, thanks a lot, and i'm noob in sql so ....). Thanks!

    Read the article

  • PL/SQL Logical Operators evaluate whole function

    - by Chris
    I know in C like languages logical operators are evaluated one at a time so: false && really_expensive_function() is doesn't result in the function being called (I can't remember the CS name for this). Does the same happen in PL/SQL or do I need to break the IF parts out to separate blocks?

    Read the article

  • Parsing pipe delimited string into columns?

    - by DMS
    Hello, I have a column with pipe separated values such as: '23|12.1| 450|30|9|78|82.5|92.1|120|185|52|11' I want to parse this column to fill a table with 12 corresponding columns: month1, month2, month3...month12. So month1 will have the value 23, month2 the value 12.1 etc... Is there a way to parse it by a loop or delimeter instead of having to separate one value at a time using substr? Thanks.

    Read the article

  • Best Way to Generate Unique and consecutives numbers in Oracle

    - by RRUZ
    I need to generate unique and consecutive numbers (for use on an invoice), in a fast and reliable way. currently use a Oracle sequence, but in some cases generated numbers are not consecutive because of exceptions that may occur. I thought a couple of solutions to manage this problem, but neither of they convincing me. What solution do you recommend? Use a select max () SELECT MAX (NVL (doc_num, 0)) +1 FROM invoices Use a table to store the last number generated for the invoice. UPDATE docs_numbers SET last_invoice = last_invoice + 1 Another Solution?

    Read the article

  • Oracle: Use of notational parameters which calling functions in insert statements not allowed ?

    - by Sathya
    Why does Oracle 10 R2 not allow use of notational parameters while calling functions in insert statements ? In my app, I'm calling a function in an insert statement. If use notational method of parameter passing, I get an ORA-00907: Missing right parenthesis error message INSERT INTO foo (a, b, c) VALUES (c, F1(P1=>'1', P2=>'2', P3 => '3'), e) Changing the same to position based parameter passing, and the same code gets compiled with no errors. INSERT INTO foo (a, b, c) VALUES (c, F1('1','2','3'), e) Why is this so ?

    Read the article

  • Upper Bound in FOR loop does not get altered in loop,Why?

    - by Vineet
    Hi ALL, I am trying to change the value of upper bound in For loop ,but the Loop is running till the upper bound which was defined in the starting. According to logic loop should go infinite, since value of v_num is always one ahead of i,But loop is executing three time.Please explain This is the code DECLARE v_num number:=3; BEGIN FOR i IN 1..v_num LOOP v_num:=v_num+1; DBMS_OUTPUT.PUT_LINE(i ||' '||v_num); END LOOP; END; Ouput Coming 1 4 2 5 3 6

    Read the article

  • PL/SQL time segment calculation

    - by Steve
    Hi, I need to figure how much time passed between 2 times. For example: (14:00:00 - 13:15:00) * 24 = .75 I need this to later on convert KW to KWh, but that's not the point. I can not find out how to do this in PL/SQL. My date/time fields look like this in the DB: 1/23/2010 21:00:00 I would appreciate any suggestions. Steve

    Read the article

  • Using 'in' in Join

    - by Ruslan
    i have two selects a & b and i join them like: select * from ( select n.id_b || ',' || s.id_b ids, n.name, s.surname from names n, surnames s where n.id_a = s.id_a ) a left join ( select sn.id, sn.second_name ) b on b.id in (a.ids) in this case join doesn't work :( The problem is in b.id in (a.ids). But why if it looks like 12 in (12,24) and no result :(

    Read the article

  • Passing an array of data as an input parameter to an Oracle procedure

    - by Sathya
    I'm trying to pass an array of (varchar) data into an Oracle procedure. The Oracle procedure would be either called from SQL*Plus or from another PL/SQL procedure like so: BEGIN pr_perform_task('1','2','3','4'); END; pr_perform_task will read each of the input parameters and perform the tasks. I'm not sure as to how I can achieve this. My first thought was to use an input parameter of type varray but I'm getting Error: PLS-00201: identifier 'VARRAY' must be declared error, when the procedure definiton looks like this: CREATE OR REPLACE PROCEDURE PR_DELETE_RECORD_VARRAY(P_ID VARRAY) IS To summarize, how can I pass the data as an array, let the SP loop through each of the parameters and perform the task ? I'm using Oracle 10gR2 as my database.

    Read the article

  • Oracle DBMS_PROFILER only shows Anonymous in the results tables

    - by Greg Reynolds
    I am new to DBMS_PROFILER. All the examples I have seen use a simple top-level procedure to demonstrate the use of the profiler, and from there get all the line numbers etc. I deploy all code in packages, and I am having great difficulty getting my profile session to populate the plsql_profiler_units with useful data. Most of my runs look like this: RUNID RUN_COMMENT UNIT_OWNER UNIT_NAME SECS PERCEN ----- ----------- ----------- -------------- ------- ------ 5 Test <anonymous> <anonymous> .00 2.1 Profiler 5 Test <anonymous> <anonymous> .00 2.1 Profiler 5 Test <anonymous> <anonymous> .00 2.1 Profiler I have just embedded the calls to the dbms_profiler.start_profiler, flush_data and stop_profiler as per all the examples. The main difference is that my code is in a package, and calls in to other package. Do you have to profile every single stored procedure in your call stack? If so that makes this tool a little useless! I have checked http://www.dba-oracle.com/t_plsql_dbms_profiler.htm for hints, among other similar sites.

    Read the article

  • HOw I can verify my SQL / SQL Pl syntax

    - by rima
    Hi all Sorry my English is bad.I hope u can get what I want. I have lots of *.sql files that i want to write a program to compile them and if there is any issue(problem or mistake) report me. One of my friend write an IDE for java,as I remember he use javac to generate the codes error,in other hand maybe u see when u try to write code in a Visual stadio or Netbean the IDE generate errors for u.so now I want to know any one have any idea how I can do it for my sql files? In other mean I want to write a Editor for SQL files(PL/SQL) that compile my code and tell me what is my error. this problem raise up when I try to compile all of them in SQL PLUS,it's so boring. please help me...

    Read the article

  • Passing BLOB/CLOB as parameter to PL/SQL function

    - by Ula Krukar
    I have this procedure i my package: PROCEDURE pr_export_blob( p_name IN VARCHAR2, p_blob IN BLOB, p_part_size IN NUMBER); I would like for parameter p_blob to be either BLOB or CLOB. When I call this procedure with BLOB parameter, everything is fine. When I call it with CLOB parameter, I get compilation error: PLS-00306: wrong number or types of arguments in call to 'pr_export_blob' Is there a way to write a procedure, that can take either of those types as parameter? Some kind of a superclass maybe?

    Read the article

  • Precision of Interval for PL/SQL Function value

    - by Gary
    Generally, when you specify a function the scale/precision/size of the return datatype is undefined. For example, you say FUNCTION show_price RETURN NUMBER or FUNCTION show_name RETURN VARCHAR2. You are not allowed to have FUNCTION show_price RETURN NUMBER(10,2) or FUNCTION show_name RETURN VARCHAR2(20), and the function return value is unrestricted. This is documented functionality. Now, I get an precision error (ORA-01873) if I push 9999 hours (about 400 days) into the following. The limit is because the default days precision is 2 DECLARE v_int INTERVAL DAY (4) TO SECOND(0); FUNCTION hhmm_to_interval return INTERVAL DAY TO SECOND IS v_hhmm INTERVAL DAY (4) TO SECOND(0); BEGIN v_hhmm := to_dsinterval('PT9999H'); RETURN v_hhmm; -- END hhmm_to_interval; BEGIN v_int := hhmm_to_interval; end; / and it won't allow the precision to be specified directly as part of the datatype returned by the function. DECLARE v_int INTERVAL DAY (4) TO SECOND(0); FUNCTION hhmm_to_interval return INTERVAL DAY (4) TO SECOND IS v_hhmm INTERVAL DAY (4) TO SECOND(0); BEGIN v_hhmm := to_dsinterval('PT9999H'); RETURN v_hhmm; -- END hhmm_to_interval; BEGIN v_int := hhmm_to_interval; end; / I can use a SUBTYPE DECLARE subtype t_int is INTERVAL DAY (4) TO SECOND(0); v_int INTERVAL DAY (4) TO SECOND(0); FUNCTION hhmm_to_interval return t_int IS v_hhmm INTERVAL DAY (4) TO SECOND(0); BEGIN v_hhmm := to_dsinterval('PT9999H'); RETURN v_hhmm; -- END hhmm_to_interval; BEGIN v_int := hhmm_to_interval; end; / Any drawbacks to the subtype approach ? Any alternatives (eg some place to change a default precision) ? Working with 10gR2.

    Read the article

  • Create a group indicator (SQL)

    - by user1723699
    I am looking to create a group indicator for a query using SQL (Oracle specifically). Basically, I am looking for duplicate entries for certain columns and while I can find those what I also want is some kind of indicator to say what rows the duplicates are from. Below is an example of what I am looking to do (looking for duplicates on Name, Zip, Phone). The rows with Name = aaa are all in the same group, bb are not, and c are. Is there even a way to do this? I was thinking something with OVER (PARTITION BY ... but I can't think of a way to only increment for each group. +----------+---------+-----------+------------+-----------+-----------+ | Name | Zip | Phone | Amount | Duplicate | Group | +----------+---------+-----------+------------+-----------+-----------+ | aaa | 1234 | 5555555 | 500 | X | 1 | | aaa | 1234 | 5555555 | 285 | X | 1 | | bb | 545 | 6666666 | 358 | | 2 | | bb | 686 | 7777777 | 898 | | 3 | | aaa | 1234 | 5555555 | 550 | X | 1 | | c | 5555 | 8888888 | 234 | X | 4 | | c | 5555 | 8888888 | 999 | X | 4 | | c | 5555 | 8888888 | 230 | X | 4 | +----------+---------+-----------+------------+-----------+-----------+

    Read the article

  • how get fully result from Asynchronism communication?

    - by rima
    Hi all refer to these post : here1 and here2 at last I solve my problem by build a asynchronous solution,and it work well!!! but there is a problem that i face with it,now my code is like this: class MyProcessStarter { private Process process; private StreamWriter myStreamWriter; private static StringBuilder shellOutput = null; public String GetShellOutput { get { return shellOutput.ToString(); }} public MyProcessStarter(){ shellOutput = new StringBuilder(""); process = new Process(); process.StartInfo.FileName = "sqlplus"; process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true; process.OutputDataReceived += new DataReceivedEventHandler(ShellOutputHandler); process.StartInfo.RedirectStandardInput = true; process.StartInfo.RedirectStandardOutput = true; //process.StartInfo.RedirectStandardError = true; process.Start(); myStreamWriter = process.StandardInput; process.BeginOutputReadLine(); } private static void ShellOutputHandler(object sendingProcess,DataReceivedEventArgs outLine) { if (!String.IsNullOrEmpty(outLine.Data)) shellOutput.Append(Environment.NewLine + outLine.Data); } public void closeConnection() { myStreamWriter.Close(); process.WaitForExit(); process.Close(); } public void RunCommand(string arguments) { myStreamWriter.WriteLine(arguments); myStreamWriter.Flush(); process.WaitForExit(100); Console.WriteLine(shellOutput); Console.WriteLine("============="+Environment.NewLine); process.WaitForExit(2000); Console.WriteLine(shellOutput); } } and my input is like this: myProcesStarter.RunCommand("myusername/mypassword"); Console.writeline(myProcesStarter.GetShellOutput); but take a look at my out put: SQL*Plus: Release 11.1.0.6.0 - Production on Thu May 20 11:57:38 2010 Copyright (c) 1982, 2007, Oracle. All rights reserved. ============= SQL*Plus: Release 11.1.0.6.0 - Production on Thu May 20 11:57:38 2010 Copyright (c) 1982, 2007, Oracle. All rights reserved. Enter user-name: Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options as u see the output for run a function is not same in different time!So now would you do me a faver and help me that how I can wait until all the output done in other mean how I can customize my process to wait until output finishing ?? because I want to write a sqlcompiler so I need the exact output of shell. plz help me soon.thanxxxxxxxxxxxx :X

    Read the article

  • Hidden features of PL/SQL

    - by Adam Paynter
    In light of the "Hidden features of..." series of questions, what little-known features of PL/SQL have become useful to you? Edit: Features specific to PL/SQL are preferred over features of Oracle's SQL syntax. However, because PL/SQL can use most of Oracle's SQL constructs, they may be included if they make programming in PL/SQL easier.

    Read the article

  • can oracle types be updated like tables?

    - by Omnipresent
    I am converting GTT's to oracle types as explained in an excellent answer by APC. however, some GTT's are being updated based on a select query from another table. For example: UPDATE my_gtt_1 c SET (street, city, STATE, zip) = (SELECT src.unit_address, src.unit_city, src.unit_state, src.unit_zip_code FROM (SELECT mbr.ROWID row_id, unit_address, RTRIM(a.unit_city) unit_city, RTRIM(a.unit_state) unit_state, RTRIM(a.unit_zip_code) unit_zip_code FROM table_1 b, table_2 a, my_gtt_1 mbr WHERE type = 'ABC' AND id = b.ssn_head AND a.h_id = b.h_id AND row_id >= v_start_row AND row_id <= v_end_row) src WHERE c.ROWID = src.row_id) WHERE state IS NULL OR state = ' '; if my_gtt_1 was not a global temporary table but an oracle collection type then is it possible to do updates this complex? Or in these cases we are better off using the global temporary table?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >