1. Christian Breu
  2. Valentina Server
  3. Monday, July 08 2019, 06:04 PM
  4.  Subscribe via email
I am not sure anymore. I thought to import records from a text file I can do anything like...
SELECT table.column AS textfilecolumn to map the columns of my textfile to the columns of my table.
But seems I missunderstood anything.

How is it officially – possible or not?
Comment
There are no comments made yet.
Ivan Smahin Accepted Answer
If you are about of import-file columns mapping to the table's columns you should do something like this one -
make the cursor (over target table) with the column order matched to the import-file's one.

Example:
CREATE TABLE t1 ( f1 LONG, f2 STRING );

-- Import file:
"Some_text_data" 1
"Another_string_data" 2
...

-- Cursor:
SELECT f2, f1 FROM t1;

-- Do the import:
cursor.Import(....

If import-file has the header (column names), it makes no changes to your sql-query!
Actually, that header is not used for mapping. In other words, you can ask user "What the table's field is corresponded to the import-file's column number 1?".
But having such header you may ask it in more natural way - "What the table's field is corresponded to the import-file's column column1?". But you know, that "column1" is the first column in the import-file.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 1
Christian Breu Accepted Answer
Thank you for your answer Ivan.
Would it not be a great o have a column mapping by headers of the import file and get position-independent??!!
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 2
Christian Breu Accepted Answer
sorry, I mean a great feature request...
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories