SQL & PL/SQL :: Taking Selective Information From String?
Jan 31, 2011
I want to take selective output from String input like
Input:'Six Thousand * Four Hundred Seventy Two Rupees And Zero'
Output:'Six Thousand Four Hundred Seventy Two Rupees'
I am using substr and instr functions but not getting the desired output.
View 22 Replies
ADVERTISEMENT
Nov 8, 2010
Assuming I have the following table with its data:
Quote:
| code | description |
| A | $abc + xyz = $cba - 2 |
| B | ($12345 + $12345)/3 |
| C | $poke + $abc = $abc + 456 - 789 |
How can I do a selective search on "description" column for any word that starts with the "$" sign? In the end, this is the resultset that I am expecting:
Quote:
| $ | count of $ |
| $abc | 3 |
| $cba | 1 |
| $12345 | 2 |
| $poke | 1 |
View 5 Replies
View Related
Apr 10, 2011
I have tables dynamically created with dynamic number of columns. There will be 7 columns that would always be fixed with their names and data types. They will always be last 7 columns.
way to write a select statement on those dynamic tables where only those known 7 columns are not selected and I need to select all the rest columns but leave the 7 columns names I know.
View 6 Replies
View Related
Mar 13, 2010
I have one query based(Execute_query) tabular form where i pass input parameters and the query results will be displayed.I have around 100 records and i want to display like 15 records per page once i click the button it will go to the next 15th record and theron if i click on that it should move to 30th and i dont want to use scroll bar.Is there any way.I am attaching the fmb.
View 7 Replies
View Related
Dec 11, 2010
I have a Group report based on one group.For eg..there is machine (Group) and it has detail records .The problem is there are certain specific machine on which i want sorting to be done the rest will be not sorted.
machine WX
Details not be sorted
machine sh4
Details to be sorted
machine sh5
Details to be sorted
machine AN1
Details not to be sorted
View 12 Replies
View Related
May 11, 2013
I am trying to export selective data from one of my prod database tables. But not succeeding. I was keep on trying for the past 2 hours.
OS : SOLARIS SPARC
ORACLE - 10G
Query --> WHERE E3RECV_DT LIKE '201305%' (I need to export this query data)
Below Script i am using
===============
exp E3USER@SGEBAPU2 statistics=none consistent=n buffer=100000000 file=exp_pipe_file TABLES=IFDATA query="WHERE E3RECV_DT LIKE '201305\%'" log=PGTB_IFDATA_conditional.log
View 1 Replies
View Related
Aug 4, 2009
I have one 10g database in other country. I want part of their db (selected tables or tablespaces) and import that data to my 10g DB and i want keep to date this data.
I know two ways
1. Data Pump Imp/Emp via FTP, but i can't send only data that have changed (incremental), i must pumping whole selected part of database (i want only new data from their DB, but consistanse with my DB)
2. RMAN etc. or other archivisation tool, i can do incremental achivisation, but can i send files to another instances (my db) and load only that data? Can i do that with SQL*Loader?
View 1 Replies
View Related
Jun 19, 2012
I have this error (and solution):
ORA-02085: database link string connects to string
Cause: a database link connected to a database with a different name. The connection is rejected.
Action: create a database link with the same name as the database it connects to, or set global_names=false.
Where should I set global_names=false ?
View 7 Replies
View Related
Mar 14, 2013
I'm facing some problem even after using INSTR function in Oracle.The problem is I have written the logic in the PL/SQL block which appends all the values fetched in a loop on the basis of whether the string is present or not.
For ex:
The first value fetched from the select query first is ABCDEFG which gets appended to a variable
The next value fetched is AB even this has to be appended to the variable since this exactly doesn't match with ABCDEFG.
The next value fetched is BCDEF even this has to be appended to the variable since this exactly doesn't match with ABCDEFG.
The third Value fetched is ABCDEFG this will not get appended presently according to the logic which is correct.
writing that piece of code to append the value fetched which doesn't exactly match with the existing string
View 3 Replies
View Related
May 9, 2008
show an ex to use string buffer for select statemnt
View 1 Replies
View Related
Apr 25, 2007
Is it possible to query a mp3 file's ID3 information, or the properties where you can put in artist, album, etc. information?
View 1 Replies
View Related
Dec 21, 2011
User wants to take a backup of the table .
There are 2 methods that i know to take a table backup. From those 2 methods
1.Using Export ?
exp user/pass file=table.dmp tables=owner.table compress=n consistent=y grants=y
feedback=1000 log=table.log
2.Copy method ?
create table table_backup as select * from <table_name>.
View 1 Replies
View Related
Feb 25, 2010
I have a table called transaction_dw and I need to select all records that have an account balance that has been below 0 in the past 6 months. initial query I tried was:
select account_balance, timestamp
from transaction_dw
where account_balance < 0
and timestamp between sysdate and sysdate - 6;
but this is only taking 6 days off the sysdate rather than months, how I can get it to take off 6 months?
View 3 Replies
View Related
Feb 6, 2013
What is the best possible method to take backup of 50 tables with data ? My DB version is 11gR2
View 14 Replies
View Related
Feb 18, 2011
I have been implementing a script to change a lot of data in a database production.Because of this the database will be 100% dedicated to the execution of that script, in the sense that nothing else will be running in this period (the application will be stopped).
what can i do to improve performance of that execution? is there any oracle manual online for this type of problem? I do not know if it's possible, but I'm thinking of things like disabling locking mechanism (if possible I could run instead of a process many processes in parallel), disabling index growing (during the process), disabling constraints.
View 1 Replies
View Related
Jul 13, 2010
the view from where we can fetch information for a foreign key viz. reference table, referenced columns etc.
View 3 Replies
View Related
Dec 17, 2011
i enabled auditing by setting
audit_trail=db,extended in spfile,and restart the database and after that i issued command to audit as below :
audit select on emp by access;
but how to see audit log information(ie from which table),i checked dba_audit_trail but it doesnot have any record.
View 4 Replies
View Related
Oct 25, 2012
I am developing some automated test packages for my PL/SQL Packaged code. Going forward I can code the test package in conjunction with the code but I have some historic packages that I would like to develop these test packages for.
To save time I would like to employ oracle data dictionary views in order to construct the framework for my test package. This includes using SQL to get a list of procedures / functions within the package in order to create the test procedures (spec and body). I can do this in a basic way using the user_procedure view with something like...
SELECT 'PROCEDURE test_' || LOWER(procedure_name)
|| ' (p_result OUT VARCHAR2 IS BEGIN JTA.ACCOUNT_PROFILE_MAINT.' || procedure_name || ' END '
|| LOWER(procedure_name) || ';'
FROM user_procedures WHERE object_name = 'ACCOUNT_PROFILE_MAINT' AND subprogram_id != 0 ORDER BY subprogram_id;
However, the above only really works (in simplistic form.. without parameters) for procedures within the package. I would also like to be able to determine if the procedure listed is actually a function or procedure (so that I can alter the syntax accordingly to generate a correctly formatted string calling the program unit).
So, initially how do I determine the type of package program unit I have (Proc/Function)? Do I need to go to all_source to get this information or are there other views available I can join to?
Eventually I would like to extend this to be able to automatically include any parameters in the generated calling string.. again, is there any other option apart from all_source to get this information?
View 3 Replies
View Related
Jan 8, 2013
How to know weather table is partitioned or not ? Is there any data dictionary view to know the information about the Partitioned type,keys on table ?
View 4 Replies
View Related
Oct 16, 2010
adjusting a query. I have a table which looks like this:
CREATE TABLE PF.PF_ANOMALIES
(
ID VARCHAR2(10 BYTE) NOT NULL,
PLAN_ID VARCHAR2(10 BYTE),
CLIENT_ID VARCHAR2(10 BYTE),
SEDOL_CODE VARCHAR2(7 BYTE),
LTY_ID VARCHAR2(10 BYTE),
[Code]....
I have the following query that will return me the anomalies of client transactions (based on joining other tables for extra info too)
SELECT pc.client_id,
pc.client_name,
NVL(pa.sedol_code, 'N/A'),
DECODE(ps.stock_name, NULL,
DECODE(plt.lty_name, NULL, 'N/A', UPPER(plt.lty_name) || ' LEDGER - ' || pa.orig_price_ccy),
[Code]....
-- Get cash anomalies on top as these will have 'N/A' sedols I have another temp table that also gets populated with anomalies:
CREATE GLOBAL TEMPORARY TABLE PF.PF_ANOMALIES_TMP
(
ID VARCHAR2(10 BYTE) NOT NULL,
FVD_TYPE VARCHAR2(10 BYTE) NOT NULL,
CLIENT_ID VARCHAR2(10 BYTE),
SEDOL_CODE VARCHAR2(7 BYTE),
[Code]..
My problem is that I also want my query to return rows from this tmp table too.
View 17 Replies
View Related
Oct 20, 2010
The sqlcache is getting over-written.I would like to capture information from AWR snapshots and feed those (as a workload) into the DBMS_ADVISOR.I can't see where it's possible (other than manually creating my workload from AWR information)
View 3 Replies
View Related
Dec 20, 2012
How can i retrieve which tables have composite primary keys, and only one of the primary key columns is a foreign key to another table?
Like:
CREATE TABLE club (
clubId NUMBER,
name VARCHAR(20) NOT NULL,
PRIMARY KEY (ClubId)
);
CREATE TABLE team (
teamid NUMBER(10),
clubid NUMBER(10),
teamname VARCHAR(10) NOT NULL,
PRIMARY KEY (teamid, clubid),
FOREIGN KEY (clubid) REFERENCES club (clubid));So in this case, the team table
View 4 Replies
View Related
Sep 16, 2012
)How do you view the value of the parameter that is being used by instance? show parameter..?
2)How do you get the information of hidden parameters
3)What is the database object that stores information related to various types of db connections over network
4)How do you verify since when the db session is running
5)How do you verify the Originating machine details of the database session
6)How do you verify the name of program that the db session is running
7)What is the naming convenion of Base tables. Where is the information of base tables stored?
8)How are dynamic views created. Whre is the information of dynamic views stored?
View 8 Replies
View Related
Nov 5, 2013
We are running Oracle 10g. I need to pull the DDL information from our Oracle tables. The following SQL statement returns the result as a "HUGECLOB". Is there a way to convert the result to text in varchar2 data type? Since tables being processed have numerous partitions, the DDL information for them is quite large, therefore, using substring would not be a viable alternative.
[code]select DBMS_METADATA.GET_DDL('TABLE','EMPLOYEE') from DUAL; [/code]
View 6 Replies
View Related
Jul 20, 2012
In one of my application oracle net connection is taking 30 to 40 ms(tnsping servicename),but in actual connection is always taking more than 45 ms, and my application requirement is below than 10 to 20 ms.
And can i use any other connection method like hostname, ezconnect etc.
View 7 Replies
View Related
Jan 18, 2013
I am working with a new client and am still waiting on access to systems so I'm a bit hampered in looking at details of the database and environment. The database is OLTP and typical response time for returning result sets is under 2 seconds, often less than 1 second.
A simple SELECT on a few columns of v$session_longops (no subqueries, group by, having, etc) ran for more than 5 minutes.
View 3 Replies
View Related
Mar 3, 2012
We are on a GRID DB and using Oracle 11g.
A external reporting application ( SQL SERVER REPORT SERVICES) sends in some comma separated parameter values, which has to be queried against a table with 6-10 million records.
Length of the comma separated value can go upto 5000-6000 in length based on user input in the front end application. This application sends this value in comma separated. i.e., like
'AA1-11101,AA2-34346,AA4-534399,.....' like this at a time the application can send upto 500 values each of length 10. i.e, maximum length can be upto 5000. I used CLOB to handle this because since the length can be 5000 and varchar2 can handle only 4000 long literals.
But the time taken by the CLOB to verify against the table using INSTR is more compared to VARCHAR2.
I found that VARCHAR2 does'nt take much time. Is it a good idea to have VARCHAR2 in the PLSQL procedure as parameter instead of CLOB, since PLSQL VARCHAR2 can handle upto 32000 long values.
View 10 Replies
View Related
Mar 2, 2013
How to find time log for query or any procedure like start time and end time and total time.
So that I can tune that queries properly.
Also how can we find estimated query running time.?
View -1 Replies
View Related
Jul 4, 2011
I want to know how I can find which query is taking more time , for example some query's are run from unix, java and from toad,sqlplus. and one query is taking much more time to execute, so how i can get that query and all the details.
View 2 Replies
View Related
Feb 19, 2013
I have a query which is executing fast in dev env,but very long time in qa env.What is the criteria when this behaviour occurs.Though qa is having more data than dev.But still it is taking long time for 1 rows also.When I am using the query rownum<=1.So What to check for this.
View 6 Replies
View Related