Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Load data file into ASA database

11 posts in General Discussion Last posting was on 2003-11-20 16:54:21.0Z
Jean Posted on 2003-11-12 21:25:17.0Z
From: "Jean" <j.wang@csdcsystems.com>
Newsgroups: ianywhere.public.general
Organization: 209.250.153.21
X-Newsreader: AspNNTP 1.50 (Tri Hoang)
Subject: Load data file into ASA database
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: transinc-win02.netoptex.com
X-Original-NNTP-Posting-Host: transinc-win02.netoptex.com
Message-ID: <3fb2a53d$1@forums-1-dub>
Date: 12 Nov 2003 13:25:17 -0800
X-Trace: forums-1-dub 1068672317 206.169.167.22 (12 Nov 2003 13:25:17 -0800)
X-Original-Trace: 12 Nov 2003 13:25:17 -0800, transinc-win02.netoptex.com
Lines: 14
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2063
Article PK: 4280

Hi! There;

We need to insert data into Adaptive Server Anywhere database. The data are
retrieved from one of three dbms (Oracle, Informix, SQL server)and saved as the
data files(could be Comma separated file or ASCII file) daily triggered by Power
Builder application. I am wondering if there is an utility for this purpose.
Then we could Run the utility from Power Builder.

Your help will be very appreciated.

Jean

---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp


Bob Melcos Posted on 2003-11-12 22:02:00.0Z
Sender: 18d4.3fb2add7.1804289383@sybase.com
From: Bob Melcos
Newsgroups: ianywhere.public.general
Subject: Re: Load data file into ASA database
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <3fb2add8.18d4.1681692777@sybase.com>
References: <3fb2a53d$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 12 Nov 2003 14:02:00 -0800
X-Trace: forums-1-dub 1068674520 10.22.241.41 (12 Nov 2003 14:02:00 -0800)
X-Original-Trace: 12 Nov 2003 14:02:00 -0800, 10.22.241.41
Lines: 27
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2065
Article PK: 4282

Hi:

We used an application called DataLoad several years ago
when we built PowerBuilder applications. Try them at
http://www.dataload.net/

I am not assoicated with them in any form or shape but have
used their product. I am not even sure if they are still out
there.

Good luck.

> Hi! There;
>
> We need to insert data into Adaptive Server Anywhere
> database. The data are retrieved from one of three dbms
> (Oracle, Informix, SQL server)and saved as the data
> files(could be Comma separated file or ASCII file) daily
> triggered by Power Builder application. I am wondering if
> there is an utility for this purpose. Then we could Run
> the utility from Power Builder.
>
> Your help will be very appreciated.
>
> Jean
>
> ---== Posted via the PFCGuide Web Newsreader ==---
> http://www.pfcguide.com/_newsgroups/group_list.asp


Jean Posted on 2003-11-13 16:15:49.0Z
From: "Jean" <j.wang@csdcsystems.com>
Newsgroups: ianywhere.public.general
Organization: 209.250.153.21
References: <3fb2a53d$1@forums-1-dub> <3fb2add8.18d4.1681692777@sybase.com>
X-Newsreader: AspNNTP 1.50 (Tri Hoang)
Subject: Re: Load data file into ASA database
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: transinc-win02.netoptex.com
X-Original-NNTP-Posting-Host: transinc-win02.netoptex.com
Message-ID: <3fb3ae35$2@forums-1-dub>
Date: 13 Nov 2003 08:15:49 -0800
X-Trace: forums-1-dub 1068740149 206.169.167.22 (13 Nov 2003 08:15:49 -0800)
X-Original-Trace: 13 Nov 2003 08:15:49 -0800, transinc-win02.netoptex.com
Lines: 45
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2075
Article PK: 4291

Hi! Bob;

Thank you for your help. I think that DataLoad only works for Load data into
Oracle database. I need to load data into Adaptive Server Anywhere database from
data files saved. Those data are retrieved form Informix, Oracle and SQL server
database.

Any suggestions?

Regards;

Jean



On 12 Nov 2003 14:02:00 -0800,
in ianywhere.public.general

<Bob Melcos> wrote:
>Hi:
>
>We used an application called DataLoad several years ago
>when we built PowerBuilder applications. Try them at
>http://www.dataload.net/
>
>I am not assoicated with them in any form or shape but have
>used their product. I am not even sure if they are still out
>there.
>
>Good luck.
>> Hi! There;
>>
>> We need to insert data into Adaptive Server Anywhere
>> database. The data are retrieved from one of three dbms
>> (Oracle, Informix, SQL server)and saved as the data
>> files(could be Comma separated file or ASCII file) daily
>> triggered by Power Builder application. I am wondering if
>> there is an utility for this purpose. Then we could Run
>> the utility from Power Builder.
>>
>> Your help will be very appreciated.
>>
>> Jean
>>
>> ---== Posted via the PFCGuide Web Newsreader ==---
>> http://www.pfcguide.com/_newsgroups/group_list.asp


Breck Carter [TeamSybase] Posted on 2003-11-12 23:12:58.0Z
From: "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: Load data file into ASA database
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <8ve5rvco1pd0n4lipa83frcr70gqbu48mm@4ax.com>
References: <3fb2a53d$1@forums-1-dub>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
X-Original-Trace: 12 Nov 2003 15:18:25 -0800, bcarter.sentex.ca
Lines: 27
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 12 Nov 2003 15:03:55 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 12 Nov 2003 15:12:58 -0800
X-Trace: forums-1-dub 1068678778 10.22.108.75 (12 Nov 2003 15:12:58 -0800)
X-Original-Trace: 12 Nov 2003 15:12:58 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2068
Article PK: 4286

The LOAD TABLE statement is quite flexible and VERY fast.

What version/build are you using?

Breck

On 12 Nov 2003 13:25:17 -0800, "Jean" <j.wang@csdcsystems.com> wrote:

>Hi! There;
>
>We need to insert data into Adaptive Server Anywhere database. The data are
>retrieved from one of three dbms (Oracle, Informix, SQL server)and saved as the
>data files(could be Comma separated file or ASCII file) daily triggered by Power
>Builder application. I am wondering if there is an utility for this purpose.
>Then we could Run the utility from Power Builder.
>
>Your help will be very appreciated.
>
>Jean
>
>---== Posted via the PFCGuide Web Newsreader ==---
>http://www.pfcguide.com/_newsgroups/group_list.asp

--
bcarter@risingroad.com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com


Jean Posted on 2003-11-13 15:57:34.0Z
From: "Jean" <j.wang@csdcsystems.com>
Newsgroups: ianywhere.public.general
Organization: 209.250.153.21
References: <3fb2a53d$1@forums-1-dub> <8ve5rvco1pd0n4lipa83frcr70gqbu48mm@4ax.com>
X-Newsreader: AspNNTP 1.50 (Tri Hoang)
Subject: Re: Load data file into ASA database
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: transinc-win02.netoptex.com
X-Original-NNTP-Posting-Host: transinc-win02.netoptex.com
Message-ID: <3fb3a9ee$1@forums-1-dub>
Date: 13 Nov 2003 07:57:34 -0800
X-Trace: forums-1-dub 1068739054 206.169.167.22 (13 Nov 2003 07:57:34 -0800)
X-Original-Trace: 13 Nov 2003 07:57:34 -0800, transinc-win02.netoptex.com
Lines: 47
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2074
Article PK: 4290

Hi!Breck,

Thank you very much for your reply. I user Powerbuilder version 7.0.3 and build
10135 now. We also have Powerbuilder version 9.0 build 5.07. I am using Adaptive
Server Anywhere 9.0.0(1108)

It is better that we only insert part of tables into ASA database from one of
three dbms, not whole tables. Also, ASA dose not support Informix. Any
suggestions?

Regards;

Jean


On 12 Nov 2003 15:12:58 -0800,
in ianywhere.public.general

Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>The LOAD TABLE statement is quite flexible and VERY fast.
>
>What version/build are you using?
>
>Breck
>
>On 12 Nov 2003 13:25:17 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>
>>Hi! There;
>>
>>We need to insert data into Adaptive Server Anywhere database. The data are
>>retrieved from one of three dbms (Oracle, Informix, SQL server)and saved as
the
>>data files(could be Comma separated file or ASCII file) daily triggered by
Power
>>Builder application. I am wondering if there is an utility for this purpose.
>>Then we could Run the utility from Power Builder.
>>
>>Your help will be very appreciated.
>>
>>Jean
>>
>>---== Posted via the PFCGuide Web Newsreader ==---
>>http://www.pfcguide.com/_newsgroups/group_list.asp
>
>--
>bcarter@risingroad.com
>Mobile and Distributed Enterprise Database Applications
>www.risingroad.com


Breck Carter [TeamSybase] Posted on 2003-11-13 17:47:41.0Z
From: "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: Load data file into ASA database
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <n2g7rvgbd83hrckcnbup8dp46keroeb46n@4ax.com>
References: <3fb2a53d$1@forums-1-dub> <8ve5rvco1pd0n4lipa83frcr70gqbu48mm@4ax.com> <3fb3a9ee$1@forums-1-dub>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
X-Original-Trace: 13 Nov 2003 09:53:12 -0800, bcarter.sentex.ca
Lines: 73
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 13 Nov 2003 09:38:34 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 13 Nov 2003 09:47:41 -0800
X-Trace: forums-1-dub 1068745661 10.22.108.75 (13 Nov 2003 09:47:41 -0800)
X-Original-Trace: 13 Nov 2003 09:47:41 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2077
Article PK: 4293

If you can "unload" part or all of the source tables into text files,
you can use LOAD TABLE to load those files. Or use the PB pipeline.

Tip: You can LOAD TABLE into a temporary table, and then
INSERT...SELECT from that table over to a permanent one, if that makes
your life easier.

Please explain *exactly* what you want to do and folks may have
suggestions.

Also, have a look at this chapter in the ASA 9 Help:

=====
ASA SQL User's Guide
Importing and Exporting Data
=====

Breck

On 13 Nov 2003 07:57:34 -0800, "Jean" <j.wang@csdcsystems.com> wrote:

>Hi!Breck,
>
>Thank you very much for your reply. I user Powerbuilder version 7.0.3 and build
>10135 now. We also have Powerbuilder version 9.0 build 5.07. I am using Adaptive
>Server Anywhere 9.0.0(1108)
>
>It is better that we only insert part of tables into ASA database from one of
>three dbms, not whole tables. Also, ASA dose not support Informix. Any
>suggestions?
>
>Regards;
>
>Jean
>
>
>On 12 Nov 2003 15:12:58 -0800,
> in ianywhere.public.general
>Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>>The LOAD TABLE statement is quite flexible and VERY fast.
>>
>>What version/build are you using?
>>
>>Breck
>>
>>On 12 Nov 2003 13:25:17 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>>
>>>Hi! There;
>>>
>>>We need to insert data into Adaptive Server Anywhere database. The data are
>>>retrieved from one of three dbms (Oracle, Informix, SQL server)and saved as
>the
>>>data files(could be Comma separated file or ASCII file) daily triggered by
>Power
>>>Builder application. I am wondering if there is an utility for this purpose.
>>>Then we could Run the utility from Power Builder.
>>>
>>>Your help will be very appreciated.
>>>
>>>Jean
>>>
>>>---== Posted via the PFCGuide Web Newsreader ==---
>>>http://www.pfcguide.com/_newsgroups/group_list.asp
>>
>>--
>>bcarter@risingroad.com
>>Mobile and Distributed Enterprise Database Applications
>>www.risingroad.com

--
bcarter@risingroad.com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com


Jean Posted on 2003-11-13 18:41:58.0Z
From: "Jean" <j.wang@csdcsystems.com>
Newsgroups: ianywhere.public.general
Organization: 209.250.153.21
References: <3fb2a53d$1@forums-1-dub> <8ve5rvco1pd0n4lipa83frcr70gqbu48mm@4ax.com> <3fb3a9ee$1@forums-1-dub> <n2g7rvgbd83hrckcnbup8dp46keroeb46n@4ax.com>
X-Newsreader: AspNNTP 1.50 (Tri Hoang)
Subject: Re: Load data file into ASA database
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: transinc-win02.netoptex.com
X-Original-NNTP-Posting-Host: transinc-win02.netoptex.com
Message-ID: <3fb3d076$1@forums-1-dub>
Date: 13 Nov 2003 10:41:58 -0800
X-Trace: forums-1-dub 1068748918 206.169.167.22 (13 Nov 2003 10:41:58 -0800)
X-Original-Trace: 13 Nov 2003 10:41:58 -0800, transinc-win02.netoptex.com
Lines: 106
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2078
Article PK: 4295

Hi! Breck.

Thank you very much for your quick response.

I have looked the documentation of SQL Anywhere Studio 9.0.0 and found that
INPUT statement seems to work for my situation.

What I want to do is to have a smaller database in ASA from Oracle, or Informix,
or SQL server database. The data should be updated into ASA database daily
through our Power Builder application. I want to save the data, part of tables,
from one of big database into ASCII file, then load or input into ASA database
through Power Builder daily.

The reason that we needs smaller database in ASA is we are using ASA database as
our consolidate database for Mobile Link in our Palm project. Right now,
Informix is not supported for direct sync using Mobile Link. So we put data into
ASA from different dbms, then sync.

If you could give me an example or let me know where I can find an example how
to do LOAD TABLE or INPUT command from Power Builder (code from Power Builder),
I would appreciate it.

Thank you again.

Jean



On 13 Nov 2003 09:47:41 -0800,
in ianywhere.public.general

Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>If you can "unload" part or all of the source tables into text files,
>you can use LOAD TABLE to load those files. Or use the PB pipeline.
>
>Tip: You can LOAD TABLE into a temporary table, and then
>INSERT...SELECT from that table over to a permanent one, if that makes
>your life easier.
>
>Please explain *exactly* what you want to do and folks may have
>suggestions.
>
>Also, have a look at this chapter in the ASA 9 Help:
>
>=====
>ASA SQL User's Guide
> Importing and Exporting Data
>=====
>
>Breck
>
>On 13 Nov 2003 07:57:34 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>
>>Hi!Breck,
>>
>>Thank you very much for your reply. I user Powerbuilder version 7.0.3 and
build
>>10135 now. We also have Powerbuilder version 9.0 build 5.07. I am using
Adaptive
>>Server Anywhere 9.0.0(1108)
>>
>>It is better that we only insert part of tables into ASA database from one of
>>three dbms, not whole tables. Also, ASA dose not support Informix. Any
>>suggestions?
>>
>>Regards;
>>
>>Jean
>>
>>
>>On 12 Nov 2003 15:12:58 -0800,
>> in ianywhere.public.general
>>Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>>>The LOAD TABLE statement is quite flexible and VERY fast.
>>>
>>>What version/build are you using?
>>>
>>>Breck
>>>
>>>On 12 Nov 2003 13:25:17 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>>>
>>>>Hi! There;
>>>>
>>>>We need to insert data into Adaptive Server Anywhere database. The data are
>>>>retrieved from one of three dbms (Oracle, Informix, SQL server)and saved as
>>the
>>>>data files(could be Comma separated file or ASCII file) daily triggered by
>>Power
>>>>Builder application. I am wondering if there is an utility for this purpose.
>>>>Then we could Run the utility from Power Builder.
>>>>
>>>>Your help will be very appreciated.
>>>>
>>>>Jean
>>>>
>>>>---== Posted via the PFCGuide Web Newsreader ==---
>>>>http://www.pfcguide.com/_newsgroups/group_list.asp
>>>
>>>--
>>>bcarter@risingroad.com
>>>Mobile and Distributed Enterprise Database Applications
>>>www.risingroad.com
>
>--
>bcarter@risingroad.com
>Mobile and Distributed Enterprise Database Applications
>www.risingroad.com


Breck Carter [TeamSybase] Posted on 2003-11-13 20:53:15.0Z
From: "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: Load data file into ASA database
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <jpq7rv0dkaigg6lr7dvc0c7tl393tc6sdt@4ax.com>
References: <3fb2a53d$1@forums-1-dub> <8ve5rvco1pd0n4lipa83frcr70gqbu48mm@4ax.com> <3fb3a9ee$1@forums-1-dub> <n2g7rvgbd83hrckcnbup8dp46keroeb46n@4ax.com> <3fb3d076$1@forums-1-dub>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
X-Original-Trace: 13 Nov 2003 12:58:47 -0800, bcarter.sentex.ca
Lines: 147
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 13 Nov 2003 12:44:07 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 13 Nov 2003 12:53:15 -0800
X-Trace: forums-1-dub 1068756795 10.22.108.75 (13 Nov 2003 12:53:15 -0800)
X-Original-Trace: 13 Nov 2003 12:53:15 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2081
Article PK: 4297

INPUT is an ISQL command, not a SQL command. In other words, it only
works in dbisql.exe, not from PB.

LOAD TABLE can be run from PowerBuilder via PB's EXECUTE IMMEDIATE.
Understand that the file specification is relative to the computer
running the ASA database server, not the computer running the PB
client application; not a problem if they're the same machine, or if
the file is on the server computer, otherwise you can use UNC file
specs.

Here's a template that I have *not* tested:

string ls_sql

ls_sql = "LOAD TABLE temp_t1 FROM 't1.txt'"

EXECUTE IMMEDIATE :ls_sql USING itr_sqlca;

IF itr_sqlca.SQLCODE <> 0 THEN
MessageBox ( "Error", &
"EXECUTE IMMEDIATE failed in ccc:" &
+ "~r~nCommand = " &
+ ls_sql &
+ "~r~nSQLCode = " &
+ String ( itr_sqlca.SQLCode ) &
+ "~r~nSQLDBCode = " &
+ String ( itr_sqlca.SQLDBCode ) &
+ "~r~n" &
+ itr_sqlca.SQLErrText )
RETURN
END IF

Breck

On 13 Nov 2003 10:41:58 -0800, "Jean" <j.wang@csdcsystems.com> wrote:

>Hi! Breck.
>
>Thank you very much for your quick response.
>
>I have looked the documentation of SQL Anywhere Studio 9.0.0 and found that
>INPUT statement seems to work for my situation.
>
>What I want to do is to have a smaller database in ASA from Oracle, or Informix,
>or SQL server database. The data should be updated into ASA database daily
>through our Power Builder application. I want to save the data, part of tables,
>from one of big database into ASCII file, then load or input into ASA database
>through Power Builder daily.
>
>The reason that we needs smaller database in ASA is we are using ASA database as
>our consolidate database for Mobile Link in our Palm project. Right now,
>Informix is not supported for direct sync using Mobile Link. So we put data into
>ASA from different dbms, then sync.
>
>If you could give me an example or let me know where I can find an example how
>to do LOAD TABLE or INPUT command from Power Builder (code from Power Builder),
>I would appreciate it.
>
>Thank you again.
>
>Jean
>
>
>
>On 13 Nov 2003 09:47:41 -0800,
> in ianywhere.public.general
>Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>>If you can "unload" part or all of the source tables into text files,
>>you can use LOAD TABLE to load those files. Or use the PB pipeline.
>>
>>Tip: You can LOAD TABLE into a temporary table, and then
>>INSERT...SELECT from that table over to a permanent one, if that makes
>>your life easier.
>>
>>Please explain *exactly* what you want to do and folks may have
>>suggestions.
>>
>>Also, have a look at this chapter in the ASA 9 Help:
>>
>>=====
>>ASA SQL User's Guide
>> Importing and Exporting Data
>>=====
>>
>>Breck
>>
>>On 13 Nov 2003 07:57:34 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>>
>>>Hi!Breck,
>>>
>>>Thank you very much for your reply. I user Powerbuilder version 7.0.3 and
>build
>>>10135 now. We also have Powerbuilder version 9.0 build 5.07. I am using
>Adaptive
>>>Server Anywhere 9.0.0(1108)
>>>
>>>It is better that we only insert part of tables into ASA database from one of
>>>three dbms, not whole tables. Also, ASA dose not support Informix. Any
>>>suggestions?
>>>
>>>Regards;
>>>
>>>Jean
>>>
>>>
>>>On 12 Nov 2003 15:12:58 -0800,
>>> in ianywhere.public.general
>>>Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>>>>The LOAD TABLE statement is quite flexible and VERY fast.
>>>>
>>>>What version/build are you using?
>>>>
>>>>Breck
>>>>
>>>>On 12 Nov 2003 13:25:17 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>>>>
>>>>>Hi! There;
>>>>>
>>>>>We need to insert data into Adaptive Server Anywhere database. The data are
>>>>>retrieved from one of three dbms (Oracle, Informix, SQL server)and saved as
>>>the
>>>>>data files(could be Comma separated file or ASCII file) daily triggered by
>>>Power
>>>>>Builder application. I am wondering if there is an utility for this purpose.
>>>>>Then we could Run the utility from Power Builder.
>>>>>
>>>>>Your help will be very appreciated.
>>>>>
>>>>>Jean
>>>>>
>>>>>---== Posted via the PFCGuide Web Newsreader ==---
>>>>>http://www.pfcguide.com/_newsgroups/group_list.asp
>>>>
>>>>--
>>>>bcarter@risingroad.com
>>>>Mobile and Distributed Enterprise Database Applications
>>>>www.risingroad.com
>>
>>--
>>bcarter@risingroad.com
>>Mobile and Distributed Enterprise Database Applications
>>www.risingroad.com

--
bcarter@risingroad.com
Mobile and Distributed Enterprise Database Applications
www.risingroad.com


Jean Posted on 2003-11-14 22:08:49.0Z
From: "Jean" <j.wang@csdcsystems.com>
Newsgroups: ianywhere.public.general
Organization: 209.250.153.21
References: <3fb2a53d$1@forums-1-dub> <8ve5rvco1pd0n4lipa83frcr70gqbu48mm@4ax.com> <3fb3a9ee$1@forums-1-dub> <n2g7rvgbd83hrckcnbup8dp46keroeb46n@4ax.com> <3fb3d076$1@forums-1-dub> <jpq7rv0dkaigg6lr7dvc0c7tl393tc6sdt@4ax.com>
X-Newsreader: AspNNTP 1.50 (Tri Hoang)
Subject: Re: Load data file into ASA database
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: transinc-win02.netoptex.com
Message-ID: <3fb553c4@forums-2-dub>
X-Original-Trace: 14 Nov 2003 14:14:28 -0800, transinc-win02.netoptex.com
Lines: 169
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 14 Nov 2003 13:59:37 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 14 Nov 2003 14:08:49 -0800
X-Trace: forums-1-dub 1068847729 10.22.108.75 (14 Nov 2003 14:08:49 -0800)
X-Original-Trace: 14 Nov 2003 14:08:49 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2087
Article PK: 4304

Hi! Breck;

Thank you very much for the template. I will try to test it next week and let
you know the result. Now I know how to do it from Power Builder.

I really appreciate your help.

Jean


On 13 Nov 2003 12:53:15 -0800,
in ianywhere.public.general

Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>INPUT is an ISQL command, not a SQL command. In other words, it only
>works in dbisql.exe, not from PB.
>
>LOAD TABLE can be run from PowerBuilder via PB's EXECUTE IMMEDIATE.
>Understand that the file specification is relative to the computer
>running the ASA database server, not the computer running the PB
>client application; not a problem if they're the same machine, or if
>the file is on the server computer, otherwise you can use UNC file
>specs.
>
>Here's a template that I have *not* tested:
>
>string ls_sql
>
>ls_sql = "LOAD TABLE temp_t1 FROM 't1.txt'"
>
>EXECUTE IMMEDIATE :ls_sql USING itr_sqlca;
>
>IF itr_sqlca.SQLCODE <> 0 THEN
> MessageBox ( "Error", &
> "EXECUTE IMMEDIATE failed in ccc:" &
> + "~r~nCommand = " &
> + ls_sql &
> + "~r~nSQLCode = " &
> + String ( itr_sqlca.SQLCode ) &
> + "~r~nSQLDBCode = " &
> + String ( itr_sqlca.SQLDBCode ) &
> + "~r~n" &
> + itr_sqlca.SQLErrText )
> RETURN
>END IF
>
>Breck
>
>On 13 Nov 2003 10:41:58 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>
>>Hi! Breck.
>>
>>Thank you very much for your quick response.
>>
>>I have looked the documentation of SQL Anywhere Studio 9.0.0 and found that
>>INPUT statement seems to work for my situation.
>>
>>What I want to do is to have a smaller database in ASA from Oracle, or
Informix,
>>or SQL server database. The data should be updated into ASA database daily
>>through our Power Builder application. I want to save the data, part of
tables,
>>from one of big database into ASCII file, then load or input into ASA database
>>through Power Builder daily.
>>
>>The reason that we needs smaller database in ASA is we are using ASA database
as
>>our consolidate database for Mobile Link in our Palm project. Right now,
>>Informix is not supported for direct sync using Mobile Link. So we put data
into
>>ASA from different dbms, then sync.
>>
>>If you could give me an example or let me know where I can find an example how
>>to do LOAD TABLE or INPUT command from Power Builder (code from Power
Builder),
>>I would appreciate it.
>>
>>Thank you again.
>>
>>Jean
>>
>>
>>
>>On 13 Nov 2003 09:47:41 -0800,
>> in ianywhere.public.general
>>Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>>>If you can "unload" part or all of the source tables into text files,
>>>you can use LOAD TABLE to load those files. Or use the PB pipeline.
>>>
>>>Tip: You can LOAD TABLE into a temporary table, and then
>>>INSERT...SELECT from that table over to a permanent one, if that makes
>>>your life easier.
>>>
>>>Please explain *exactly* what you want to do and folks may have
>>>suggestions.
>>>
>>>Also, have a look at this chapter in the ASA 9 Help:
>>>
>>>=====
>>>ASA SQL User's Guide
>>> Importing and Exporting Data
>>>=====
>>>
>>>Breck
>>>
>>>On 13 Nov 2003 07:57:34 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>>>
>>>>Hi!Breck,
>>>>
>>>>Thank you very much for your reply. I user Powerbuilder version 7.0.3 and
>>build
>>>>10135 now. We also have Powerbuilder version 9.0 build 5.07. I am using
>>Adaptive
>>>>Server Anywhere 9.0.0(1108)
>>>>
>>>>It is better that we only insert part of tables into ASA database from one
of
>>>>three dbms, not whole tables. Also, ASA dose not support Informix. Any
>>>>suggestions?
>>>>
>>>>Regards;
>>>>
>>>>Jean
>>>>
>>>>
>>>>On 12 Nov 2003 15:12:58 -0800,
>>>> in ianywhere.public.general
>>>>Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>>>>>The LOAD TABLE statement is quite flexible and VERY fast.
>>>>>
>>>>>What version/build are you using?
>>>>>
>>>>>Breck
>>>>>
>>>>>On 12 Nov 2003 13:25:17 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>>>>>
>>>>>>Hi! There;
>>>>>>
>>>>>>We need to insert data into Adaptive Server Anywhere database. The data
are
>>>>>>retrieved from one of three dbms (Oracle, Informix, SQL server)and saved
as
>>>>the
>>>>>>data files(could be Comma separated file or ASCII file) daily triggered by
>>>>Power
>>>>>>Builder application. I am wondering if there is an utility for this
purpose.
>>>>>>Then we could Run the utility from Power Builder.
>>>>>>
>>>>>>Your help will be very appreciated.
>>>>>>
>>>>>>Jean
>>>>>>
>>>>>>---== Posted via the PFCGuide Web Newsreader ==---
>>>>>>http://www.pfcguide.com/_newsgroups/group_list.asp
>>>>>
>>>>>--
>>>>>bcarter@risingroad.com
>>>>>Mobile and Distributed Enterprise Database Applications
>>>>>www.risingroad.com
>>>
>>>--
>>>bcarter@risingroad.com
>>>Mobile and Distributed Enterprise Database Applications
>>>www.risingroad.com
>
>--
>bcarter@risingroad.com
>Mobile and Distributed Enterprise Database Applications
>www.risingroad.com


Jean Posted on 2003-11-18 21:16:39.0Z
From: "Jean" <j.wang@csdcsystems.com>
Newsgroups: ianywhere.public.general
Organization: 209.250.153.21
References: <3fb2a53d$1@forums-1-dub> <8ve5rvco1pd0n4lipa83frcr70gqbu48mm@4ax.com> <3fb3a9ee$1@forums-1-dub> <n2g7rvgbd83hrckcnbup8dp46keroeb46n@4ax.com> <3fb3d076$1@forums-1-dub> <jpq7rv0dkaigg6lr7dvc0c7tl393tc6sdt@4ax.com>
X-Newsreader: AspNNTP 1.50 (Tri Hoang)
Subject: Re: Load data file into ASA database
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: transinc-win02.netoptex.com
X-Original-NNTP-Posting-Host: transinc-win02.netoptex.com
Message-ID: <3fba8c37$1@forums-1-dub>
Date: 18 Nov 2003 13:16:39 -0800
X-Trace: forums-1-dub 1069190199 206.169.167.22 (18 Nov 2003 13:16:39 -0800)
X-Original-Trace: 18 Nov 2003 13:16:39 -0800, transinc-win02.netoptex.com
Lines: 165
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2099
Article PK: 4315

Thank you Breck. I tested today based on your template. It works!

Thank you very much for your help.

Jean

On 13 Nov 2003 12:53:15 -0800,
in ianywhere.public.general

Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>INPUT is an ISQL command, not a SQL command. In other words, it only
>works in dbisql.exe, not from PB.
>
>LOAD TABLE can be run from PowerBuilder via PB's EXECUTE IMMEDIATE.
>Understand that the file specification is relative to the computer
>running the ASA database server, not the computer running the PB
>client application; not a problem if they're the same machine, or if
>the file is on the server computer, otherwise you can use UNC file
>specs.
>
>Here's a template that I have *not* tested:
>
>string ls_sql
>
>ls_sql = "LOAD TABLE temp_t1 FROM 't1.txt'"
>
>EXECUTE IMMEDIATE :ls_sql USING itr_sqlca;
>
>IF itr_sqlca.SQLCODE <> 0 THEN
> MessageBox ( "Error", &
> "EXECUTE IMMEDIATE failed in ccc:" &
> + "~r~nCommand = " &
> + ls_sql &
> + "~r~nSQLCode = " &
> + String ( itr_sqlca.SQLCode ) &
> + "~r~nSQLDBCode = " &
> + String ( itr_sqlca.SQLDBCode ) &
> + "~r~n" &
> + itr_sqlca.SQLErrText )
> RETURN
>END IF
>
>Breck
>
>On 13 Nov 2003 10:41:58 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>
>>Hi! Breck.
>>
>>Thank you very much for your quick response.
>>
>>I have looked the documentation of SQL Anywhere Studio 9.0.0 and found that
>>INPUT statement seems to work for my situation.
>>
>>What I want to do is to have a smaller database in ASA from Oracle, or
Informix,
>>or SQL server database. The data should be updated into ASA database daily
>>through our Power Builder application. I want to save the data, part of
tables,
>>from one of big database into ASCII file, then load or input into ASA database
>>through Power Builder daily.
>>
>>The reason that we needs smaller database in ASA is we are using ASA database
as
>>our consolidate database for Mobile Link in our Palm project. Right now,
>>Informix is not supported for direct sync using Mobile Link. So we put data
into
>>ASA from different dbms, then sync.
>>
>>If you could give me an example or let me know where I can find an example how
>>to do LOAD TABLE or INPUT command from Power Builder (code from Power
Builder),
>>I would appreciate it.
>>
>>Thank you again.
>>
>>Jean
>>
>>
>>
>>On 13 Nov 2003 09:47:41 -0800,
>> in ianywhere.public.general
>>Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>>>If you can "unload" part or all of the source tables into text files,
>>>you can use LOAD TABLE to load those files. Or use the PB pipeline.
>>>
>>>Tip: You can LOAD TABLE into a temporary table, and then
>>>INSERT...SELECT from that table over to a permanent one, if that makes
>>>your life easier.
>>>
>>>Please explain *exactly* what you want to do and folks may have
>>>suggestions.
>>>
>>>Also, have a look at this chapter in the ASA 9 Help:
>>>
>>>=====
>>>ASA SQL User's Guide
>>> Importing and Exporting Data
>>>=====
>>>
>>>Breck
>>>
>>>On 13 Nov 2003 07:57:34 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>>>
>>>>Hi!Breck,
>>>>
>>>>Thank you very much for your reply. I user Powerbuilder version 7.0.3 and
>>build
>>>>10135 now. We also have Powerbuilder version 9.0 build 5.07. I am using
>>Adaptive
>>>>Server Anywhere 9.0.0(1108)
>>>>
>>>>It is better that we only insert part of tables into ASA database from one
of
>>>>three dbms, not whole tables. Also, ASA dose not support Informix. Any
>>>>suggestions?
>>>>
>>>>Regards;
>>>>
>>>>Jean
>>>>
>>>>
>>>>On 12 Nov 2003 15:12:58 -0800,
>>>> in ianywhere.public.general
>>>>Breck Carter [TeamSybase] <NOSPAM__bcarter@risingroad.com> wrote:
>>>>>The LOAD TABLE statement is quite flexible and VERY fast.
>>>>>
>>>>>What version/build are you using?
>>>>>
>>>>>Breck
>>>>>
>>>>>On 12 Nov 2003 13:25:17 -0800, "Jean" <j.wang@csdcsystems.com> wrote:
>>>>>
>>>>>>Hi! There;
>>>>>>
>>>>>>We need to insert data into Adaptive Server Anywhere database. The data
are
>>>>>>retrieved from one of three dbms (Oracle, Informix, SQL server)and saved
as
>>>>the
>>>>>>data files(could be Comma separated file or ASCII file) daily triggered by
>>>>Power
>>>>>>Builder application. I am wondering if there is an utility for this
purpose.
>>>>>>Then we could Run the utility from Power Builder.
>>>>>>
>>>>>>Your help will be very appreciated.
>>>>>>
>>>>>>Jean
>>>>>>
>>>>>>---== Posted via the PFCGuide Web Newsreader ==---
>>>>>>http://www.pfcguide.com/_newsgroups/group_list.asp
>>>>>
>>>>>--
>>>>>bcarter@risingroad.com
>>>>>Mobile and Distributed Enterprise Database Applications
>>>>>www.risingroad.com
>>>
>>>--
>>>bcarter@risingroad.com
>>>Mobile and Distributed Enterprise Database Applications
>>>www.risingroad.com
>
>--
>bcarter@risingroad.com
>Mobile and Distributed Enterprise Database Applications
>www.risingroad.com


MickeyBob Posted on 2003-11-20 16:54:21.0Z
Sender: 2c13.3fbcf112.1804289383@sybase.com
From: MickeyBob
Newsgroups: ianywhere.public.general
Subject: Re: Load data file into ASA database
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <3fbcf1bd.2c1b.846930886@sybase.com>
References: <3fb2a53d$1@forums-1-dub> <8ve5rvco1pd0n4lipa83frcr70gqbu48mm@4ax.com> <3fb3a9ee$1@forums-1-dub> <n2g7rvgbd83hrckcnbup8dp46keroeb46n@4ax.com> <3fb3d076$1@forums-1-dub> <jpq7rv0dkaigg6lr7dvc0c7tl393tc6sdt@4ax.com><3fba8c37$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 20 Nov 2003 08:54:21 -0800
X-Trace: forums-1-dub 1069347261 10.22.241.41 (20 Nov 2003 08:54:21 -0800)
X-Original-Trace: 20 Nov 2003 08:54:21 -0800, 10.22.241.41
Lines: 19
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2115
Article PK: 4331

FYI

Here's a quick and dirty stored procedure I wrote for
importing data from CSV/ASCII files.

It takes three parameters: the name of the table where the
data should go, the name of the CSV file, and a bit which if
1 tells the stored procedure to delete all existing records.

ALTER PROCEDURE "DBA"."ImportTable"(in TableName
varchar(255), in FileSpec varchar(255), in Purge bit)
BEGIN
IF Purge = 1 THEN
EXECUTE IMMEDIATE WITH ESCAPES OFF 'DELETE FROM ' ||
TableName;
END IF;
EXECUTE IMMEDIATE WITH ESCAPES OFF 'LOAD TABLE ' ||
TableName || ' FROM ''' || FileSpec || '''';
END