How to detect an AUTO_INCREMENT column in a table of PostgreSQL DB?
Hello,
I need to detect an AUTO_INCREMENT column in a table of PostgreSQL DB.
Note : PostgreSQL uses sequence number to create an AUTO_INCREMENT column.
From a ResultSetMetaData, I call the methode isAutoIncrement(int index) which returns true if the column index is AUTO_INCREMENT.
But it doesnt work..
Any idea about that?
Thank for your attention.
Sopheap
That's how you do it.
However, I've found that metadata calls don't always work completely with my Sybase installation. You'll have to read up on the JDBC driver and see if that feature is supported for your environment.
Similar Messages
-
Impossible to detect an AUTO_INCREMENT column in a table of PostgreSQL DB.
Hello,
I need to detect an AUTO_INCREMENT column in a table of PostgreSQL DB.
Note : PostgreSQL uses sequence number to create an AUTO_INCREMENT column.
From a ResultSetMetaData, I call the methode isAutoIncrement(int index) which returns true if the column index is AUTO_INCREMENT.
But it doesnt work.
It seems that this methode is not implemented in postgreSql JDBC driver.
Any idea about that?
Thank for your attention.
SopheapIs it true that nobody knows how to detect an AUTO_INCREMENT column in a table of PostgreSQL DB?
Sopheap -
How we can replace the column in Core Table plz see this msg
Hi,
How we can replace the column in Core Table plz see this msg
Req:
when i push the Insert button the data inserted into the Table
like
Cols Values
FOCD CUFZ14
PRDCD FU6
Month 082008
AgencyCD AG02
PLAN 123
This is FO_Plan Table....
Requirement:
i need at table show to replace the Prd_CD to Prd_Desc while inserting the above Row....
There is no Prd_Desc in FO Plan Table....
Prd_desc comes from Product Table.
did u get my point...
how to solve.
Thanks
Ram
Edited by: Ram Vungarala on Sep 24, 2008 9:09 AM
Edited by: Ram Vungarala on Sep 24, 2008 9:15 AMHi,
I'm not sure if I understood what are you trying to do. But you can modify your table in a backing bean code. JSF page code for a table:
<af:table id="product_search_results_tbl" binding="#{backingBean.boundTable}" ... />
And a backing bean code:
import oracle.adf.view.faces.component.core.data.CoreTable;
public class YourBackingBean {
private CoreTable boundTable;
public void setBoundTable(CoreTable boundTable) {
this.boundTable = boundTable;
public CoreTable getBoundTable() {
return boundTable;
public String insertButtonAction() {
// Bind your button action to this method and modify here your bound table
return null;
{code}
Look for column modification methods in a CoreTable class documentation.
Marius -
How to provide Link to Column in the Table
Hi
please let me know how to provide link to one column in the table.
i have two views
in one view i will dispaly emp id and emp dept in a table
i have to provide link to the emp id column table
when i click emp id column then it will fire other view and display remaining details of emp.
so please let me know how to provide link to column in the table.
Solution is urgent
regards
mmukeshHi Mukesh,
You can insert LinkToAction column in table.you can have two cattributes in Valuenode one is of type boolean and other is of type string(empno)
you can create eventhander in that you can fire plug to seconf view where you can displays the emp details
With Regards
Naidu -
How to extend No. of columns for PIVOT table in BI Publisher Desktop
Hello Everyone,
I am using the Oracle BI Publisher Desktop to design the TEMPLATE for Oracle Reports.
I need to create the PIVOT table .In my PIVOT table I need to display 9 columns but when I tried to create PIVOT table by dragging 9 columns only first 4 columns are displaying in report.
Can anyone suggest me how can I increase the number of columns in PIVOT table?
Thank You.
Regards,
Guru.hi jim
if you carefully look inside the form field's you will find the logic of sort . if you remove that you will get the data without any sorting order.
else send me your template and xml to my email id i can look into that .
email : [email protected] -
How to get the primarykey columns of the table in SAP BI Java SDK
Hi, I'm new to sap BI Java SDK. I'm not getting how to get the primarykey columns, using BI JDBC Connector (for relational data sources). If anybody knows, please let me know. its very very urgent task to be done in my project. In the below following code.... I have written a code to connect to the database through resource bundle, reading table names, once user select table name, i need to show the primary key columns of that table to the user. here i'm not getting how to get the primary key columns . Please send me the code if there is any method to find out the primarykey columns or a logic to get them. I will be greatful to you.... if you can do this favour.
Please check out the following code ........
ManagedConnectionFactory mcf;
IConnectionFactory cf;
IConnectionSpec cs;
mcf = new JdbcManagedConnectionFactory();
cf = (IConnectionFactory) mcf.createConnectionFactory();
cs = cf.getConnectionSpec();
ResourceBundle rbLocal = ResourceBundle.getBundle( "xxxx");
Enumeration propnames = rbLocal.getKeys();
while (propnames.hasMoreElements())
String key = (String) propnames.nextElement(); //out.print(key); //out.println("="rbLocal.getString(key)"");
cs.setPropertyValue(key, rbLocal.getString(key));
// Establishing the connection. // The IBIRelational interface provides an entrypoint to access // metadata and execute queries.
IBIConnection connection = (IBIConnection) cf.getConnectionEx(cs); I
BIRelational rel = connection.getRelational();
IBIQuery query = rel.createQuery();
String sqlStatement = "SELECT * FROM " + "BICQPERSON where type='pk'"; ResultSet rs = IBIDataSet dataset = query.execute();
Thanks SreeKanthHi,
looks like you are on Infomation Builders, correct? If yes through which adapter and to what DB are you connecting?? in an R3/BW system you can do the folowing:
"(ABAP)
SELECT DISTINCT FIELDNAME
FROM DD03L
WHERE TABNAME = '/BIC/QPERSON'
AND AS4LOCAL = 'A'
AND KEYFLAG = 'X'
ORDER BY 1
Another option is goto directly to the RDBMS; in this case let me which one are you using
hope this helps...
Olivier.
Message was edited by:
Olivier Cora -
How to insert filename as column in external table.
I have an external table that is made up by number of different files. I would like to add a new column in the table to store the actual external filename. How can this be done?
thanks in advancedThat's going to be a problem, then. The ISO 8859-1 character set doesn't support that character, so you cannot store a ™ in a CHAR or VARCHAR2 column in your database.
Potentially, you could use an NCHAR or NVARCHAR2 column, depending on your national character set. Using the national character set, though, can cause other problems, particularly for front-end applications that may not fully support those data types.
You could also potentially change your existing character set to something that does support that character, but that may be a rather involved sort of change.
Justin -
How to populate the organization_code column in ST table for legacy system
Hi, dear all,
Now I use the stage table to load the setup&transaction collection data from a non-EBS legacy system to ASCP system.
My question is: how to populate the organization_code column in the stage table?If the source system is EBS system, maybe it's an inventory organization code. But for the non-EBS system, which value is need fo this field? keep it as blank? or assign some value for it?
Thanks
Edited by: 852938 on 2011-5-4 下午10:24I find some words in the implementation guide, it says:"To collect data from your non-Oracle ERP systems or your trading partners' systems,you model each non-Oracle ERP system or trading partner as an Oracle Applications organization and store their setup and transaction data there".
But I can't find where to model the application organization for the legacy system.
anyone can give some clues? Thanks in advance. -
How to set the flexfield column in advanced table
Dear All
Dear Gaurav
Good morning
iis it posible to create a flexfield column in advanced table.I am trying it is showing some error......
Thanks& Regards
SreekanthHi,
My doubt is compulsory we give the view instance for flex field,
and also give the view instance for advanced table.
when i created the flex field in advanced table,it didn't ask the view instance.
the advanced table and flex field view instance are different
at that how can i create the flex field in advanced table. -
How to get invoice status column in ap_invoice_all table
how to get the invoice_status column like "NEEDS RE VALIDATION" in account payables tables.
The invoice approval status does not come from any table / lookup.
Instead, Oracle builds it by calling the ap_invoices_pkg.get_approval_status function.
You can also call it by passing invoice_id, payment_status_flag and invoice_type_lookup_code.
All these 4 columns are present on the ap_invoices_all record.
Hope this helps
Sandeep Gandhi
Independent Consultant -
How to freeze the selection column in the table control of the module pool.
hi ,
in my module pool there is a row selection field <b>w/selcolumn</b> of the table control called as mark.
how to freeze the selection column where there is no record in the table control row.
or in other words where wa is initial.
thanks
ektaHi all,
in the PBO of the screen the following code is written.
say the selection column is MARK and is declared in the data as well.
thanks
ekta
*************************C O D E **************************************************
MODULE disp_tabctrl1 OUTPUT.
IF flag_c = 1.
READ TABLE it_create_data INTO wa_material_data
INDEX tab_ctrl1-current_line.
ELSE.
READ TABLE it_material_data INTO wa_material_data
INDEX tab_ctrl1-current_line.
IF sy-subrc = 0.
IF ok_code_0101 = '&SEL1'.
mark = 'X'.
ELSEIF ok_code_0101 = '&DSEL'.
mark = ' '.
ENDIF.
ELSE.
LOOP AT SCREEN.
IF screen-name = 'MARK'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
index_t = tab_ctrl1-top_line.
index_d = tab_ctrl1-top_line + n.
ENDMODULE. " DISP_TABCTRL1 OUTPUT -
How to update the COST column using another table's column
Dear All,
I have table:
table parts: pno, pname, qoh, price, olevel
table orders: ono, cno, eno, received, shipped
table odetails: ono, pno, qty
view:orders_view: ono, cno, eno, received, shipped,sum(qty*price)order_costview:odetails_view: ono, pno, qty, (qty*price)cost
after I update the price in parts, I need to update COST and ORDER_COST too. The orders_view does not have pno, qty, and price, the odetails_view does not have price, how can I update the COST and ORDER_COST. Please help and Thanks in advance!!!
I wrote the update the price in parts:
create or replace procedure change_price(ppno in parts.pno%type, pprice in parts.price%type) as
begin
update parts
set price = pprice
where pno = ppno;
end;
show errorsthis procedure works fine.
I wrote the trigger:
create or replace trigger update_orders_v
after update of price on parts
for each row
begin
update orders_view
set order_cost = sum(parts.(:new.price)*parts.qty)
where parts.pno = :new.pno;
end;
show errorsIt gives me:Errors for TRIGGER UPDATE_ORDERS_V:
LINE/COL ERROR
3/5 PL/SQL SQL Statement ignored
4/22 PL/SQL ORA-00934: group function is not allowed hereplease help!You could add the columns to the tables and then you would need a trigger to update those columns. However, you could just as easily select the price * qty to get the cost, without creating an additional column or trigger. I have no idea what you might want to do with a global temporary table. I think you need to explain what your purpose is, before any of us can suggest the best method. Since I have already demonstrated an update with a view, I will demonstrate an update with the cost column added to the odetails table and a trigger as you asked about. Notice that you will need triggers on both tables, the one that has qty and the one that has price.
scott@ORA92> create table parts
2 (pno number(5) not null primary key,
3 pname varchar2(30),
4 qoh integer check(qoh >= 0),
5 price number(6,2) check(price >= 0.0),
6 olevel integer)
7 /
Table created.
scott@ORA92> create table odetails
2 (ono number(5),
3 pno number(5) references parts,
4 qty integer check(qty > 0),
5 cost number,
6 primary key (ono,pno))
7 /
Table created.
scott@ORA92> create or replace procedure change_price
2 (ppno in parts.pno%type,
3 pprice in parts.price%type)
4 as
5 begin
6 update parts
7 set price = pprice
8 where pno = ppno;
9 end;
10 /
Procedure created.
scott@ORA92> create or replace trigger update_cost1
2 after insert or update of price on parts
3 for each row
4 begin
5 update odetails
6 set cost = qty * :new.price
7 where pno = :new.pno;
8 end update_cost1;
9 /
Trigger created.
scott@ORA92> show errors
No errors.
scott@ORA92> create or replace trigger update_cost2
2 before insert or update of qty on odetails
3 for each row
4 declare
5 v_price parts.price%type;
6 begin
7 select price
8 into v_price
9 from parts
10 where pno = :new.pno;
11 --
12 :new.cost := :new.qty * v_price;
13 end update_cost2;
14 /
Trigger created.
scott@ORA92> show errors
No errors.
scott@ORA92> insert into parts values (1, 'name1', 1, 10, 1)
2 /
1 row created.
scott@ORA92> insert into odetails values (1, 1, 22, null)
2 /
1 row created.
scott@ORA92> -- starting data:
scott@ORA92> select * from parts
2 /
PNO PNAME QOH PRICE OLEVEL
1 name1 1 10 1
scott@ORA92> select * from odetails
2 /
ONO PNO QTY COST
1 1 22 220
scott@ORA92> -- update:
scott@ORA92> execute change_price (1, 11)
PL/SQL procedure successfully completed.
scott@ORA92> -- results:
scott@ORA92> select * from parts
2 /
PNO PNAME QOH PRICE OLEVEL
1 name1 1 11 1
scott@ORA92> select * from odetails
2 /
ONO PNO QTY COST
1 1 22 242
scott@ORA92> -- select works without extra cost column or trigger:
scott@ORA92> select o.ono, o.pno, o.qty, (o.qty * p.price) as cost
2 from odetails o, parts p
3 where o.pno = p.pno
4 /
ONO PNO QTY COST
1 1 22 242
scott@ORA92> -
How to identify the source column and source table for a measure
Does anyone have a query that I can use to positively identify the source column and source table for a cube measure in an SSAS cube? Visual Studio shows ID, Name, and Source, but it is nearly worthless in a large cube and database.
Also - the same for a dimension would be great.
If no query exists for this, can someone please explain how to find the source column/table for a measure and for a dimension?
Thanks.DMVs don’t expose the DataSourceView content. AMO is much better suited for object model operations like
this than the DMVs. PowerShell is also sometimes an option, but in this case C# code would be much easier because analyzing the contents of the DataSourceView is much easier using the .Net DataSet class.
Hope this helps.
Reeves
Denver, CO -
How to delete a virtual column in a table
Is it possible to delete a virtual column in a table. Please give the complete syntax to help do it
Like this...
SQL> select * from dept;
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> alter table dept add (sal as (deptno*10));
Table altered.
SQL> select * from dept;
DEPTNO DNAME LOC SAL
10 ACCOUNTING NEW YORK 100
20 RESEARCH DALLAS 200
30 SALES CHICAGO 300
40 OPERATIONS BOSTON 400
SQL> alter table dept drop (sal);
Table altered.
SQL> select * from dept;
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON -
How to split list of columns into 2 tables in SSIS 2012?
Hi,
I have 200 columns in Source. Now i want to split these columns, few into Destination A and few more columns into
Destination B. Multi cast i tried to use, but it coping all the columns . Any help would be appreciated. Thanks in Advance.
Lets assume i have columns A,B,C,D,E..
i want to move Columns A,B,D into destination A and
columns A,C,D,E INTO Destination B. please help me to implement this logic?Hi vasu_479,
Based on your description, you want to split columns in source table into two destination tables.
After testing the scenario in my environment, we can use Multicast to achieve your requirement. Just as you said, the Multicast would return all columns. But we can use the method below to achieve the goal:
If the destination tables are existing tables, we can just map column A, B and D as Input Columns to the corresponding Destination Columns in the Mapping tab for destination A. Then map column A, C, D and E in destination B.
If the destination tables are created in the Destination component, we can modify the create table query to directly create A, B and D for destination table A, create A, C, D and E for destination table B. Then there columns would be automatically mapped
in the Mappings pane.
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support
Maybe you are looking for
-
How can I tell if an audio clip is .m4a or .aiff?
I have some audio clips in a song that I dragged/dropped a few weeks ago and I cannot remember if they were rendered as m4a or aiff. I tried clicking on the clip itself but I see no option for "get info" or anything like that. I also tried using the
-
Cannot connect to SQL SERVER with Always on availability group listener name
Hi everyone, I have setup always an availability group listener for sql server on port 1433, have opened the port in firewall , remote connections are enabled in the sql server, but still I am not able to connect to the sqlserver instance with the h
-
HT4061 My setting app is frozen
My setting app is fronzen in itunes & App store?
-
Live-Video and ACNS: Different documentation?
I had found two statements regarding live- video and ETV: First in http://www.cisco.com/en/US/partner/prod/collateral/video/ps9339/ps7063/data_sheet_c78-504500.html "... Cisco ACNS provides both live unicast and multicast streaming services and on-de
-
Current version of integration services on Hyper V host and ugrading versions on VM's
Greetings! I am looking for where the latest version number of integration services is posted, so I may verify what it should be. I am able to query using powershell the vm's on the hosts and get a return of the current version installed. However, I