Search Results

Search found 1530 results on 62 pages for 'killer pl'.

Page 41/62 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Prolog newbie question: Making a procedure to print Hello World

    - by dmindreader
    I want to load this simple something into my Editor: Write:-repeat,write("hi"),nl,fail. So that it prints "hi". What should I do? I'm currently trying to do File->New and Saving a file named Write into E:\Program Files\pl\xpce\prolog\lib When doing the query: ?-Write. It's printing: 1 ?- Write. % ... 1,000,000 ............ 10,000,000 years later % % >> 42 << (last release gives the question) Why?

    Read the article

  • Algorithm to fill slots

    - by Peter Lang
    I am searching for an algorithm to fill several slots, which are already filled to some level. The current levels and the available quantity to fill are known Resulting levels should be as equal as possible, but existing level cannot be reduced Slots are filled from left to right, so left slots get higher level if equal level is impossible       The image above shows six examples, each column represents a slot. The grey area is already filled, the blue are is the expected position of the new elements. I could iterate through my slots and increase the quantity on the lowest slot by 1 until the available quantity is consumed, but I wonder about how to actually calculate the new filling levels. I am going to implement this with SQL/PL/SQL, other code is just as welcome though :)

    Read the article

  • Accessing the Custom Object Return type from ojdbc6 JDBC Thin Drivers

    - by Andrew Harmel-Law
    I'm writing some JDBC code which calls a Oracle 11g PL/SQL procdedure which has a Custom Object return type. I can get the code to call the procedure, but how do I access the returned Custom Object to obtain it's contained values?. An example of my code calling the procedure is below: PLSQL Code: Procedure GetDataSummary (p_my_key IN KEYS.MY_KEY%TYPE, p_recordset OUT data_summary_tab, p_status OUT VARCHAR2); Java Code: String query = "begin manageroleviewdata.getdatasummary(?, ?, ?); end;"); CallableStatement stmt = conn.prepareCall(query); stmt.setInt(1, 83); stmt.registerOutParameter(2, OracleTypes.ARRAY, "DATA_SUMMARY_TAB"); stmt.registerOutParameter(3, OracleTypes.VARCHAR); stmt.execute(stmt); How do I get the result back fron this?

    Read the article

  • Cannot stop Oracle Queue - Could not find program unit being called: "SYS.DBMS_ASSERT"

    - by Vladimir Bezugliy
    Cannot stop and drop oracle Queue. Following code BEGIN DBMS_AQADM.STOP_QUEUE ( queue_name => 'TEST_QUEUE'); DBMS_AQADM.DROP_QUEUE( queue_name => 'TEST_QUEUE'); END; / produces following errors: ERROR at line 1: ORA-04068: existing state of packages has been discarded ORA-04065: not executed, altered or dropped stored procedure "SYS.DBMS_ASSERT" ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_ASSERT" ORA-06512: at "SYS.DBMS_AQADM_SYS", line 3365 ORA-06512: at "SYS.DBMS_AQADM", line 167 ORA-06512: at line 5 What can be the root cause of this problem?

    Read the article

  • How to prevent form submission for a form using onchange to submit the form when certain values are

    - by Terrence Brannon
    I have a form I have built: <form class="myform" action="cgi.pl"> <select name="export" onchange='this.form.submit()'> <option value="" selected="selected">Choose an export format</option> <option value="html">HTML</option> <option value="csv">CSV</option> </select> </form> Now, this form works fine if I pull down and select "HTML" or "CSV". But if I hit the back button and select "Choose an export format", the form is submitted, even though I dont want it to be. Is there any way to prevent form submission for that option?

    Read the article

  • Perl open call failing.

    - by benjamin button
    I am new to perl coding. I am facing a problem while executing a small script i have: open is not able to find the file which i am giving as an argument.Please see below: File is available: ls -l DLmissing_months.sql -rwxr-xr-x 1 tlmwrk61 aimsys 2842 May 16 09:44 DLmissing_months.sql My perl script: #!/usr/local/bin/perl use strict; use warnings; my $this_line = ""; my $do_next = 0; my $file_name = $ARGV[0]; open( my $fh, '<', '$file_name') or die "Error opening file - $!\n"; close($fh); executing the perl script : > new.pl DLmissing_months.sql Error opening file - No such file or directory what is the problem with my perl script.

    Read the article

  • perl: Run remote perl script through SSH and query environment variables on remote machine

    - by kakyo
    I'm running a perl script through SSH, in the perl script I query environment variables using $ENV{MY_VAR_NAME} and it works fine when run locally. But through SSH, all environment variables become unset. I also tried to run system("source ~/.bash_profile"); at the beginning of my script to no avail. Any tips? EDIT: Rephrasing my question. I have machine A and B. I ran my perl on machine B, trying to get the environment variables on B and it worked. Then I ssh from A to B running the same script, i.e., using this code ssh user@B perl myscript.pl This time the environment variables on B are all blank. Any tips? UPDATE: I found that running the above script, ~/.bashrc on Machine B was invoked, but after setting environment variables in ~/.bashrc, run the above command again and still I don't see any environment variables. Also, if my perl script contains only echo $ENV{PATH} Then I get /usr/bin:/bin:/usr/sbin:/sbin

    Read the article

  • Prolog n00b question: Doing whatever

    - by dmindreader
    I want to load this simple something into my Editor: Write:-repeat,write("hi"),nl,fail. So that it prints "hi". What should I do? I'm currently trying to do File->New and Saving a file named Write into E:\Program Files\pl\xpce\prolog\lib When doing the query: ?-Write. It's printing: 1 ?- Write. % ... 1,000,000 ............ 10,000,000 years later % % >> 42 << (last release gives the question) Why?

    Read the article

  • Concatenation with Zero is not occurring properly in code?

    - by Vineet
    I was trying to reverse a number in PL/SQL. It's working fine, but when my number contains any 0, the output is unexpected. For example: 1234 output 4321 1000 output 1 1203 ouput 3021 10001 output 1 DECLARE r number(9); num number(9):=&p_num; BEGIN WHILE num>=1 LOOP IF mod(num,10)=0 THEN -- extracting last digit of a number . r:=r||0; --if end digit is 0 then concat r with 0 ELSE r:=r||mod(num,10);--if mod is not 0 then it would be last digit. END IF; num:=trunc(num/10);--Removing last digit from number END LOOP; dbms_output.put_line(r); END;

    Read the article

  • Convert perl one-liner into a script

    - by Stefan Lasiewski
    I find alot of perl one-liners online. Sometimes I want to convert these one-liners into a script, because otherwise I'll forget the syntax of the one-liner. For example, I'm using the following command (from nagios.com): tail -f /var/log/nagios/nagios.log | perl -pe 's/(\d+)/localtime/e' I'd to replace it with something like this: tail -f /var/log/nagios/nagios.log | ~/bin/nagiostime.pl However, I can't figure out the best way to quickly throw this stuff into a script. Does anyone have a quick way to throw these one-liners into a Bash or Perl script?

    Read the article

  • how to initialize a 2d array in perl

    - by Mark
    How do I initialize a 2d array in perl? I am trying the following code: 0 use strict; 10 my @frame_events = (((1) x 10), ((1) x 10)); 20 print "$frame_events[1][1]\n"; but it gives the following error: Can't use string ("1") as an ARRAY ref while "strict refs" in use at ./dyn_pf.pl line 20. This syntax only seems to initialize a 1d array as print "$frame_events[1]\n" works. Though perl doesn't give any error during the assignment.

    Read the article

  • Oracle TNS problems ?

    - by persistence
    I have an error ? My pl/Sql Developer says my oracle database cannot find the service descriptor But when I Do a check the listener I get this error. LSNRCTL> start Starting tnslsnr: please wait... Service OracleOraDb10g_home1TNSListener already running. TNS-12560: TNS:protocol adapter error TNS-00530: Protocol adapter error LSNRCTL> status Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener 32-bit Windows Error: 61: Unknown error Please I have a deadline for these evening. Please help.

    Read the article

  • How do I ignore the Perl shebang on Windows with Apache 2?

    - by nbolton
    I have set up a local Perl web environment on my Windows machine. The application I'm working on is originally from a Linux server, and so the shebang for source .pl files look like so: #!/usr/bin/perl This causes the following error on my Windows dev machine: (OS 2)The system cannot find the file specified. Is it possible to change my Apache 2 conf so that the shebang is ignored on my Windows machine? Of course I could set the shebang to #!c:\perl\bin\perl.exe, that much is obvious; but the problem comes to deploying the updated files. Clearly it would be very inconvenient to change this back on each deploy. I am using ActivePerl on Windows 7. Update: I should have mentioned that I need to keep the shebang so that the scripts will work on our shared hosting Linux production server. If I did not have this constraint and I didn't have to use the shebang, the obvious answer would be to just not use it.

    Read the article

  • Is there a way to pass a custom type from C# to Oracle using System.Data.OracleClient?

    - by Frankie Simon
    I was searching online for a solution to passing a string array to a stored procedure in Oracle. The "easy" but messy way was using a comma delimited string. I had found a sample based on which I created my own type of TABLE of VARCHAR2(200). I understood that I could use a constructor created "behind-the-scenes" by Oracle to give a list of values that would, in the PL/SQL, be treated as a TABLE I could iterate through. But when I got to the C# I saw that there is no way for me to create an OracleParameter object that would allow me to use this implicit constructor. All the samples I'm finding online for now are dealing with Oracle Data Adapter, none say anything about System.Data.OracleClient. Is there a way to achieve this?

    Read the article

  • regex to match postgresql bytea

    - by filiprem
    In PostgreSQL, there is a BLOB datatype called bytea. It's just an array of bytes. bytea literals are output in the following way: '\\037\\213\\010\\010\\005`Us\\000\\0001.fp3\'\\223\\222%' See PostgreSQL docs for full definition of the format. I'm trying to construct a Perl regular expression which will match any such string. It should also match standard ANSI SQL string literals, like 'Joe', 'Joe''s Mom', 'Fish Called ''Wendy''' It should also match backslash-escaped variant: 'Joe\'s Mom', . First aproach (shown below) works only for some bytea representations. s{ ' # Opening apostrophe (?: # Start group [^\\\'] # Anything but a backslash or an apostrophe | # or \\ . # Backslash and anything | # or \'\' # Double apostrophe )* # End of group ' # Closing apostrophe }{LITERAL_REPLACED}xgo; For other (longer ones, with many escaped apostrophes, Perl gives such warning: Complex regular subexpression recursion limit (32766) exceeded at ./sqa.pl line 33, < line 1. So I am looking for a better (but still regex-based) solution, it probably requires some regex alchemy (avoiding backreferences and all).

    Read the article

  • Combining GPL with MPL and BSD

    - by thr
    I have a software project I want to release under GPLv3, it uses two pieces of code that other parties have developed (one is the DLR by Microsoft, which is under the Microsoft Public License and the other piece of code is under the New BSD License). The BSD licensed code is compiled into the same binary as my code (but none of it is changed) The Ms-PL licensed code is compiled into another assembly next to my code and linked at runtime (and none of it is changed what so ever). Can I release my software under GPLv3 and without any legal problems?

    Read the article

  • Notepad++ Associate custom ext for use by ctags

    - by user185420
    Hi, I use .pkb and pkh extensions for PL/SQL files (rather than .sql). I have already associated .pkb and .pkh extension in the langs.xml (Styler Config) so that Notepad++ recognizes the syntax highlight to use when I open pkb and pkh files (the syntax highlighting would be the same as for sql ext). Now the problem is that I cannot use plugins that parse code using ctags (like SourceCookifier, OpenCtag,GtagSearch) because these plugins do not recognize the pkb and pkh extension. THe only way I could use them is to change my file to sql and when done change to the pkh or pkb ext. Is there any config that could make ctags based plugin work with non-sql ext? I tried changing various config for the plugins but did not succeed in making them work. Thanks.

    Read the article

  • Concatenation with Zero is not occuring properly in code?

    - by Vineet
    I was trying to reverse a number in pl/sql ,its working fine but when my number contain any 0,output come unexpected .for eg 1234 output 4321 1000 output 1 1203 ouput 3021 10001 output 1 DECLARE r number(9); num number(9):=&p_num; BEGIN WHILE num>=1 LOOP IF mod(num,10)=0 THEN -- extracting last digit of a number . r:=r||0; --if end digit is 0 then concat r with 0 ELSE r:=r||mod(num,10);--if mod is not 0 then it would be last digit. END IF; num:=trunc(num/10);--Removing last digit from number END LOOP; dbms_output.put_line(r); END;

    Read the article

  • Change Large Number of Record Keys using Map Table

    - by Coyote
    I have a set of records indexed by id numbers, I need to convert these record's indexes to a new id number. I have a two column table mapping the old numbers to the new numbers. For example given these two tables, what would the update statement look like? Given: OLD_TO_NEW oldid | newid ----------------- 1234 0987 7698 5645 ... ... and id | data ---------------- 1234 'yo' 7698 'hey' ... ... Need: id | data ---------------- 0987 'yo' 5645 'hey' ... ... This oracle so I have access to PL/SQL, I'm just trying to avoid it.

    Read the article

  • Curl redirect,, not working?

    - by Sushant Panigrahi
    I'm using the following code: $agent= 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0'; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_URL, "www.example.com"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $output = curl_exec($ch); echo $output; But it redirects to like this: http://localhost/aide.do?sht=_aide_cookies_ Instead of to the URL page. Can anyone help me solve my problem, please?

    Read the article

  • Why use Oracle Application Express for web app?

    - by Jack
    Hi all. I believe we're moving to Oracle Apex for future development. I've read about Oracle Apex on wikipedia and it's pro and con. It seem to me the con outweigh the pro but maybe I'm wrong. I get the sense that Oracle Apex is for DBA with little or no programing knowledge to setup a web app quickly sort like MS Access for none programmer. If you have Oracle Apex working experience, can you share your though? From wikipedia's entry, it doesn't seem like you need to know any programming language at all but just the PL/SQL? edit: Is Oracle Apex scalable? Can it handle traffic like Facebook's size? Thank. Jack

    Read the article

  • PHP calling PostgreSQL function - type issue?

    - by CitrusTree
    I have a function in PostgreSQL / plpgsql with the following signature: CREATE OR REPLACE FUNCTION user_login(TEXT, TEXT) RETURNS SETOF _get_session AS $$ ... $$ Where _get_session is a view. The function works fine when calling it from phpPgAdmin, however whan I call it from PHP I get the following error: Warning: pg_query() [function.pg-query]: Query failed: ERROR: type "session_ids" does not exist CONTEXT: compile of PL/pgSQL function "user_login" near line 2 in /home/sites/blah.com/index.php on line 69 The DECLARE section of the function contains the following variables: oldSessionId session_ids := $1; newSessionId session_ids := $2; The domain session_ids DOES exist, and other functions which use the same domain work when called from the same script. The PHP is as follows: $query = "SELECT * FROM $dbschema.user_login('$session_old'::TEXT, '$session'::TEXT)"; $result = pg_query($login, $query); I have also tried this using ::session_ids in place of ::TEXT when calling the function, however I recieve the same error. Help :o(

    Read the article

  • Exporting SQL Server table to CSV issue commas, tabs and quotes

    - by cyberpine
    After we export to flat file CSV, columns with commas, quotes and tabs cause problems in Excel. The vendor needs to read the file in Excel to make manual changes and then needs it in a flat file format CSV format to load using PL/SQL into an Oracle table. I can remove those characters from the table in SQL Server, but is there a smarter way? Does it make sense to save to CSV when done in Excel and will that cause problems when attempting to load the file into Oracle anyway? Also, we need the first row to have column names.. any SQL way to generate all the files in one swoop (the the tiles in the first row) rather than using export to flat file?

    Read the article

  • Iterating Oracle collections of objects with out exploding them

    - by Scott Bailey
    I'm using Oracle object data types to represent a timespan or period. And I've got to do a bunch of operations that involve working with collections of periods. Iterating over collections in SQL is significantly faster than in PL/SQL. CREATE TYPE PERIOD AS OBJECT ( beginning DATE, ending DATE, ... some member functions...); CREATE TYPE PERIOD_TABLE AS TABLE OF PERIOD; -- sample usage SELECT <<period object>>.contains(period2) FROM TABLE(period_table1) t The problem is that the TABLE() function explodes the objects into scalar values, and I really need the objects instead. I could use the scalar values to recreate the objects but this would incur the overhead of re-instantiating the objects. And the period is designed to be subclassed so there would be additional difficulty trying to figure out what to initialize it as. Is there another way to do this that doesn't destroy my objects?

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >