如何读取此sql文件? [英] How to read this sql file?

查看:283
本文介绍了如何读取此sql文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个监视温度,光线和声音的设备(远程).它使用无线将数据传输到PC并存储在数据库(PostgreSQL)中.存储数据后,我将其导出为.sql扩展文件.我将只能通过设备公司提供的程序查看数据.

我的项目的主要目的是使数据在html上可见,并且无法在线发布.
我将使用输出数据(.sql文件)并将其使用PERL和CGI在html上发布的位置.

关于如何使.sql文件在PERL中可读的方法是否有帮助,或者我是否需要另一个程序来读取数据库输出(.sql文件),然后使PERL脚本能够读取filen,然后将其联机发布?

我正在使用的设备是Xbow制造的,并且我正在运行Win XP.

任何帮助将不胜感激.

问候
约瑟夫

Hi,

I have a device(mote) that monitor temperature, light and sound. It transmit the data to PC using wireless and store in a database (PostgreSQL). After storing the data, i have it exported out becoming a .sql extenstion file. I will be only able to view the data via a program provided by the device company.

The main aim of my project is to make data viewable on html where im able to publish it online.
Where i will be using the output data (.sql file) and publish it on html using PERL and CGI.

Any helps on how i can make the .sql file readable in PERL or do i need another program to read the database output(.sql file) then making PERL script able to read the filen and then publish it online?

The device I''m using which is made by Xbow and im running Win XP.

Any help would be greatly appreciated.

Regards
Joseph

推荐答案

您需要弄清的第一件事是.sql文件的格式.如果它只是一些文本文件.sql扩展名的描述,您很幸运!

如果它是某些专有格式的二进制文件,那么您将大受伤害.
The first thing you need to work out is what format the .sql file is in. If it is simply a text file of some description with the .sql extension, you are in luck!!

If it''s some proprietary format binary file, you are in a world of hurt.


是的,它在文本文件中.

文件中内容的一些示例.

Yes, it is in a text file.

Some example of what is in the file.

--
-- PostgreSQL database dump
--
SET client_encoding = 'SQL_ASCII';
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: tele
--
COMMENT ON SCHEMA public IS 'Standard public schema';

SET search_path = public, pg_catalog;
--
-- Name: plpgsql_call_handler(); Type: FUNCTION; Schema: public; Owner: tele
--
CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler
    AS '


libdir/plpgsql',' plpgsql_call_handler' 语言c; ALTER FUNCTION public .plpgsql_call_handler()所有者; -- -名称:plpgsql_validator(oid);类型:FUNCTION;架构: public ;所有者:电话 -- 创建函数plpgsql_validator(oid)返回 void AS '
libdir/plpgsql', 'plpgsql_call_handler' LANGUAGE c; ALTER FUNCTION public.plpgsql_call_handler() OWNER TO tele; -- -- Name: plpgsql_validator(oid); Type: FUNCTION; Schema: public; Owner: tele -- CREATE FUNCTION plpgsql_validator(oid) RETURNS void AS '


这篇关于如何读取此sql文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆