get a table using datasocket
I want to enter data in my 1st vi ang get in a table in the 2nd, but I can't.
If someone know the solution
1 is: remote control
a 2nd: receiver
I think my problem is here
achfire,
After being able to look at your code, I think you're almost more complicate things. I've looked into these 2 files, who is attached, and they use the DS server and communicate very effectively. These programs are just take LabVIEW program examples, but show the simplicity in using the DataSocket.
Tags: NI Software
Similar Questions
-
Get the 500 error trying to create a table using the REST API
Hello
I tried to create a table using the REST API for Business Intelligence Cloud, but I got 500 Internal Server Error for a while now.
Here are the details that I use to create a table.
and the json to create the schema that I use is
[{'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ["ROWID"]}]
, {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['RELATIONID']},
{'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['ID']}
, {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['RESPONDEDDATE']},
{'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [255], 'columnName': ['RESPONSE']},
{'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_CREATEDDATE']},
{'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['SYS_CREATEDBYID']},
{'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_LASTMODIFIEDDATE']},
{'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['SYS_LASTMODIFIEDBYID']},
{'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_SYSTEMMODSTAMP']},
{'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [10], 'columnName': ['SYS_ISDELETED']},
[{'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [50], 'columnName': ['TYPE']}]
I tried this using postman and code, but I always get the following response error:
Error 500 - Internal server error
Of RFC 2068 Hypertext Transfer Protocol - HTTP/1.1:
10.5.1 500 internal Server Error
The server encountered an unexpected condition which prevented him from meeting the demand.
I am able to 'get' existing table schemas, delete the tables, but I'm not able to make put them and post operations. Can someone help me to identify the problem, if there is no fault in my approach.
Thank you
Romaric
I managed to create a table successfully using the API - the only thing I see in your JSON which is different from mine is that you have square brackets around your values JSON where I have not. Here is my CURL request and extract my JSON file (named createtable.txt in the same directory as my CURL executable):
curl u [email protected]: password UPDATED h x ' X-ID-TENANT-NAME: tenantname ' h ' Content-Type: application/json '-binary data @createtable.txt https://businessintell-tenantname.analytics.us2.oraclecloud.com/dataload/v1/tables/TABLE_TO_CREATE k
[
{
'columnName': 'ID',
'dataType': 'DECIMAL ',.
'Length': 20,.
"accuracy": 0.
'Nullable': false
},
{
'columnName': 'NAME',
'dataType': 'VARCHAR ',.
'Length': 20,.
"accuracy": 0.
'Nullable': true
},
{
"columnName': 'STATUS."
'dataType': 'VARCHAR ',.
'Length': 20,.
"accuracy": 0.
'Nullable': true
},
{
"columnName': 'CREATED_DATE."
'dataType': 'TIMESTAMP '.
'Length': 20,.
"accuracy": 0.
'Nullable': true
},
{
'columnName': 'UPDATED_DATE ',.
'dataType': 'TIMESTAMP '.
'Length': 20,.
"accuracy": 0.
'Nullable': true
}
]
-
Unable to connect to the remote Mitsubishi OPC server using datasocket
I can read OPC items locally using datasocket, however if the customer is in another PC I get error 1184 when I try to connect to an element. The datasocket select URL works well.
Both computers are Windows 7 machines in the same workgroup sharing the same username/password.
I am able to read items through the DSC OPC client (but I don't want to use DSC). This seems to indicate that the DCOM security settings are good.
I know there is a lot of documentation on remote access OPC and DCOM and I read most of the documentation by OR and other sources, nothing helps. None of the docs are to mention this specific error code. Any suggestions?
Well, this is typical... After two days of efforts, just 40 minutes after you posted my question I found the solution in another thread of this forum.
The remote registry service must be running on the server.
Now I only need to rewind some of the many settings that I did it carefully, to find the minimum working conditions.
-
How replot a table using plotXY without creating a new parcel?
I want to replot continually a table using plotXY without increment the name of the parcel. Is this possible?
Whenever I call plotXY a new path is created. For example, the first time that plotXY is run, I get a marked route Plot1 (parcel number 1). The second time I call plotXY, I get a parcel named Plot2 (parcel number 2) and so on. But I want to draw the same picture several times that I've added more data to it. And I want the name of the parcel to be Plot1 every time.
I know that I can change the name 'Plot1' attribute after the call to plotXY. But I feel that somewhere in the internal parts of the graph I'm ever increasing utilization of certain resources. I'll be Replot the table several hundred thousand times so I don't want to run out of memory or something.
So my question is this, is it possible to re - initialize a graph to its original state before you run the plotXY?
Do not confuse the name of the parcel and manage the resources allocated to the curve. If you delete all the plots in the graph with DeleteGraphPlot () then draw a new curve, you should have 'Track 1' under the name of the plot, but you will get a continuously raise the handle of the plot; This does not assume that you are summarizing additional resources whenever you draw on the graph, the graph simply never reuses draw handles associated with deleted locations.
In your case, you can also try a different approach:
- Use a graph of the band instead of the chart: if possible you will avoid the problem of more names of conspiracy and will reduce the program activity that you will draw only new points in every race
- Only new field points with PlotXY showing only the first parcel in the legend: you will need to keep track of array index, already mapped out so that if you have traced up to array [index] to date, you will draw array [index] to array [newindex] on the new iteration
-
XML data in the table using sql/plsql
Hi experts,
Could you please help with the following requirement. I have the tags xml (.xml on a server file) below. I need to access this file and read the XML and insert into the db table using sql and plsql. Is it possible with the cdata below? And there is a nested this table.
Could someone please guide me if you have a sample code file and xml.
<? XML version = "1.0" encoding = "UTF-8"? >
< generation_date > <! [CDATA [17/11/2015]] > < / generation_date >
< generated_by > <! [CDATA [Admin Admin]] > < / generated_by >
< year > <! [CDATA [2015]] > < / year >
< month > <! [CDATA [01]] > < / month >
< author >
< author > <! [CDATA [user author]] > < / author > < author_initial > <! [CDATA [user]] > < / author_firstname > < author_country > <! [CDATA [author]] > < / author_lastname >
< author_email > <! [CDATA [[email protected]]] > < / author_email >
< author_data_01 > <! [CDATA []] > < / author_data_01 >
< author_data_02 > <! [CDATA []] > < / author_data_02 >
< items >
< article_item >
< article_id > <! [CDATA [123456]] > < / article_id >
< publication > <! [CDATA [Al Bayan]] > < / publication >
< section > <! [CDATA [Local]] > < / section >
< issue_date > <! [CDATA [11/11/2015]] > < / issue_date >
< page > <! [CDATA [2]] > < / print this page >
< article_title > <! [CDATA [title.]] > < / article_title > < number_of_words > <! [CDATA [165]] > < / number_of_words >
< original_price > <! [CDATA [200]] > < / original_price >
< original_price_currency > <! [CDATA [DEA]] > < / original_price_currency >
< price > <! [CDATA [250]] > < / price >
< price_currency > <! [CDATA [DEA]] > < / price_currency >
< / article_item >
< / articles >
< total_amount > <! [CDATA [250]] > < / total_amount >
< total_amount_currency > <! [CDATA [DEA]] > < / total_amount_currency >
< / author >
< / xml >
Thanks in advance,
Suman
XMLTABLE using...
SQL > ed
A written file afiedt.buf1 with t (xml) as (select xmltype ('))
2 ") of the double)"
3
4
5
6
7
8
9
10
11
[[12[email protected]]] >
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34-
35 end of sample data
36-
37 - assumptions:
(38 - a) XML may have several tags
(39 - b) eachmay contain more
40-
41 select x.gen_by, x.gen_date, x.mn, x.yr
42, y.author, y.auth_fn, y.auth_ln, y.auth_cnt, y.auth_em, y.auth_d1, y.auth_d2
43, z.id, z.pub, z.sec, z.iss_dt, z.pg, z.art_ttl, z.num_wrds, z.oprice, z.ocurr, z.price, z.curr
44 t
45, xmltable ('/ authxml')
from $ 46 t.xml
path of 47 columns gen_date varchar2 (10) '. / generation_date'
48, path of varchar2 (15) of gen_by '. / generated_by'
49, path of varchar2 (4) year '. "/ year"
50 varchar2 (2) mn road '. "/ month"
51, path of xmltype authors '.'
52 ) x
53, xmltable ('/ authxml/authors ')
from $ 54 x.authors
author of 55 path of varchar2 columns (15) '. / author'
56, path of varchar2 (10) of auth_fn '. / author_firstname'
57, path of varchar2 (10) of auth_ln '. / author_lastname'
58 road of VARCHAR2 (3) auth_cnt '. / author_country'
59 road of varchar2 (20) of auth_em '. / author_email'
60 road of varchar2 (5) of auth_d1 '. / author_data_01'
61, path of varchar2 (5) of auth_d2 '. / author_data_02'
62, path of xmltype articles '. / Articles'
63 ) y
64, xmltable ('/ Articles/article_item ')
from $ 65 y.articles
path id 66 number columns '. / article_id'
67, path of varchar2 (10) pub '. ' / publication.
68 road of varchar2 (10) dry '. / section'
69, path of varchar2 (10) of iss_dt '. / issue_date'
70 road of VARCHAR2 (3) pg '. "/ print this page"
71, path of varchar2 (20) of art_ttl '. / article_title'
72, path of varchar2 (5) of num_wrds '. / number_of_words'
73, path of varchar2 (5) of oprice '. / original_price'
74 road to VARCHAR2 (3) ocurr '. / original_price_currency'
75, path of varchar2 (5) price '. "/ price"
76, path of VARCHAR2 (3) curr '. / price_currency'
77* ) z
SQL > /.GEN_DATE GEN_BY YEAR MN AUTHOR AUTH_FN AUTH_LN AUT AUTH_EM AUTH_ AUTH_ ID PUB DRY ISS_DT PG ART_TTL NUM_W OPRIC HEARTS PRICE OCU
---------- --------------- ---- -- --------------- ---------- ---------- --- -------------------- ----- ----- ---------- ---------- ---------- ---------- --- -------------------- ----- ----- --- ----- ---
17/11/2015 Admin Admin 2015 01 user author user author [email protected] 123456 UAE Al Bayan Local 11/11/2015 2 is the title. 165 200 AED AED 250Of course, you'll want to change the types of data, etc. as needed.
I assumed that the XML can contain several "
" sections and that each section can contain several entries. Thus the XMLTABLE aliasing as 'x' gives information of XML, and supplies the data associated with the XMLTABLE with alias 'y' which gets the multiple authors, which itself
section of the XMLTABLE with alias 'z' for each of the article_item. CDATA stuff are handled automatically by SQLX (XML functionality integrated into Oracle's SQL)
-
"missing the SELECT keyword" error during an insert into the temporary table using the blob value
I'm trying to insert into an oracle temp table using select that retrieves data from a blob field but I get the error: "lack the SELECT keyword.
How we store temporary in oracle result when we make this type of operation (extraction of data in fields and try to load them into a separate table on the fly.?)
with cte as)
Select user_id, utl_raw.cast_to_varchar2 (dbms_lob.substr (PREFERENCES)) as USER my_blob
)
create table new_table as
SELECT user_id,EXTRACTvalue(xmltype(e.my_blob),'/preferences/locale') regional settings
E ETC
----------------------------------------------------------------------------------
BLOB data - value - which is
<? XML version = "1.0" encoding = "ISO-8859-1" ?>
- < Preferences >< time zone > America/New_York < / > zone< displayscheduleinusertimezone > Y < / displayscheduleinusertimezone >< local > Spanish < /locale >< DateFormat > JJ/mm/aaaa < / DateFormat >< timeFormat > hh: mm aaa < / timeFormat >< longformat > Long_01 < / longformat >< doubleformat > Double_01 < / doubleformat >< percentformat > Percentage_01 < / percentformat >< currencyformat > Currency_01 < / currencyformat >< / Preferences >
A WITH clause that must immediately precede the SELECT keyword:
SQL > create table t:
2 with the o as (select double dummy)
3 select * West longitude;
Table created.
-
Hello
Can read XML and the insertion/upgrade to update / delete any table?
Assumes that the XML is stored in a column
Is there something similar loan?
With the help of:
Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE Production 11.2.0.4.0
AMT for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - ProductionA few ideas, using DBMS_XMLSTORE:
SQL> create table table2 (code varchar2(30) primary key, dt_ini date, aliq_pis number); Table created. SQL> SQL> create or replace procedure merge_record (p_rec in xmltype) 2 is 3 4 cursor c_tab_cols (p_table_name in varchar2) 5 is 6 with pk_cols (column_name) as ( 7 select column_name 8 from user_cons_columns 9 where constraint_name = ( 10 select constraint_name 11 from user_constraints 12 where table_name = p_table_name 13 and constraint_type = 'P' 14 ) 15 ) 16 select tc.column_name 17 , nvl2(cc.column_name, 'Y', 'N') as is_pk 18 from user_tab_cols tc 19 left outer join pk_cols cc on cc.column_name = tc.column_name 20 where tc.table_name = p_table_name 21 and tc.virtual_column = 'NO' ; 22 23 tab_name user_tables.table_name%type; 24 ctx dbms_xmlstore.ctxHandle; 25 numrows number; 26 27 begin 28 29 -- get embedded table name 30 select xmlcast(xmlquery('/TABLE/@tableName' passing p_rec returning content) as varchar2(30)) 31 into tab_name 32 from dual; 33 34 -- set target table 35 ctx := dbms_xmlstore.newContext(tab_name); 36 -- and row tag name 37 dbms_xmlstore.setRowTag(ctx, 'TABLE'); 38 39 -- set columns to update 40 for r in c_tab_cols (tab_name) loop 41 dbms_xmlstore.setUpdateColumn(ctx, r.column_name); 42 if r.is_pk = 'Y' then 43 dbms_xmlstore.setKeyColumn(ctx, r.column_name); 44 end if; 45 end loop; 46 47 -- set date format 48 execute immediate 'alter session set nls_date_format = "YYYY-MM-DD"'; 49 50 -- update 51 numrows := dbms_xmlstore.updateXML(ctx, p_rec); 52 53 -- if no row updated, try insert 54 if numrows = 0 then 55 dbms_xmlstore.clearKeyColumnList(ctx); 56 numrows := dbms_xmlstore.insertXML(ctx, p_rec); 57 end if; 58 59 dbms_xmlstore.closeContext(ctx); 60 61 end; 62 / Procedure created. SQL> SQL> SQL> exec merge_record(xmltype('
')) PL/SQL procedure successfully completed. SQL> select * from table2; CODE DT_INI ALIQ_PIS ------------------------------ ----------- ---------- 2009.70.01 01/01/2007 3 SQL> exec merge_record(xmltype('2009.70.01
2007-01-01 3
')) PL/SQL procedure successfully completed. SQL> exec merge_record(xmltype('2009.70.01
2007-01-01 1
')) PL/SQL procedure successfully completed. SQL> select * from table2; CODE DT_INI ALIQ_PIS ------------------------------ ----------- ---------- 2009.70.01 01/01/2007 1 2009.70.02 01/01/2007 12009.70.02
2007-01-01 1 -
How do I get the table cells?
It's my get code that any object in propagation.
Int32 childCount = parent-> GetChildCount();
for (int32 /IndexEnfant = 0; childIndex < childCount; /IndexEnfant ++)
{
InterfacePtr < IHierarchy > child (parent-> QueryChild (childIndex));
ChildUIDRef = UIDRef: GetUIDRef (child);
TextFrame table
}
How do I get the table cells?
You can access the table using ITableModel and GridAddresscell.
But to get to the ITableModel since ITextModel implies some complexity.
Few things to understand:
-L'interface that corresponds to the written document is ITextModel
-The recommended method to iterate tables in a story done by ITextStoryThreadDictHier
-Get the ITextStoryThreadDictHier on the history and the main thread as ITextStoryThreadDictHier::NextUID()
-Now get ITextStoryThreadDict for UID and query for ITableModel. If you get ITableModel, then you have found the table.
Once you have ITableModel you can get ITableCell as follows:
ITableModel:QueryCellContentBoss(GridAddress); Give ITableCell
You can refer to SnipperRunner (SnpManipulateTextModel).
Download text template table model:
InterfacePtr
textModel (storyUIDRef, UseDefaultIID()); InterfacePtr
textStoryDictHier (textModel, UseDefaultIID()); NextUID UID = sourceStory.GetUID (); / / Download the main thread dictionary
Now loop the dicthier to iterate through all the threads dicts.
InterfacePtr
textStoryThreadDict (sourceStory.GetDataBase (), nextUID, UseDefaultIID()); InterfacePtr
tableModel (textStoryThreadDict, UseDefaultIID()); If (tableModel) / / the storythreaddict represents a table
{
You are now in a table
}
-
How to get Nested table function
Hi friends,
In a package, I created a nested table type name Varchar2 EmployeeCodeList.
Then, I created a function whose return type is EmployeeCodeList. But I don't get how to get the values of this function?
TYPE EmployeeCodeList IS TABLE OF THE VARCHAR2 (30);
FUNCTION GenerateRandomEcF (Ec_length NUMBER, NumberOfEmp NUMBER)
< < the function code > >
RETURN v_RandomEmpCodes; END GenerateRandomEcF;
PROCEDURE GenerateEmpFile (NumberOfEmp NUMBER, Start_SN NUMBER, EmpValue NUMBER, VARCHAR2, VARCHAR2, Ec_length NUMBER EmpGroup HireDate) IS
v_Filename VARCHAR2 (40);
v_EmployeeCodes EmployeeCodeList;
v_EmpBatchF UTL_FILE. TYPE_DE_FICHIER;
BEGIN
v_Filename: = 'EMPLOYEE_BATCH_ ' | TO_CHAR (SYSTIMESTAMP, 'YYYYMMDD_HHMISS'): '. DAT';
v_EmployeeCodes: = EmployeeCodeList (NumberOfEmp);
v_EmployeeCodes: = SELECT * FROM TABLE (GenerateRandomAcF (Ac_length, NumberOfVoucher));
v_EmpBatchF: = UTL_FILE. FOPEN ('EXT_VOUCHER_DIR', v_Filename, 'W');
IF UTL_FILE.IS_OPEN (v_EmpBatchF) THEN
FOR i IN 1.NumberOfVoucher LOOP
UTL_FILE. Put_line (v_EmpBatchF, v_EmployeeCodes (i) |) ',' || Start_SN + (i-1). «, » || EmpValue | «, » || HireDate. «, » || EmpGroup);
END LOOP;
END IF;
END GenerateEmpFile;
How the line highlighted code above must be written so that I can get value of function in a variable of the same type of nested table.
If you use the second approach, I mean
56 v_EmployeeCodes: = GenerateRandomAcF (Ac_length, NumberOfEmployee);
then the collection must be initialized using the constructor method. Change line 33.48 as number below
33 v_RandomEmployeeCodes EmployeeCodeList: = EmployeeCodeList();
48 v_EmployeeCodes EmployeeCodeList: = EmployeeCodeList();
This is because when you use BULK COLLECT, Oracle automatically populates the collection without initialization. But if you do not COLLECT in BULK, then the collection must be initialized before filling / extending. Otherwise, you will get error of REFERENCE to the COLLECTION that is not INITIALIZED. So this should be the code, you should use. When you do not select... INTO, you might well declare the function is private and it is not necessary to declare in the package specification.
SQL > CREATE OR REPLACE PACKAGE BODY GenerateEmployeePackage AS
2 PROCEDURE Get_AC_Range (Ac_length NUMBER, Range_Start SERIES, certain Range_End NUMBER)
3 EAST
4 BEGIN
5 If Ac_length = 8 THEN
6 Range_Start: = 10000000;
7 Range_End: = 99999999;
8 Ac_length ELSIF = 9 THEN
9 Range_Start: = 100000000;
10 Range_End: = 999999999;
11 Ac_length ELSIF = 10 THEN
12 Range_Start: = 1000000000;
13 Range_End: = 9999999999;
14 Ac_length ELSIF = 11 THEN
15 Range_Start: = 10000000000;
16 Range_End: = 99999999999;
17 ELSIF Ac_length = 12 THEN
18 Range_Start: = 100000000000;
19 Range_End: = 999999999999;
20 Ac_length ELSIF = 13 THEN
21 Range_Start: = 1000000000000;
22 Range_End: = 9999999999999;
23 Ac_length ELSIF = 14 THEN
24 Range_Start: = 10000000000000;
25 Range_End: = 99999999999999;
26 END IF;
27 END Get_AC_Range;
28
GenerateRandomAcF FUNCTION 29 (Ac_length NUMBER, NumberOfEmployee NUMBER)
30 BACK IS EmployeeCodeList
31 NUMBER Range_Start;
32 Range_End NUMBER;
33 v_RandomEmployeeCodes EmployeeCodeList: = EmployeeCodeList ();
BEGIN 34
35 Get_AC_Range (Ac_length, Range_Start, Range_End);
36 v_RandomEmployeeCodes.extend (NumberOfEmployee);
37
38 FOR I IN 1.NumberOfEmployee LOOP
39 v_RandomEmployeeCodes (i): = TRUNC (DBMS_RANDOM.value (down-online Range_Start, high-online Range_End));
40 END LOOP;
41
42 v_RandomEmployeeCodes RETURN;
43
END 44 GenerateRandomAcF;
45
GenerateEmployeeFile PROCEDURE 46 (NumberOfEmployee NUMBER of Start_SN NUMBER, EmployeeValue NUMBER, displayed EmployeeGroup VARCHAR2, VARCHAR2, Ac_length NUMBER) IS
47 v_Filename VARCHAR2 (40);
48 v_EmployeeCodes EmployeeCodeList: = EmployeeCodeList ();
49 v_EmployeeBatchF UTL_FILE. TYPE_DE_FICHIER;
BEGIN 50
51 v_Filename: = 'Employee_BATCH_ ' | TO_CHAR (SYSTIMESTAMP, 'YYYYMMDD_HHMISS'): '. DAT';
52 v_EmployeeCodes: = EmployeeCodeList();
53
54 get nested table function
55 - SELECT * COLLECT in BULK IN TABLE v_EmployeeCodes (GenerateRandomAcF (Ac_length, NumberOfEmployee));
56 v_EmployeeCodes: = GenerateRandomAcF (Ac_length, NumberOfEmployee);
57 v_EmployeeBatchF: = UTL_FILE. FOPEN ('EXT_Employee_DIR', v_Filename, 'W');
58
59 if UTL_FILE.IS_OPEN (v_EmployeeBatchF) THEN
60. FOR i IN v_EmployeeCodes.FIRST... v_EmployeeCodes.Last LOOP
UTL_FILE 61. Put_line (v_EmployeeBatchF, v_EmployeeCodes (i) |) ',' || (Start_SN + (i-1)). «, » || EmployeeValue | «, » || Posted | «, » || EmployeeGroup);
LOOP END 62;
63 END IF;
64
END 65 GenerateEmployeeFile;
66
END 67 GenerateEmployeePackage;
68.
-
Create the table using check constraints
I am trying to create a table with the following sql statement.
CREATE TABLE suppliers
(
supplier_id NULL NUMERIC (4).
supplier_name NULL VARCHAR2 (50).
Date1 DATE NULL,.
date2 DATE NULL CONSTRAINT CHECK check_date (date1 > date2)
);
I am gettign the following error
"ORA-02438: column check constraint cannot reference other columns.
How can I get this red using a trigger.
Help, pleaseSimply, you missed a comma after your last column and constraint.
ME_XE?CREATE TABLE suppliers 2 ( 3 supplier_id NUMERIC(4) NULL , 4 supplier_name VARCHAR2(50) NULL , 5 date1 DATE NULL , 6 date2 DATE NULL , 7 CONSTRAINT check_date CHECK (date1 > date2) 8 ); Table created. Elapsed: 00:00:00.04
-
How can I get Indesign Table of contents gap filler?
I will have no problem getting my table of contents to come out exactly as I expect to see - BUT -
How can I get periods just to fill the space between the word/chapter title and page number?
All the tutorials I see show them already in place. Mine come out blank or if I place in the model, it comes out with just how much I place - not plus-pas less. The chapter titles are words of different length and I want to the table of contents to finish in two columns justified.
I know it's simple, no doubt, but I can't seem to find the answer anywhere Please help!
If you want the traditional Chief, open your box of paragraph TOC style dialogueOptions legends and move on to the screen. This is when you set the position of the tab and the leader.
I prefer to use the underline myself. Note that the field Style drop-down menu beside where you have your ^ t.? In this area, select 'New Style' (in CS4, for earlier versions, you must exit the dialog Table of contents and first to define the character style) and create a style of character called underlined tab or something equally as descriptive. The only attribute of the style should add the underline. In the example below, I put the underscore for pt.5 Japanese points which are faces that the leader is created with a period or style of ordinary dotted outline. Ihaven can't included any offset, underscore appears on the baseline. You can change what you want, make sure the check box is on, not gray.
Another thing that I would change, if you use the feature of underscores, is to replace your tab (which is a fixed position) with a tabulation of withdrawal right (metacharacter is ^, but you can select it from the drop-down list). A tabulation of withdrawal right is always on the far right in a column, even if you change the column width to a later date. Ordinary tabs do not move if you change the column. Using this method you would not a tab located in the paragraph style.
-
Load the data from a text file into a table using pl/sql
Hi Experts,
I want to load the data from a text file (sample1.txt) to a table using pl/sql
I used the pl/sql code below
***********************************
declare
f utl_file.file_type;
s varchar2 (200);
c number: = 0;
Start
f: = utl_file.fopen('TRY','sample1.txt','R');
loop
UTL_FILE.get_line (f, s);
insert into sampletable (a, b, c) values (s, s, s);
c: = c + 1;
end loop;
exception
When NO_DATA_FOUND then
UTL_FILE.fclose (f);
dbms_output.put_line('No. deles de lignes insérées: ' || c);
end;
***************************************
and my sample1.txt file looks like
***************************************
1
2
3
***************************************
Gets the data inserted, with way below
Select * from sampletable;
A, B AND C
1-1-1
2-2-2
3 3 3
I want that data to get inserted as
A, B AND C
1 2 3
The text file I have is to have three lines, and the first value of each line should go to each column
Help, please...
Thank youdeclare f utl_file.file_type; s1 varchar2(200); s2 varchar2(200); s3 varchar2(200); c number := 0; begin f := utl_file.fopen('TRY','sample1.txt','R'); utl_file.get_line(f,s1); utl_file.get_line(f,s2); utl_file.get_line(f,s3); insert into sampletable (a,b,c) values (s1,s2,s3); c := c + 1; utl_file.fclose(f); exception when NO_DATA_FOUND then if utl_file.is_open(f) then utl_file.fclose(f); ens if; dbms_output.put_line('No. of rows inserted : ' || c); end;
SY.
-
CFScript to create tables (using MySQL) and configure it to use InnoDB
I use a cfscript to create my database and the tables using MySQL, and I was able to DO this with success, accept that I'm having a problem. I want to put my tables use InnoDB instead of MyISAM. How to do this?
That's what I did:
< cfquery = 'test' datasource name = 'mydatasource' >
CREATE TABLE Test
(
Id int (11) NOT NULL auto_increment,
Name varchar (20) default NULL,
Tinyint (4) active default NULL,
PRIMARY KEY (Id)
); ENGINE = InnoDB DEFAULT CHARSET = latin;
< / cfquery >
But when I get an error when I run this script. That's what I get:
-You have an error in your SQL syntax; "check the manual for your version of the MySQL server for the right syntax to use near '; ENGINE = InnoDB DEFAULT CHARSET = latin1'.
I look and it's the right syntax. Any ideas what I am doing wrong?
Thanks for any help
AlfieNevermind, I figured it. I misspelled it.
ENGINE type = InnoDB... must be before the semicolon.
:)
-
Creating external Tables using the EXECUTE IMMEDIATE in PL/SQL
Hi guys,.
I am trying to create an external Table using the EXECUTE IMMEDIATE in a procedure and I managed to compile and no errors were generated. But when I try to run it from sql using the exec command I get the following error:
------------------------------------------------------------------------
ERROR on line 5:
ORA-00911: invalid character
ORA-06512: at "GEO. TEST_DDL', line 4
ORA-06512: at line 5
-------------------------------------------------------------------------
I tried to check the whole statement to create the external table, but I can't find where is the error. Surprisingly, if I simply run the command table create external on sqlplus it works, but not a procedure.
If anyone can help with ideas or experience?
Geoffrey KossamiThe error means that there is an identifier somewhere that starts with a nonalphanumeric. This is a typical mistake of editing. A procedure compiles correctly is not of course because the underlying dynamic sql running is OK. Which of course only be resolved when you try to run it.
There is certainly a problem with the text you provide to be run as a piece of dynamic sql code. You should try to watch it with dbms_output and run this code in sqlplus. But your problem is with the code you run as dynamic PL/SQL, it is not itself compilable.
Jack
-
Trying to create the table using Clause any Union with Select multiple stmts
The motion seeks to get the substring of the value to for example.
If the value is * ASA 2 * then so do ASA
where as if the value is * 1.5 TST * it sholud come as TST as wise for others too.
I am trying to execute stmt SQL written but in error as below:
* ' ORA-00998 must appoint this expression with the alias column 00998.00000 - must appoint this expression with the column alias. "
CREATE TABLE TEST_CARE AS
(
SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
WHERE LENGTH (old_care_lvl) = 5
UNION ALL
SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
WHERE LENGTH (old_care_lvl) = 7
UNION ALL
SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
WHERE LENGTH (old_care_lvl) = 14
UNION ALL
Row_id SELECT, old_care_lvl, SUBSTR (old_care_lvl, 3), LEN test_care_lvl
WHERE LENGTH = 7 AND old_care_lvl (old_care_lvl) = "Regular."
);
I want to create the table using the above given the multiple selection by using the Union ALL clause, but trying to create run query error like "ORA-00998 must appoint this expression with the alias column 00998.00000 - must appoint this expression with the column alias.
Please guide me how to approach to solve this problem.
Thanks in advance.Try this->
CREATE TABLE TEST_CARE AS select * from ( SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl WHERE LENGTH(old_care_lvl) =5 UNION ALL SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl WHERE LENGTH(old_care_lvl) =7 UNION ALL SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl WHERE LENGTH(old_care_lvl) =14 UNION ALL SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3),LEN FROM test_care_lvl WHERE LENGTH(old_care_lvl) =7 AND old_care_lvl ='Regular' );
N.B.: Not tested...
Kind regards.
LOULOU.
Maybe you are looking for
-
Satellite A200 - crashes all the time
I have a 3 years Satellite A200, great machine until about 3 months ago, when he started crashing randomly. The first time, I'm sure it froze just where it was, but after that the screen would just be black. It happened more often and a lot to restar
-
Apple hijacked my worksheets?--
I used my Numbers worksheets, two days ago. No prob. Today, I'm trying to update my work, and Apple does not allow me to access my spreadsheets. Apparently, Apple forced an upgrade of my application of numbers and does not allow me to use my workshe
-
Installation of KB2686509 and get the error 0xF0F4 (WinXP SP3 integrated)
I have a number of point of sales systems that we are trying to get updated, and while any other update installed correctly, this last updated simply won't be installed. -FaultyKeyboard.log file is generated and consists of a single entry: kbd106.dll
-
Due to the upgrade of my e260v1 to a rocket: Questions
1 East-album art embedded in mp3 OK screen? 2. any report of battery failure? 3. we find the headphone down to be annoying? 4 how voice recording works on the "rocket"? 5 GoList several or a single as the old series e200? Thanks in advance BlackDog
-
Increasing Explorador Web Internet Explorer
MI PC no me already run the Cámara tiene incorporada, sell me a recuadro that are TR deseo run, ares of el como cuando ejecutas for example, if mi respuesta, y nunca llega has run.